From c4ab080edd43a03587bc96087475e14a9487f0a1 Mon Sep 17 00:00:00 2001 From: Jonathan Megevand Date: Fri, 17 Dec 2021 14:21:32 +0100 Subject: [PATCH] Rebase/Regen --- .../java/zap-generated/CHIPClusters-JNI.cpp | 102 +- .../java/zap-generated/CHIPReadCallbacks.h | 48 + .../chip/devicecontroller/ChipClusters.java | 166 +- .../zap-generated/cluster-objects.cpp | 15 - .../zap-generated/cluster-objects.h | 53 +- .../chip-tool/zap-generated/test/Commands.h | 58062 +--------------- 6 files changed, 350 insertions(+), 58096 deletions(-) diff --git a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp index 6858e8dac9c58e..308e21cf3fc61c 100644 --- a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp @@ -29358,8 +29358,10 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionLiftAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -29381,9 +29383,9 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionLiftAttribute) onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), CHIPWindowCoveringCurrentPositionLiftAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -29395,8 +29397,10 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionTiltAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -29418,9 +29422,9 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionTiltAttribute) onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), CHIPWindowCoveringCurrentPositionTiltAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -29469,8 +29473,10 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionLiftPercentageAt (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -29493,9 +29499,10 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionLiftPercentageAt onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -29507,8 +29514,10 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionTiltPercentageAt (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -29531,9 +29540,10 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionTiltPercentageAt onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -29582,8 +29592,10 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeTargetPositionLiftPercent100ths (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -29606,9 +29618,10 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeTargetPositionLiftPercent100ths onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -29620,8 +29633,10 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeTargetPositionTiltPercent100ths (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -29644,9 +29659,10 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeTargetPositionTiltPercent100ths onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -29695,8 +29711,10 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionLiftPercent100th (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -29719,9 +29737,10 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionLiftPercent100th onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -29733,8 +29752,10 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionTiltPercent100th (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -29757,9 +29778,10 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionTiltPercent100th onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.h b/src/controller/java/zap-generated/CHIPReadCallbacks.h index 766e9894421cd0..28cdb38b656134 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -4789,6 +4789,12 @@ class CHIPWindowCoveringCurrentPositionLiftAttributeCallback } 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; @@ -4813,6 +4819,12 @@ class CHIPWindowCoveringCurrentPositionTiltAttributeCallback } 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; @@ -4837,6 +4849,12 @@ class CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback } 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; @@ -4861,6 +4879,12 @@ class CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback } 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; @@ -4885,6 +4909,12 @@ class CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback } 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; @@ -4909,6 +4939,12 @@ class CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback } 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; @@ -4933,6 +4969,12 @@ class CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback } 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; @@ -4957,6 +4999,12 @@ class CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback } 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; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index aac3ab56f1b7d0..9b6d1e1de2f5a9 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -14199,6 +14199,70 @@ private native void goToTiltValue( private native void upOrOpen(long chipClusterPtr, DefaultClusterCallback Callback); + public interface CurrentPositionLiftAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface CurrentPositionTiltAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface CurrentPositionLiftPercentageAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface CurrentPositionTiltPercentageAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface TargetPositionLiftPercent100thsAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface TargetPositionTiltPercent100thsAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface CurrentPositionLiftPercent100thsAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface CurrentPositionTiltPercent100thsAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + public interface AttributeListAttributeCallback { void onSuccess(List valueList); @@ -14216,21 +14280,21 @@ public void subscribeTypeAttribute( subscribeTypeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readCurrentPositionLiftAttribute(IntegerAttributeCallback callback) { + public void readCurrentPositionLiftAttribute(CurrentPositionLiftAttributeCallback callback) { readCurrentPositionLiftAttribute(chipClusterPtr, callback); } public void subscribeCurrentPositionLiftAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { + CurrentPositionLiftAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentPositionLiftAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readCurrentPositionTiltAttribute(IntegerAttributeCallback callback) { + public void readCurrentPositionTiltAttribute(CurrentPositionTiltAttributeCallback callback) { readCurrentPositionTiltAttribute(chipClusterPtr, callback); } public void subscribeCurrentPositionTiltAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { + CurrentPositionTiltAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentPositionTiltAttribute(chipClusterPtr, callback, minInterval, maxInterval); } @@ -14243,22 +14307,24 @@ public void subscribeConfigStatusAttribute( subscribeConfigStatusAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readCurrentPositionLiftPercentageAttribute(IntegerAttributeCallback callback) { + public void readCurrentPositionLiftPercentageAttribute( + CurrentPositionLiftPercentageAttributeCallback callback) { readCurrentPositionLiftPercentageAttribute(chipClusterPtr, callback); } public void subscribeCurrentPositionLiftPercentageAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { + CurrentPositionLiftPercentageAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentPositionLiftPercentageAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void readCurrentPositionTiltPercentageAttribute(IntegerAttributeCallback callback) { + public void readCurrentPositionTiltPercentageAttribute( + CurrentPositionTiltPercentageAttributeCallback callback) { readCurrentPositionTiltPercentageAttribute(chipClusterPtr, callback); } public void subscribeCurrentPositionTiltPercentageAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { + CurrentPositionTiltPercentageAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentPositionTiltPercentageAttribute( chipClusterPtr, callback, minInterval, maxInterval); } @@ -14272,22 +14338,28 @@ public void subscribeOperationalStatusAttribute( subscribeOperationalStatusAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readTargetPositionLiftPercent100thsAttribute(IntegerAttributeCallback callback) { + public void readTargetPositionLiftPercent100thsAttribute( + TargetPositionLiftPercent100thsAttributeCallback callback) { readTargetPositionLiftPercent100thsAttribute(chipClusterPtr, callback); } public void subscribeTargetPositionLiftPercent100thsAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { + TargetPositionLiftPercent100thsAttributeCallback callback, + int minInterval, + int maxInterval) { subscribeTargetPositionLiftPercent100thsAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void readTargetPositionTiltPercent100thsAttribute(IntegerAttributeCallback callback) { + public void readTargetPositionTiltPercent100thsAttribute( + TargetPositionTiltPercent100thsAttributeCallback callback) { readTargetPositionTiltPercent100thsAttribute(chipClusterPtr, callback); } public void subscribeTargetPositionTiltPercent100thsAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { + TargetPositionTiltPercent100thsAttributeCallback callback, + int minInterval, + int maxInterval) { subscribeTargetPositionTiltPercent100thsAttribute( chipClusterPtr, callback, minInterval, maxInterval); } @@ -14301,22 +14373,28 @@ public void subscribeEndProductTypeAttribute( subscribeEndProductTypeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readCurrentPositionLiftPercent100thsAttribute(IntegerAttributeCallback callback) { + public void readCurrentPositionLiftPercent100thsAttribute( + CurrentPositionLiftPercent100thsAttributeCallback callback) { readCurrentPositionLiftPercent100thsAttribute(chipClusterPtr, callback); } public void subscribeCurrentPositionLiftPercent100thsAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { + CurrentPositionLiftPercent100thsAttributeCallback callback, + int minInterval, + int maxInterval) { subscribeCurrentPositionLiftPercent100thsAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void readCurrentPositionTiltPercent100thsAttribute(IntegerAttributeCallback callback) { + public void readCurrentPositionTiltPercent100thsAttribute( + CurrentPositionTiltPercent100thsAttributeCallback callback) { readCurrentPositionTiltPercent100thsAttribute(chipClusterPtr, callback); } public void subscribeCurrentPositionTiltPercent100thsAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { + CurrentPositionTiltPercent100thsAttributeCallback callback, + int minInterval, + int maxInterval) { subscribeCurrentPositionTiltPercent100thsAttribute( chipClusterPtr, callback, minInterval, maxInterval); } @@ -14409,16 +14487,22 @@ private native void subscribeTypeAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readCurrentPositionLiftAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, CurrentPositionLiftAttributeCallback callback); private native void subscribeCurrentPositionLiftAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + long chipClusterPtr, + CurrentPositionLiftAttributeCallback callback, + int minInterval, + int maxInterval); private native void readCurrentPositionTiltAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, CurrentPositionTiltAttributeCallback callback); private native void subscribeCurrentPositionTiltAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + long chipClusterPtr, + CurrentPositionTiltAttributeCallback callback, + int minInterval, + int maxInterval); private native void readConfigStatusAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -14427,16 +14511,22 @@ private native void subscribeConfigStatusAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readCurrentPositionLiftPercentageAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, CurrentPositionLiftPercentageAttributeCallback callback); private native void subscribeCurrentPositionLiftPercentageAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + long chipClusterPtr, + CurrentPositionLiftPercentageAttributeCallback callback, + int minInterval, + int maxInterval); private native void readCurrentPositionTiltPercentageAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, CurrentPositionTiltPercentageAttributeCallback callback); private native void subscribeCurrentPositionTiltPercentageAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + long chipClusterPtr, + CurrentPositionTiltPercentageAttributeCallback callback, + int minInterval, + int maxInterval); private native void readOperationalStatusAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -14445,16 +14535,22 @@ private native void subscribeOperationalStatusAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readTargetPositionLiftPercent100thsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, TargetPositionLiftPercent100thsAttributeCallback callback); private native void subscribeTargetPositionLiftPercent100thsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + long chipClusterPtr, + TargetPositionLiftPercent100thsAttributeCallback callback, + int minInterval, + int maxInterval); private native void readTargetPositionTiltPercent100thsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, TargetPositionTiltPercent100thsAttributeCallback callback); private native void subscribeTargetPositionTiltPercent100thsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + long chipClusterPtr, + TargetPositionTiltPercent100thsAttributeCallback callback, + int minInterval, + int maxInterval); private native void readEndProductTypeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -14463,16 +14559,22 @@ private native void subscribeEndProductTypeAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readCurrentPositionLiftPercent100thsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, CurrentPositionLiftPercent100thsAttributeCallback callback); private native void subscribeCurrentPositionLiftPercent100thsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + long chipClusterPtr, + CurrentPositionLiftPercent100thsAttributeCallback callback, + int minInterval, + int maxInterval); private native void readCurrentPositionTiltPercent100thsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, CurrentPositionTiltPercent100thsAttributeCallback callback); private native void subscribeCurrentPositionTiltPercent100thsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + long chipClusterPtr, + CurrentPositionTiltPercent100thsAttributeCallback callback, + int minInterval, + int maxInterval); private native void readInstalledOpenLimitLiftAttribute( long chipClusterPtr, IntegerAttributeCallback callback); 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 273a248180a573..0c370c6a6f0393 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 @@ -13426,24 +13426,9 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre case Attributes::InstalledClosedLimitTilt::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, installedClosedLimitTilt)); break; - case Attributes::VelocityLift::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, velocityLift)); - break; - case Attributes::AccelerationTimeLift::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, accelerationTimeLift)); - break; - case Attributes::DecelerationTimeLift::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, decelerationTimeLift)); - break; case Attributes::Mode::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, mode)); break; - case Attributes::IntermediateSetpointsLift::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, intermediateSetpointsLift)); - break; - case Attributes::IntermediateSetpointsTilt::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, intermediateSetpointsTilt)); - break; case Attributes::SafetyStatus::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, safetyStatus)); break; 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 d4bdc624334cc3..e3594cda9d249e 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 @@ -19349,9 +19349,9 @@ struct TypeInfo namespace CurrentPositionLift { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + 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::WindowCovering::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentPositionLift::Id; } @@ -19361,9 +19361,9 @@ struct TypeInfo namespace CurrentPositionTilt { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + 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::WindowCovering::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentPositionTilt::Id; } @@ -19409,9 +19409,9 @@ struct TypeInfo namespace CurrentPositionLiftPercentage { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + 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::WindowCovering::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentPositionLiftPercentage::Id; } @@ -19421,9 +19421,9 @@ struct TypeInfo namespace CurrentPositionTiltPercentage { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + 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::WindowCovering::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentPositionTiltPercentage::Id; } @@ -19445,9 +19445,9 @@ struct TypeInfo namespace TargetPositionLiftPercent100ths { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + 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::WindowCovering::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::TargetPositionLiftPercent100ths::Id; } @@ -19457,9 +19457,9 @@ struct TypeInfo namespace TargetPositionTiltPercent100ths { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + 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::WindowCovering::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::TargetPositionTiltPercent100ths::Id; } @@ -19481,9 +19481,9 @@ struct TypeInfo namespace CurrentPositionLiftPercent100ths { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + 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::WindowCovering::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentPositionLiftPercent100ths::Id; } @@ -19493,9 +19493,9 @@ struct TypeInfo namespace CurrentPositionTiltPercent100ths { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + 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::WindowCovering::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentPositionTiltPercent100ths::Id; } @@ -19639,12 +19639,7 @@ struct TypeInfo Attributes::InstalledClosedLimitLift::TypeInfo::DecodableType installedClosedLimitLift; Attributes::InstalledOpenLimitTilt::TypeInfo::DecodableType installedOpenLimitTilt; Attributes::InstalledClosedLimitTilt::TypeInfo::DecodableType installedClosedLimitTilt; - Attributes::VelocityLift::TypeInfo::DecodableType velocityLift; - Attributes::AccelerationTimeLift::TypeInfo::DecodableType accelerationTimeLift; - Attributes::DecelerationTimeLift::TypeInfo::DecodableType decelerationTimeLift; Attributes::Mode::TypeInfo::DecodableType mode; - Attributes::IntermediateSetpointsLift::TypeInfo::DecodableType intermediateSetpointsLift; - Attributes::IntermediateSetpointsTilt::TypeInfo::DecodableType intermediateSetpointsTilt; Attributes::SafetyStatus::TypeInfo::DecodableType safetyStatus; Attributes::AttributeList::TypeInfo::DecodableType attributeList; Attributes::FeatureMap::TypeInfo::DecodableType featureMap; diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 2acb42ab978db5..1e3f535d40fa43 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -7,57917 +7,7 @@ * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.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. - */ - -// THIS FILE IS GENERATED BY ZAP - -#pragma once - -#include -#include -#include -#include - -#include // For INFINITY - -class TestList : public Command -{ -public: - TestList() : Command("list"){}; - CHIP_ERROR Run() override - { - printf("Test_TC_BI_1_1\n"); - printf("Test_TC_BI_2_1\n"); - printf("Test_TC_BI_2_2\n"); - printf("Test_TC_BOOL_1_1\n"); - printf("Test_TC_BOOL_2_1\n"); - printf("Test_TC_CC_1_1\n"); - printf("Test_TC_CC_2_1\n"); - printf("Test_TC_CC_3_1\n"); - printf("Test_TC_CC_3_2\n"); - printf("Test_TC_CC_3_3\n"); - printf("Test_TC_CC_4_1\n"); - printf("Test_TC_CC_4_2\n"); - printf("Test_TC_CC_4_3\n"); - printf("Test_TC_CC_4_4\n"); - printf("Test_TC_CC_5_1\n"); - printf("Test_TC_CC_5_2\n"); - printf("Test_TC_CC_5_3\n"); - printf("Test_TC_CC_6_1\n"); - printf("Test_TC_CC_6_2\n"); - printf("Test_TC_CC_6_3\n"); - printf("Test_TC_CC_7_1\n"); - printf("Test_TC_CC_7_2\n"); - printf("Test_TC_CC_7_3\n"); - printf("Test_TC_CC_7_4\n"); - printf("Test_TC_CC_8_1\n"); - printf("Test_TC_CC_9_1\n"); - printf("Test_TC_CC_9_2\n"); - printf("Test_TC_CC_9_3\n"); - printf("Test_TC_DD_1_5\n"); - printf("Test_TC_DD_1_6\n"); - printf("Test_TC_DD_1_7\n"); - printf("Test_TC_DD_1_8\n"); - printf("Test_TC_DD_1_9\n"); - printf("Test_TC_DM_1_1\n"); - printf("Test_TC_DM_3_1\n"); - printf("Test_TC_DM_2_2\n"); - printf("Test_TC_EMR_1_1\n"); - printf("Test_TC_FLW_1_1\n"); - printf("Test_TC_FLW_2_1\n"); - printf("Test_TC_FLW_2_2\n"); - printf("Test_TC_ILL_1_1\n"); - printf("Test_TC_LVL_1_1\n"); - printf("Test_TC_LVL_2_1\n"); - printf("Test_TC_LVL_3_1\n"); - printf("Test_TC_LVL_4_1\n"); - printf("Test_TC_LVL_5_1\n"); - printf("Test_TC_MC_1_1\n"); - printf("Test_TC_MC_2_1\n"); - printf("Test_TC_MC_3_1\n"); - printf("Test_TC_MC_3_2\n"); - printf("Test_TC_MC_3_3\n"); - printf("Test_TC_MC_3_4\n"); - printf("Test_TC_MC_3_5\n"); - printf("Test_TC_MC_3_6\n"); - printf("Test_TC_MC_3_7\n"); - printf("Test_TC_MC_3_8\n"); - printf("Test_TC_MC_3_9\n"); - printf("Test_TC_MC_3_10\n"); - printf("Test_TC_MC_3_11\n"); - printf("Test_TC_OCC_1_1\n"); - printf("Test_TC_OCC_2_1\n"); - printf("Test_TC_OCC_2_2\n"); - printf("Test_TC_OO_1_1\n"); - printf("Test_TC_OO_2_1\n"); - printf("Test_TC_OO_2_2\n"); - printf("Test_TC_OO_2_3\n"); - printf("Test_TC_PRS_1_1\n"); - printf("Test_TC_PRS_2_1\n"); - printf("Test_TC_PCC_1_1\n"); - printf("Test_TC_PCC_2_1\n"); - printf("Test_TC_PCC_2_2\n"); - printf("Test_TC_PCC_2_3\n"); - printf("Test_TC_RH_1_1\n"); - printf("Test_TC_RH_2_1\n"); - printf("Test_TC_RH_2_2\n"); - printf("Test_TC_TM_1_1\n"); - printf("Test_TC_TM_2_1\n"); - printf("Test_TC_TM_2_2\n"); - printf("Test_TC_TSTAT_1_1\n"); - printf("Test_TC_TSTAT_2_1\n"); - printf("Test_TC_TSTAT_2_2\n"); - printf("Test_TC_TSUIC_1_1\n"); - printf("Test_TC_TSUIC_2_1\n"); - printf("Test_TC_TSUIC_2_2\n"); - printf("Test_TC_DIAGTH_1_1\n"); - printf("Test_TC_WNCV_1_1\n"); - printf("Test_TC_WNCV_2_1\n"); - printf("Test_TC_WNCV_2_2\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("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("TestClusterComplexTypes\n"); - printf("TestConstraints\n"); - printf("TestDelayCommands\n"); - printf("TestLogCommands\n"); - printf("TestSaveAs\n"); - printf("TestDescriptorCluster\n"); - printf("TestBasicInformation\n"); - printf("TestIdentifyCluster\n"); - printf("TestGroupsCluster\n"); - printf("TestOperationalCredentialsCluster\n"); - printf("TestModeSelectCluster\n"); - printf("TestGroupMessaging\n"); - printf("Test_TC_DIAGSW_1_1\n"); - printf("Test_TC_DIAGSW_2_1\n"); - printf("Test_TC_DIAGSW_3_2\n"); - printf("TestSubscribe_OnOff\n"); - - return CHIP_NO_ERROR; - } -}; - -class Test_TC_BI_1_1 : public TestCommand -{ -public: - Test_TC_BI_1_1() : TestCommand("Test_TC_BI_1_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BI_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BI_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 : 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; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_2(clusterRevision); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_4(clusterRevision); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint16_t clusterRevision) - { - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 1U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_3() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); - - NextTest(); - } -}; - -class Test_TC_BI_2_1 : public TestCommand -{ -public: - Test_TC_BI_2_1() : TestCommand("Test_TC_BI_2_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BI_2_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BI_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 : Read mandatory non-global attribute: OutOfService\n"); - err = TestReadMandatoryNonGlobalAttributeOutOfService_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read mandatory non-global attribute constraints: OutOfService\n"); - err = TestReadMandatoryNonGlobalAttributeConstraintsOutOfService_2(); - break; - case 3: - ChipLogProgress(chipTool, - " ***** Test Step 3 : Write the default values to mandatory non-global attribute: OutOfService\n"); - err = TestWriteTheDefaultValuesToMandatoryNonGlobalAttributeOutOfService_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads back the mandatory non-global attribute: OutOfService\n"); - err = TestReadsBackTheMandatoryNonGlobalAttributeOutOfService_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read mandatory non-global attribute constraints: PresentValue\n"); - err = TestReadMandatoryNonGlobalAttributeConstraintsPresentValue_5(); - break; - case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : Write the default values to mandatory non-global attribute: PresentValue\n"); - err = TestWriteTheDefaultValuesToMandatoryNonGlobalAttributePresentValue_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Reads back the mandatory non-global attribute: PresentValue\n"); - err = TestReadsBackTheMandatoryNonGlobalAttributePresentValue_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read mandatory non-global attribute: StatusFlags\n"); - err = TestReadMandatoryNonGlobalAttributeStatusFlags_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read mandatory non-global attribute constraints: StatusFlags\n"); - err = TestReadMandatoryNonGlobalAttributeConstraintsStatusFlags_9(); - break; - case 10: - ChipLogProgress(chipTool, - " ***** Test Step 10 : Write the default values to mandatory non-global attribute: StatusFlags\n"); - err = TestWriteTheDefaultValuesToMandatoryNonGlobalAttributeStatusFlags_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Reads back the mandatory non-global attribute: StatusFlags\n"); - err = TestReadsBackTheMandatoryNonGlobalAttributeStatusFlags_11(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 12; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, bool outOfService) - { - (static_cast(context))->OnSuccessResponse_1(outOfService); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool outOfService) - { - (static_cast(context))->OnSuccessResponse_2(outOfService); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, bool outOfService) - { - (static_cast(context))->OnSuccessResponse_4(outOfService); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, bool presentValue) - { - (static_cast(context))->OnSuccessResponse_5(presentValue); - } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, bool presentValue) - { - (static_cast(context))->OnSuccessResponse_7(presentValue); - } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context, uint8_t statusFlags) - { - (static_cast(context))->OnSuccessResponse_8(statusFlags); - } - - static void OnFailureCallback_9(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context, uint8_t statusFlags) - { - (static_cast(context))->OnSuccessResponse_9(statusFlags); - } - - static void OnFailureCallback_10(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_10(status); - } - - static void OnSuccessCallback_10(void * context) { (static_cast(context))->OnSuccessResponse_10(); } - - static void OnFailureCallback_11(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_11(status); - } - - static void OnSuccessCallback_11(void * context, uint8_t statusFlags) - { - (static_cast(context))->OnSuccessResponse_11(statusFlags); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadMandatoryNonGlobalAttributeOutOfService_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(bool outOfService) - { - VerifyOrReturn(CheckValue("outOfService", outOfService, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadMandatoryNonGlobalAttributeConstraintsOutOfService_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool outOfService) - { - VerifyOrReturn(CheckConstraintType("outOfService", "", "bool")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryNonGlobalAttributeOutOfService_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - bool outOfServiceArgument; - outOfServiceArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - outOfServiceArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestReadsBackTheMandatoryNonGlobalAttributeOutOfService_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(bool outOfService) - { - VerifyOrReturn(CheckValue("outOfService", outOfService, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadMandatoryNonGlobalAttributeConstraintsPresentValue_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(bool presentValue) - { - VerifyOrReturn(CheckConstraintType("presentValue", "", "bool")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryNonGlobalAttributePresentValue_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - bool presentValueArgument; - presentValueArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - presentValueArgument, this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6() { NextTest(); } - - CHIP_ERROR TestReadsBackTheMandatoryNonGlobalAttributePresentValue_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(bool presentValue) - { - VerifyOrReturn(CheckValue("presentValue", presentValue, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadMandatoryNonGlobalAttributeStatusFlags_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8(uint8_t statusFlags) - { - VerifyOrReturn(CheckValue("statusFlags", statusFlags, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadMandatoryNonGlobalAttributeConstraintsStatusFlags_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9(uint8_t statusFlags) - { - VerifyOrReturn(CheckConstraintType("statusFlags", "", "map8")); - VerifyOrReturn(CheckConstraintMaxValue("statusFlags", statusFlags, 15)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryNonGlobalAttributeStatusFlags_10() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t statusFlagsArgument; - statusFlagsArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - statusFlagsArgument, this, OnSuccessCallback_10, OnFailureCallback_10)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_10() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackTheMandatoryNonGlobalAttributeStatusFlags_11() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_11, OnFailureCallback_11)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_11(uint8_t statusFlags) - { - VerifyOrReturn(CheckValue("statusFlags", statusFlags, 0)); - - NextTest(); - } -}; - -class Test_TC_BI_2_2 : public TestCommand -{ -public: - Test_TC_BI_2_2() : TestCommand("Test_TC_BI_2_2"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BI_2_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BI_2_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 : Reads PresentValue attribute from DUT\n"); - err = ShouldSkip("A_PRESENTVALUE") ? CHIP_NO_ERROR : TestReadsPresentValueAttributeFromDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads OutOfService attribute from DUT\n"); - err = ShouldSkip("A_OUTOFSERVICE") ? CHIP_NO_ERROR : TestReadsOutOfServiceAttributeFromDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads StatusFlags attribute from DUT\n"); - err = ShouldSkip("A_STATUSFLAGS") ? CHIP_NO_ERROR : TestReadsStatusFlagsAttributeFromDut_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads PresentValue attribute from DUT\n"); - err = ShouldSkip("A_PRESENTVALUE") ? CHIP_NO_ERROR : TestReadsPresentValueAttributeFromDut_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Reads OutOfService attribute from DUT\n"); - err = ShouldSkip("A_OUTOFSERVICE") ? CHIP_NO_ERROR : TestReadsOutOfServiceAttributeFromDut_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Reads StatusFlags attribute from DUT\n"); - err = ShouldSkip("A_STATUSFLAGS") ? CHIP_NO_ERROR : TestReadsStatusFlagsAttributeFromDut_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Reads StatusFlags attribute from DUT\n"); - err = ShouldSkip("A_STATUSFLAGS") ? CHIP_NO_ERROR : TestReadsStatusFlagsAttributeFromDut_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Reads StatusFlags attribute from DUT\n"); - err = ShouldSkip("A_STATUSFLAGS") ? CHIP_NO_ERROR : TestReadsStatusFlagsAttributeFromDut_8(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, bool presentValue) - { - (static_cast(context))->OnSuccessResponse_1(presentValue); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool outOfService) - { - (static_cast(context))->OnSuccessResponse_2(outOfService); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, uint8_t statusFlags) - { - (static_cast(context))->OnSuccessResponse_3(statusFlags); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, bool presentValue) - { - (static_cast(context))->OnSuccessResponse_4(presentValue); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, bool outOfService) - { - (static_cast(context))->OnSuccessResponse_5(outOfService); - } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, uint8_t statusFlags) - { - (static_cast(context))->OnSuccessResponse_6(statusFlags); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, uint8_t statusFlags) - { - (static_cast(context))->OnSuccessResponse_7(statusFlags); - } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context, uint8_t statusFlags) - { - (static_cast(context))->OnSuccessResponse_8(statusFlags); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadsPresentValueAttributeFromDut_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(bool presentValue) - { - VerifyOrReturn(CheckValue("presentValue", presentValue, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadsOutOfServiceAttributeFromDut_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool outOfService) - { - VerifyOrReturn(CheckValue("outOfService", outOfService, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadsStatusFlagsAttributeFromDut_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(uint8_t statusFlags) - { - VerifyOrReturn(CheckValue("statusFlags", statusFlags, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadsPresentValueAttributeFromDut_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(bool presentValue) - { - VerifyOrReturn(CheckValue("presentValue", presentValue, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadsOutOfServiceAttributeFromDut_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(bool outOfService) - { - VerifyOrReturn(CheckValue("outOfService", outOfService, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadsStatusFlagsAttributeFromDut_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(uint8_t statusFlags) - { - VerifyOrReturn(CheckValue("statusFlags", statusFlags, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadsStatusFlagsAttributeFromDut_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(uint8_t statusFlags) - { - VerifyOrReturn(CheckValue("statusFlags", statusFlags, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadsStatusFlagsAttributeFromDut_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8(uint8_t statusFlags) - { - VerifyOrReturn(CheckValue("statusFlags", statusFlags, 0)); - - NextTest(); - } -}; - -class Test_TC_BOOL_1_1 : public TestCommand -{ -public: - Test_TC_BOOL_1_1() : TestCommand("Test_TC_BOOL_1_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BOOL_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BOOL_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 : 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; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_2(clusterRevision); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_4(clusterRevision); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BooleanStateClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BooleanStateClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint16_t clusterRevision) - { - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BooleanStateClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 1U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_3() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BooleanStateClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); - - NextTest(); - } -}; - -class Test_TC_BOOL_2_1 : public TestCommand -{ -public: - Test_TC_BOOL_2_1() : TestCommand("Test_TC_BOOL_2_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BOOL_2_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BOOL_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 : Read mandatory non-global attribute: StateValue\n"); - err = TestReadMandatoryNonGlobalAttributeStateValue_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read mandatory non-global attribute constraints: StateValue\n"); - err = TestReadMandatoryNonGlobalAttributeConstraintsStateValue_2(); - break; - case 3: - ChipLogProgress(chipTool, - " ***** Test Step 3 : Write the default value to mandatory non-global attribute: StateValue\n"); - err = TestWriteTheDefaultValueToMandatoryNonGlobalAttributeStateValue_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads back the mandatory non-global attribute: StateValue\n"); - err = TestReadsBackTheMandatoryNonGlobalAttributeStateValue_4(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, bool stateValue) - { - (static_cast(context))->OnSuccessResponse_1(stateValue); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool stateValue) - { - (static_cast(context))->OnSuccessResponse_2(stateValue); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, bool stateValue) - { - (static_cast(context))->OnSuccessResponse_4(stateValue); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadMandatoryNonGlobalAttributeStateValue_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BooleanStateClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(bool stateValue) - { - VerifyOrReturn(CheckValue("stateValue", stateValue, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadMandatoryNonGlobalAttributeConstraintsStateValue_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BooleanStateClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool stateValue) - { - VerifyOrReturn(CheckConstraintType("stateValue", "", "bool")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValueToMandatoryNonGlobalAttributeStateValue_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BooleanStateClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - bool stateValueArgument; - stateValueArgument = 1; - - ReturnErrorOnFailure(cluster.WriteAttribute( - stateValueArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_3() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackTheMandatoryNonGlobalAttributeStateValue_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::BooleanStateClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(bool stateValue) - { - VerifyOrReturn(CheckValue("stateValue", stateValue, 0)); - - NextTest(); - } -}; - -class Test_TC_CC_1_1 : public TestCommand -{ -public: - Test_TC_CC_1_1() : TestCommand("Test_TC_CC_1_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_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 constraints : ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); - break; - case 2: - ChipLogProgress(chipTool, - " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint16_t clusterRevision) - { - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 4U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_2() { ThrowSuccessResponse(); } -}; - -class Test_TC_CC_2_1 : public TestCommand -{ -public: - Test_TC_CC_2_1() : TestCommand("Test_TC_CC_2_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_2_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_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 : Reads mandatory attribute: CurrentHue\n"); - err = TestReadsMandatoryAttributeCurrentHue_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Validate constraints of attribute: current hue\n"); - err = TestValidateConstraintsOfAttributeCurrentHue_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Write the default value to mandatory attribute: CurrentHue\n"); - err = TestWriteTheDefaultValueToMandatoryAttributeCurrentHue_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads back mandatory attribute: CurrentHue\n"); - err = TestReadsBackMandatoryAttributeCurrentHue_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Reads mandatory attribute: CurrentSaturation\n"); - err = TestReadsMandatoryAttributeCurrentSaturation_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Validate constraints of attribute: CurrentSaturation\n"); - err = TestValidateConstraintsOfAttributeCurrentSaturation_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Write the default value to mandatory attribute: CurrentSaturation\n"); - err = TestWriteTheDefaultValueToMandatoryAttributeCurrentSaturation_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Reads back mandatory attribute: CurrentSaturation\n"); - err = TestReadsBackMandatoryAttributeCurrentSaturation_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read the mandatory attribute: CurrentX\n"); - err = TestReadTheMandatoryAttributeCurrentX_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Validate constraints of attribute: CurrentX\n"); - err = TestValidateConstraintsOfAttributeCurrentX_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Write the default value to mandatory attribute: CurrentX\n"); - err = TestWriteTheDefaultValueToMandatoryAttributeCurrentX_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Reads back mandatory attribute: CurrentX\n"); - err = TestReadsBackMandatoryAttributeCurrentX_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Read the mandatory attribute: CurrentY\n"); - err = TestReadTheMandatoryAttributeCurrentY_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Validate constraints of attribute: CurrentY\n"); - err = TestValidateConstraintsOfAttributeCurrentY_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Write the default values to mandatory attribute: CurrentY\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeCurrentY_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Reads back mandatory attribute: CurrentY\n"); - err = TestReadsBackMandatoryAttributeCurrentY_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Validate constraints of attribute: ColorTemperatureMireds\n"); - err = TestValidateConstraintsOfAttributeColorTemperatureMireds_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Validate constraints of attribute: ColorMode\n"); - err = TestValidateConstraintsOfAttributeColorMode_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Read the mandatory attribute: Options\n"); - err = TestReadTheMandatoryAttributeOptions_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Validate constraints of attribute: Options\n"); - err = TestValidateConstraintsOfAttributeOptions_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Write the default values to mandatory attribute: Options\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeOptions_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Reads back mandatory attribute: Options\n"); - err = TestReadsBackMandatoryAttributeOptions_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Read the mandatory attribute: EnhancedCurrentHue\n"); - err = TestReadTheMandatoryAttributeEnhancedCurrentHue_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : Validate constraints of attribute: EnhancedCurrentHue\n"); - err = TestValidateConstraintsOfAttributeEnhancedCurrentHue_24(); - break; - case 25: - ChipLogProgress(chipTool, - " ***** Test Step 25 : Write the default values to mandatory attribute: EnhancedCurrentHue\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeEnhancedCurrentHue_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Reads back mandatory attribute: EnhancedCurrentHue\n"); - err = TestReadsBackMandatoryAttributeEnhancedCurrentHue_26(); - break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Validate constraints of attribute: EnhancedColorMode\n"); - err = TestValidateConstraintsOfAttributeEnhancedColorMode_27(); - break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Read the mandatory attribute: ColorLoopActive\n"); - err = TestReadTheMandatoryAttributeColorLoopActive_28(); - break; - case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Validate constraints of attribute: ColorLoopActive\n"); - err = TestValidateConstraintsOfAttributeColorLoopActive_29(); - break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Write the default values to mandatory attribute: ColorLoopActive\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeColorLoopActive_30(); - break; - case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : Reads back mandatory attribute: ColorLoopActive\n"); - err = TestReadsBackMandatoryAttributeColorLoopActive_31(); - break; - case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : Read the mandatory attribute: ColorLoopDirection\n"); - err = TestReadTheMandatoryAttributeColorLoopDirection_32(); - break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : Validate constraints of attribute: ColorLoopDirection\n"); - err = TestValidateConstraintsOfAttributeColorLoopDirection_33(); - break; - case 34: - ChipLogProgress(chipTool, - " ***** Test Step 34 : Write the default values to mandatory attribute: ColorLoopDirection\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeColorLoopDirection_34(); - break; - case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : Reads back mandatory attribute: ColorLoopDirection\n"); - err = TestReadsBackMandatoryAttributeColorLoopDirection_35(); - break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : Read the mandatory attribute: ColorLoopTime\n"); - err = TestReadTheMandatoryAttributeColorLoopTime_36(); - break; - case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : Validate constraints of attribute: ColorLoopTime\n"); - err = TestValidateConstraintsOfAttributeColorLoopTime_37(); - break; - case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : Write the default values to mandatory attribute: ColorLoopTime\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeColorLoopTime_38(); - break; - case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : Reads back mandatory attribute: ColorLoopTime\n"); - err = TestReadsBackMandatoryAttributeColorLoopTime_39(); - break; - case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : Read the mandatory attribute: ColorLoopStartEnhancedHue\n"); - err = TestReadTheMandatoryAttributeColorLoopStartEnhancedHue_40(); - break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : Validate constraints of attribute: ColorLoopStartEnhancedHue\n"); - err = TestValidateConstraintsOfAttributeColorLoopStartEnhancedHue_41(); - break; - case 42: - ChipLogProgress(chipTool, - " ***** Test Step 42 : Write the default values to mandatory attribute: ColorLoopStartEnhancedHue\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeColorLoopStartEnhancedHue_42(); - break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : Reads back mandatory attribute: ColorLoopStartEnhancedHue\n"); - err = TestReadsBackMandatoryAttributeColorLoopStartEnhancedHue_43(); - break; - case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : Read the mandatory attribute: ColorLoopStoredEnhancedHue\n"); - err = TestReadTheMandatoryAttributeColorLoopStoredEnhancedHue_44(); - break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Validate constraints of attribute: ColorLoopStoredEnhancedHue\n"); - err = TestValidateConstraintsOfAttributeColorLoopStoredEnhancedHue_45(); - break; - case 46: - ChipLogProgress(chipTool, - " ***** Test Step 46 : Write the default values to mandatory attribute: ColorLoopStoredEnhancedHue\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeColorLoopStoredEnhancedHue_46(); - break; - case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : Reads back mandatory attribute: ColorLoopStoredEnhancedHue\n"); - err = TestReadsBackMandatoryAttributeColorLoopStoredEnhancedHue_47(); - break; - case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : Read the mandatory attribute: ColorCapabilities\n"); - err = TestReadTheMandatoryAttributeColorCapabilities_48(); - break; - case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : Validate constraints of attribute: ColorCapabilities\n"); - err = TestValidateConstraintsOfAttributeColorCapabilities_49(); - break; - case 50: - ChipLogProgress(chipTool, " ***** Test Step 50 : Write the default values to mandatory attribute: ColorCapabilities\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeColorCapabilities_50(); - break; - case 51: - ChipLogProgress(chipTool, " ***** Test Step 51 : Reads back mandatory attribute: ColorCapabilities\n"); - err = TestReadsBackMandatoryAttributeColorCapabilities_51(); - break; - case 52: - ChipLogProgress(chipTool, " ***** Test Step 52 : Read the mandatory attribute: ColorTempPhysicalMinMireds\n"); - err = TestReadTheMandatoryAttributeColorTempPhysicalMinMireds_52(); - break; - case 53: - ChipLogProgress(chipTool, " ***** Test Step 53 : Validate constraints of attribute: ColorTempPhysicalMinMireds\n"); - err = TestValidateConstraintsOfAttributeColorTempPhysicalMinMireds_53(); - break; - case 54: - ChipLogProgress(chipTool, - " ***** Test Step 54 : Write the default values to mandatory attribute: ColorTempPhysicalMinMireds\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeColorTempPhysicalMinMireds_54(); - break; - case 55: - ChipLogProgress(chipTool, " ***** Test Step 55 : Reads back mandatory attribute: ColorTempPhysicalMinMireds\n"); - err = TestReadsBackMandatoryAttributeColorTempPhysicalMinMireds_55(); - break; - case 56: - ChipLogProgress(chipTool, " ***** Test Step 56 : Read the mandatory attribute: ColorTempPhysicalMaxMireds\n"); - err = TestReadTheMandatoryAttributeColorTempPhysicalMaxMireds_56(); - break; - case 57: - ChipLogProgress(chipTool, " ***** Test Step 57 : Validate constraints of attribute: ColorTempPhysicalMaxMireds\n"); - err = TestValidateConstraintsOfAttributeColorTempPhysicalMaxMireds_57(); - break; - case 58: - ChipLogProgress(chipTool, - " ***** Test Step 58 : Write the default values to mandatory attribute: ColorTempPhysicalMaxMireds\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeColorTempPhysicalMaxMireds_58(); - break; - case 59: - ChipLogProgress(chipTool, " ***** Test Step 59 : Reads back mandatory attribute: ColorTempPhysicalMaxMireds\n"); - err = TestReadsBackMandatoryAttributeColorTempPhysicalMaxMireds_59(); - break; - case 60: - ChipLogProgress(chipTool, " ***** Test Step 60 : Read the optional attribute: CoupleColorTempToLevelMinMireds\n"); - err = TestReadTheOptionalAttributeCoupleColorTempToLevelMinMireds_60(); - break; - case 61: - ChipLogProgress( - chipTool, - " ***** Test Step 61 : Write the default values to optional attribute: CoupleColorTempToLevelMinMireds\n"); - err = TestWriteTheDefaultValuesToOptionalAttributeCoupleColorTempToLevelMinMireds_61(); - break; - case 62: - ChipLogProgress(chipTool, " ***** Test Step 62 : Reads back optional attribute: CoupleColorTempToLevelMinMireds\n"); - err = TestReadsBackOptionalAttributeCoupleColorTempToLevelMinMireds_62(); - break; - case 63: - ChipLogProgress(chipTool, " ***** Test Step 63 : Read the optional attribute: StartUpColorTemperatureMireds\n"); - err = TestReadTheOptionalAttributeStartUpColorTemperatureMireds_63(); - break; - case 64: - ChipLogProgress( - chipTool, " ***** Test Step 64 : Write the default values to optional attribute: StartUpColorTemperatureMireds\n"); - err = TestWriteTheDefaultValuesToOptionalAttributeStartUpColorTemperatureMireds_64(); - break; - case 65: - ChipLogProgress(chipTool, " ***** Test Step 65 : Reads back optional attribute: StartUpColorTemperatureMireds\n"); - err = TestReadsBackOptionalAttributeStartUpColorTemperatureMireds_65(); - break; - case 66: - ChipLogProgress(chipTool, " ***** Test Step 66 : Read the Optional attribute: RemainingTime\n"); - err = TestReadTheOptionalAttributeRemainingTime_66(); - break; - case 67: - ChipLogProgress(chipTool, " ***** Test Step 67 : Validate constraints of attribute: RemainingTime\n"); - err = TestValidateConstraintsOfAttributeRemainingTime_67(); - break; - case 68: - ChipLogProgress(chipTool, " ***** Test Step 68 : Write the default values to optional attribute: RemainingTime\n"); - err = TestWriteTheDefaultValuesToOptionalAttributeRemainingTime_68(); - break; - case 69: - ChipLogProgress(chipTool, " ***** Test Step 69 : Reads back optional attribute: RemainingTime\n"); - err = TestReadsBackOptionalAttributeRemainingTime_69(); - break; - case 70: - ChipLogProgress(chipTool, " ***** Test Step 70 : Read the optional attribute: DriftCompensation\n"); - err = TestReadTheOptionalAttributeDriftCompensation_70(); - break; - case 71: - ChipLogProgress(chipTool, " ***** Test Step 71 : Write the default values to optional attribute: DriftCompensation\n"); - err = TestWriteTheDefaultValuesToOptionalAttributeDriftCompensation_71(); - break; - case 72: - ChipLogProgress(chipTool, " ***** Test Step 72 : Reads back optional attribute: DriftCompensation\n"); - err = TestReadsBackOptionalAttributeDriftCompensation_72(); - break; - case 73: - ChipLogProgress(chipTool, " ***** Test Step 73 : Read the optional attribute: CompensationText\n"); - err = TestReadTheOptionalAttributeCompensationText_73(); - break; - case 74: - ChipLogProgress(chipTool, " ***** Test Step 74 : Read the mandatory attribute: NumberOfPrimaries\n"); - err = TestReadTheMandatoryAttributeNumberOfPrimaries_74(); - break; - case 75: - ChipLogProgress(chipTool, " ***** Test Step 75 : Write the default mandatory attribute: NumberOfPrimaries\n"); - err = TestWriteTheDefaultMandatoryAttributeNumberOfPrimaries_75(); - break; - case 76: - ChipLogProgress(chipTool, " ***** Test Step 76 : Read back the mandatory attribute: NumberOfPrimaries\n"); - err = TestReadBackTheMandatoryAttributeNumberOfPrimaries_76(); - break; - case 77: - ChipLogProgress(chipTool, " ***** Test Step 77 : Read the mandatory attribute: Primary1X\n"); - err = TestReadTheMandatoryAttributePrimary1X_77(); - break; - case 78: - ChipLogProgress(chipTool, " ***** Test Step 78 : Write the default mandatory attribute: Primary1X\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary1X_78(); - break; - case 79: - ChipLogProgress(chipTool, " ***** Test Step 79 : Read back the mandatory attribute: Primary1X\n"); - err = TestReadBackTheMandatoryAttributePrimary1X_79(); - break; - case 80: - ChipLogProgress(chipTool, " ***** Test Step 80 : Read the mandatory attribute: Primary1Y\n"); - err = TestReadTheMandatoryAttributePrimary1Y_80(); - break; - case 81: - ChipLogProgress(chipTool, " ***** Test Step 81 : Write the default mandatory attribute: Primary1Y\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary1Y_81(); - break; - case 82: - ChipLogProgress(chipTool, " ***** Test Step 82 : Read back the mandatory attribute: Primary1Y\n"); - err = TestReadBackTheMandatoryAttributePrimary1Y_82(); - break; - case 83: - ChipLogProgress(chipTool, " ***** Test Step 83 : Read the mandatory attribute: Primary1Intensity\n"); - err = TestReadTheMandatoryAttributePrimary1Intensity_83(); - break; - case 84: - ChipLogProgress(chipTool, " ***** Test Step 84 : Read the mandatory attribute: Primary2X\n"); - err = TestReadTheMandatoryAttributePrimary2X_84(); - break; - case 85: - ChipLogProgress(chipTool, " ***** Test Step 85 : Write the default mandatory attribute: Primary2X\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary2X_85(); - break; - case 86: - ChipLogProgress(chipTool, " ***** Test Step 86 : Read back the mandatory attribute: Primary2X\n"); - err = TestReadBackTheMandatoryAttributePrimary2X_86(); - break; - case 87: - ChipLogProgress(chipTool, " ***** Test Step 87 : Read the mandatory attribute: Primary2Y\n"); - err = TestReadTheMandatoryAttributePrimary2Y_87(); - break; - case 88: - ChipLogProgress(chipTool, " ***** Test Step 88 : Write the default mandatory attribute: Primary2Y\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary2Y_88(); - break; - case 89: - ChipLogProgress(chipTool, " ***** Test Step 89 : Read back the mandatory attribute: Primary2Y\n"); - err = TestReadBackTheMandatoryAttributePrimary2Y_89(); - break; - case 90: - ChipLogProgress(chipTool, " ***** Test Step 90 : Validate constraints of attribute: Primary2Intensity\n"); - err = TestValidateConstraintsOfAttributePrimary2Intensity_90(); - break; - case 91: - ChipLogProgress(chipTool, " ***** Test Step 91 : Read the mandatory attribute: Primary3X\n"); - err = TestReadTheMandatoryAttributePrimary3X_91(); - break; - case 92: - ChipLogProgress(chipTool, " ***** Test Step 92 : Write the default mandatory attribute: Primary3X\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary3X_92(); - break; - case 93: - ChipLogProgress(chipTool, " ***** Test Step 93 : Read back the mandatory attribute: Primary3X\n"); - err = TestReadBackTheMandatoryAttributePrimary3X_93(); - break; - case 94: - ChipLogProgress(chipTool, " ***** Test Step 94 : Read the mandatory attribute: Primary3Y\n"); - err = TestReadTheMandatoryAttributePrimary3Y_94(); - break; - case 95: - ChipLogProgress(chipTool, " ***** Test Step 95 : Write the default mandatory attribute: Primary3Y\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary3Y_95(); - break; - case 96: - ChipLogProgress(chipTool, " ***** Test Step 96 : Read back the mandatory attribute: Primary3Y\n"); - err = TestReadBackTheMandatoryAttributePrimary3Y_96(); - break; - case 97: - ChipLogProgress(chipTool, " ***** Test Step 97 : Read the mandatory attribute: Primary3Intensity\n"); - err = TestReadTheMandatoryAttributePrimary3Intensity_97(); - break; - case 98: - ChipLogProgress(chipTool, " ***** Test Step 98 : Read the mandatory attribute: Primary4X\n"); - err = TestReadTheMandatoryAttributePrimary4X_98(); - break; - case 99: - ChipLogProgress(chipTool, " ***** Test Step 99 : Write the default mandatory attribute: Primary4X\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary4X_99(); - break; - case 100: - ChipLogProgress(chipTool, " ***** Test Step 100 : Read back the mandatory attribute: Primary4X\n"); - err = TestReadBackTheMandatoryAttributePrimary4X_100(); - break; - case 101: - ChipLogProgress(chipTool, " ***** Test Step 101 : Read the mandatory attribute: Primary4Y\n"); - err = TestReadTheMandatoryAttributePrimary4Y_101(); - break; - case 102: - ChipLogProgress(chipTool, " ***** Test Step 102 : Write the default mandatory attribute: Primary4Y\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary4Y_102(); - break; - case 103: - ChipLogProgress(chipTool, " ***** Test Step 103 : Read back the mandatory attribute: Primary4Y\n"); - err = TestReadBackTheMandatoryAttributePrimary4Y_103(); - break; - case 104: - ChipLogProgress(chipTool, " ***** Test Step 104 : Read the mandatory attribute: Primary4Intensity\n"); - err = TestReadTheMandatoryAttributePrimary4Intensity_104(); - break; - case 105: - ChipLogProgress(chipTool, " ***** Test Step 105 : Read the mandatory attribute: Primary5X\n"); - err = TestReadTheMandatoryAttributePrimary5X_105(); - break; - case 106: - ChipLogProgress(chipTool, " ***** Test Step 106 : Write the default mandatory attribute: Primary5X\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary5X_106(); - break; - case 107: - ChipLogProgress(chipTool, " ***** Test Step 107 : Read back the mandatory attribute: Primary5X\n"); - err = TestReadBackTheMandatoryAttributePrimary5X_107(); - break; - case 108: - ChipLogProgress(chipTool, " ***** Test Step 108 : Read the mandatory attribute: Primary5Y\n"); - err = TestReadTheMandatoryAttributePrimary5Y_108(); - break; - case 109: - ChipLogProgress(chipTool, " ***** Test Step 109 : Write the default mandatory attribute: Primary5Y\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary5Y_109(); - break; - case 110: - ChipLogProgress(chipTool, " ***** Test Step 110 : Read back the mandatory attribute: Primary5Y\n"); - err = TestReadBackTheMandatoryAttributePrimary5Y_110(); - break; - case 111: - ChipLogProgress(chipTool, " ***** Test Step 111 : Read the mandatory attribute: Primary5Intensity\n"); - err = TestReadTheMandatoryAttributePrimary5Intensity_111(); - break; - case 112: - ChipLogProgress(chipTool, " ***** Test Step 112 : Read the mandatory attribute: Primary6X\n"); - err = TestReadTheMandatoryAttributePrimary6X_112(); - break; - case 113: - ChipLogProgress(chipTool, " ***** Test Step 113 : Write the default mandatory attribute: Primary6X\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary6X_113(); - break; - case 114: - ChipLogProgress(chipTool, " ***** Test Step 114 : Read back the mandatory attribute: Primary6X\n"); - err = TestReadBackTheMandatoryAttributePrimary6X_114(); - break; - case 115: - ChipLogProgress(chipTool, " ***** Test Step 115 : Read the mandatory attribute: Primary6Y\n"); - err = TestReadTheMandatoryAttributePrimary6Y_115(); - break; - case 116: - ChipLogProgress(chipTool, " ***** Test Step 116 : Write the default mandatory attribute: Primary6Y\n"); - err = TestWriteTheDefaultMandatoryAttributePrimary6Y_116(); - break; - case 117: - ChipLogProgress(chipTool, " ***** Test Step 117 : Read back the mandatory attribute: Primary6Y\n"); - err = TestReadBackTheMandatoryAttributePrimary6Y_117(); - break; - case 118: - ChipLogProgress(chipTool, " ***** Test Step 118 : Read the mandatory attribute: Primary6Intensity\n"); - err = TestReadTheMandatoryAttributePrimary6Intensity_118(); - break; - case 119: - ChipLogProgress(chipTool, " ***** Test Step 119 : Read the optional attribute: WhitePointX\n"); - err = TestReadTheOptionalAttributeWhitePointX_119(); - break; - case 120: - ChipLogProgress(chipTool, " ***** Test Step 120 : Write the default optional attribute: WhitePointX\n"); - err = TestWriteTheDefaultOptionalAttributeWhitePointX_120(); - break; - case 121: - ChipLogProgress(chipTool, " ***** Test Step 121 : Read back the optional attribute: WhitePointX\n"); - err = TestReadBackTheOptionalAttributeWhitePointX_121(); - break; - case 122: - ChipLogProgress(chipTool, " ***** Test Step 122 : Read the optional attribute: WhitePointY\n"); - err = TestReadTheOptionalAttributeWhitePointY_122(); - break; - case 123: - ChipLogProgress(chipTool, " ***** Test Step 123 : Write the default optional attribute: WhitePointY\n"); - err = TestWriteTheDefaultOptionalAttributeWhitePointY_123(); - break; - case 124: - ChipLogProgress(chipTool, " ***** Test Step 124 : Read back the optional attribute: WhitePointY\n"); - err = TestReadBackTheOptionalAttributeWhitePointY_124(); - break; - case 125: - ChipLogProgress(chipTool, " ***** Test Step 125 : Read the optional attribute: ColorPointRX\n"); - err = TestReadTheOptionalAttributeColorPointRX_125(); - break; - case 126: - ChipLogProgress(chipTool, " ***** Test Step 126 : Write the default optional attribute: ColorPointRX\n"); - err = TestWriteTheDefaultOptionalAttributeColorPointRX_126(); - break; - case 127: - ChipLogProgress(chipTool, " ***** Test Step 127 : Read back the optional attribute: ColorPointRX\n"); - err = TestReadBackTheOptionalAttributeColorPointRX_127(); - break; - case 128: - ChipLogProgress(chipTool, " ***** Test Step 128 : Read the optional attribute: ColorPointRY\n"); - err = TestReadTheOptionalAttributeColorPointRY_128(); - break; - case 129: - ChipLogProgress(chipTool, " ***** Test Step 129 : Write the default optional attribute: ColorPointRY\n"); - err = TestWriteTheDefaultOptionalAttributeColorPointRY_129(); - break; - case 130: - ChipLogProgress(chipTool, " ***** Test Step 130 : Read back the optional attribute: ColorPointRY\n"); - err = TestReadBackTheOptionalAttributeColorPointRY_130(); - break; - case 131: - ChipLogProgress(chipTool, " ***** Test Step 131 : Read the optional attribute: ColorPointRIntensity\n"); - err = TestReadTheOptionalAttributeColorPointRIntensity_131(); - break; - case 132: - ChipLogProgress(chipTool, " ***** Test Step 132 : Read the optional attribute: ColorPointGX\n"); - err = TestReadTheOptionalAttributeColorPointGX_132(); - break; - case 133: - ChipLogProgress(chipTool, " ***** Test Step 133 : Write the default optional attribute: ColorPointGX\n"); - err = TestWriteTheDefaultOptionalAttributeColorPointGX_133(); - break; - case 134: - ChipLogProgress(chipTool, " ***** Test Step 134 : Read back the optional attribute: ColorPointGX\n"); - err = TestReadBackTheOptionalAttributeColorPointGX_134(); - break; - case 135: - ChipLogProgress(chipTool, " ***** Test Step 135 : Read the optional attribute: ColorPointGY\n"); - err = TestReadTheOptionalAttributeColorPointGY_135(); - break; - case 136: - ChipLogProgress(chipTool, " ***** Test Step 136 : Write the default optional attribute: ColorPointGY\n"); - err = TestWriteTheDefaultOptionalAttributeColorPointGY_136(); - break; - case 137: - ChipLogProgress(chipTool, " ***** Test Step 137 : Read back the optional attribute: ColorPointGY\n"); - err = TestReadBackTheOptionalAttributeColorPointGY_137(); - break; - case 138: - ChipLogProgress(chipTool, " ***** Test Step 138 : Read the optional attribute: ColorPointGIntensity\n"); - err = TestReadTheOptionalAttributeColorPointGIntensity_138(); - break; - case 139: - ChipLogProgress(chipTool, " ***** Test Step 139 : Read the optional attribute: ColorPointBX\n"); - err = TestReadTheOptionalAttributeColorPointBX_139(); - break; - case 140: - ChipLogProgress(chipTool, " ***** Test Step 140 : Write the default optional attribute: ColorPointBX\n"); - err = TestWriteTheDefaultOptionalAttributeColorPointBX_140(); - break; - case 141: - ChipLogProgress(chipTool, " ***** Test Step 141 : Read back the optional attribute: ColorPointBX\n"); - err = TestReadBackTheOptionalAttributeColorPointBX_141(); - break; - case 142: - ChipLogProgress(chipTool, " ***** Test Step 142 : Read the optional attribute: ColorPointBY\n"); - err = TestReadTheOptionalAttributeColorPointBY_142(); - break; - case 143: - ChipLogProgress(chipTool, " ***** Test Step 143 : Write the default optional attribute: ColorPointBY\n"); - err = TestWriteTheDefaultOptionalAttributeColorPointBY_143(); - break; - case 144: - ChipLogProgress(chipTool, " ***** Test Step 144 : Read back the optional attribute: ColorPointBY\n"); - err = TestReadBackTheOptionalAttributeColorPointBY_144(); - break; - case 145: - ChipLogProgress(chipTool, " ***** Test Step 145 : Read the optional attribute: ColorPointBIntensity\n"); - err = TestReadTheOptionalAttributeColorPointBIntensity_145(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 146; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint8_t currentHue) - { - (static_cast(context))->OnSuccessResponse_1(currentHue); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint8_t currentHue) - { - (static_cast(context))->OnSuccessResponse_2(currentHue); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint8_t currentHue) - { - (static_cast(context))->OnSuccessResponse_4(currentHue); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, uint8_t currentSaturation) - { - (static_cast(context))->OnSuccessResponse_5(currentSaturation); - } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, uint8_t currentSaturation) - { - (static_cast(context))->OnSuccessResponse_6(currentSaturation); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context, uint8_t currentSaturation) - { - (static_cast(context))->OnSuccessResponse_8(currentSaturation); - } - - static void OnFailureCallback_9(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context, uint16_t currentX) - { - (static_cast(context))->OnSuccessResponse_9(currentX); - } - - static void OnFailureCallback_10(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_10(status); - } - - static void OnSuccessCallback_10(void * context, uint16_t currentX) - { - (static_cast(context))->OnSuccessResponse_10(currentX); - } - - static void OnFailureCallback_11(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_11(status); - } - - static void OnSuccessCallback_11(void * context) { (static_cast(context))->OnSuccessResponse_11(); } - - static void OnFailureCallback_12(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_12(status); - } - - static void OnSuccessCallback_12(void * context, uint16_t currentX) - { - (static_cast(context))->OnSuccessResponse_12(currentX); - } - - static void OnFailureCallback_13(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_13(status); - } - - static void OnSuccessCallback_13(void * context, uint16_t currentY) - { - (static_cast(context))->OnSuccessResponse_13(currentY); - } - - static void OnFailureCallback_14(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_14(status); - } - - static void OnSuccessCallback_14(void * context, uint16_t currentY) - { - (static_cast(context))->OnSuccessResponse_14(currentY); - } - - static void OnFailureCallback_15(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_15(status); - } - - static void OnSuccessCallback_15(void * context) { (static_cast(context))->OnSuccessResponse_15(); } - - static void OnFailureCallback_16(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_16(status); - } - - static void OnSuccessCallback_16(void * context, uint16_t currentY) - { - (static_cast(context))->OnSuccessResponse_16(currentY); - } - - static void OnFailureCallback_17(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_17(status); - } - - static void OnSuccessCallback_17(void * context, uint16_t colorTemperature) - { - (static_cast(context))->OnSuccessResponse_17(colorTemperature); - } - - static void OnFailureCallback_18(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_18(status); - } - - static void OnSuccessCallback_18(void * context, uint8_t colorMode) - { - (static_cast(context))->OnSuccessResponse_18(colorMode); - } - - static void OnFailureCallback_19(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_19(status); - } - - static void OnSuccessCallback_19(void * context, uint8_t colorControlOptions) - { - (static_cast(context))->OnSuccessResponse_19(colorControlOptions); - } - - static void OnFailureCallback_20(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_20(status); - } - - static void OnSuccessCallback_20(void * context, uint8_t colorControlOptions) - { - (static_cast(context))->OnSuccessResponse_20(colorControlOptions); - } - - static void OnFailureCallback_21(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_21(status); - } - - static void OnSuccessCallback_21(void * context) { (static_cast(context))->OnSuccessResponse_21(); } - - static void OnFailureCallback_22(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_22(status); - } - - static void OnSuccessCallback_22(void * context, uint8_t colorControlOptions) - { - (static_cast(context))->OnSuccessResponse_22(colorControlOptions); - } - - static void OnFailureCallback_23(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_23(status); - } - - static void OnSuccessCallback_23(void * context, uint16_t enhancedCurrentHue) - { - (static_cast(context))->OnSuccessResponse_23(enhancedCurrentHue); - } - - static void OnFailureCallback_24(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_24(status); - } - - static void OnSuccessCallback_24(void * context, uint16_t enhancedCurrentHue) - { - (static_cast(context))->OnSuccessResponse_24(enhancedCurrentHue); - } - - static void OnFailureCallback_25(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_25(status); - } - - static void OnSuccessCallback_25(void * context) { (static_cast(context))->OnSuccessResponse_25(); } - - static void OnFailureCallback_26(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_26(status); - } - - static void OnSuccessCallback_26(void * context, uint16_t enhancedCurrentHue) - { - (static_cast(context))->OnSuccessResponse_26(enhancedCurrentHue); - } - - static void OnFailureCallback_27(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_27(status); - } - - static void OnSuccessCallback_27(void * context, uint8_t enhancedColorMode) - { - (static_cast(context))->OnSuccessResponse_27(enhancedColorMode); - } - - static void OnFailureCallback_28(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_28(status); - } - - static void OnSuccessCallback_28(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_28(colorLoopActive); - } - - static void OnFailureCallback_29(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_29(status); - } - - static void OnSuccessCallback_29(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_29(colorLoopActive); - } - - static void OnFailureCallback_30(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_30(status); - } - - static void OnSuccessCallback_30(void * context) { (static_cast(context))->OnSuccessResponse_30(); } - - static void OnFailureCallback_31(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_31(status); - } - - static void OnSuccessCallback_31(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_31(colorLoopActive); - } - - static void OnFailureCallback_32(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_32(status); - } - - static void OnSuccessCallback_32(void * context, uint8_t colorLoopDirection) - { - (static_cast(context))->OnSuccessResponse_32(colorLoopDirection); - } - - static void OnFailureCallback_33(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_33(status); - } - - static void OnSuccessCallback_33(void * context, uint8_t colorLoopDirection) - { - (static_cast(context))->OnSuccessResponse_33(colorLoopDirection); - } - - static void OnFailureCallback_34(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_34(status); - } - - static void OnSuccessCallback_34(void * context) { (static_cast(context))->OnSuccessResponse_34(); } - - static void OnFailureCallback_35(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_35(status); - } - - static void OnSuccessCallback_35(void * context, uint8_t colorLoopDirection) - { - (static_cast(context))->OnSuccessResponse_35(colorLoopDirection); - } - - static void OnFailureCallback_36(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_36(status); - } - - static void OnSuccessCallback_36(void * context, uint16_t colorLoopTime) - { - (static_cast(context))->OnSuccessResponse_36(colorLoopTime); - } - - static void OnFailureCallback_37(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_37(status); - } - - static void OnSuccessCallback_37(void * context, uint16_t colorLoopTime) - { - (static_cast(context))->OnSuccessResponse_37(colorLoopTime); - } - - static void OnFailureCallback_38(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_38(status); - } - - static void OnSuccessCallback_38(void * context) { (static_cast(context))->OnSuccessResponse_38(); } - - static void OnFailureCallback_39(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_39(status); - } - - static void OnSuccessCallback_39(void * context, uint16_t colorLoopTime) - { - (static_cast(context))->OnSuccessResponse_39(colorLoopTime); - } - - static void OnFailureCallback_40(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_40(status); - } - - static void OnSuccessCallback_40(void * context, uint16_t colorLoopStartEnhancedHue) - { - (static_cast(context))->OnSuccessResponse_40(colorLoopStartEnhancedHue); - } - - static void OnFailureCallback_41(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_41(status); - } - - static void OnSuccessCallback_41(void * context, uint16_t colorLoopStartEnhancedHue) - { - (static_cast(context))->OnSuccessResponse_41(colorLoopStartEnhancedHue); - } - - static void OnFailureCallback_42(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_42(status); - } - - static void OnSuccessCallback_42(void * context) { (static_cast(context))->OnSuccessResponse_42(); } - - static void OnFailureCallback_43(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_43(status); - } - - static void OnSuccessCallback_43(void * context, uint16_t colorLoopStartEnhancedHue) - { - (static_cast(context))->OnSuccessResponse_43(colorLoopStartEnhancedHue); - } - - static void OnFailureCallback_44(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_44(status); - } - - static void OnSuccessCallback_44(void * context, uint16_t colorLoopStoredEnhancedHue) - { - (static_cast(context))->OnSuccessResponse_44(colorLoopStoredEnhancedHue); - } - - static void OnFailureCallback_45(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_45(status); - } - - static void OnSuccessCallback_45(void * context, uint16_t colorLoopStoredEnhancedHue) - { - (static_cast(context))->OnSuccessResponse_45(colorLoopStoredEnhancedHue); - } - - static void OnFailureCallback_46(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_46(status); - } - - static void OnSuccessCallback_46(void * context) { (static_cast(context))->OnSuccessResponse_46(); } - - static void OnFailureCallback_47(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_47(status); - } - - static void OnSuccessCallback_47(void * context, uint16_t colorLoopStoredEnhancedHue) - { - (static_cast(context))->OnSuccessResponse_47(colorLoopStoredEnhancedHue); - } - - static void OnFailureCallback_48(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_48(status); - } - - static void OnSuccessCallback_48(void * context, uint16_t colorCapabilities) - { - (static_cast(context))->OnSuccessResponse_48(colorCapabilities); - } - - static void OnFailureCallback_49(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_49(status); - } - - static void OnSuccessCallback_49(void * context, uint16_t colorCapabilities) - { - (static_cast(context))->OnSuccessResponse_49(colorCapabilities); - } - - static void OnFailureCallback_50(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_50(status); - } - - static void OnSuccessCallback_50(void * context) { (static_cast(context))->OnSuccessResponse_50(); } - - static void OnFailureCallback_51(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_51(status); - } - - static void OnSuccessCallback_51(void * context, uint16_t colorCapabilities) - { - (static_cast(context))->OnSuccessResponse_51(colorCapabilities); - } - - static void OnFailureCallback_52(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_52(status); - } - - static void OnSuccessCallback_52(void * context, uint16_t colorTempPhysicalMin) - { - (static_cast(context))->OnSuccessResponse_52(colorTempPhysicalMin); - } - - static void OnFailureCallback_53(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_53(status); - } - - static void OnSuccessCallback_53(void * context, uint16_t colorTempPhysicalMin) - { - (static_cast(context))->OnSuccessResponse_53(colorTempPhysicalMin); - } - - static void OnFailureCallback_54(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_54(status); - } - - static void OnSuccessCallback_54(void * context) { (static_cast(context))->OnSuccessResponse_54(); } - - static void OnFailureCallback_55(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_55(status); - } - - static void OnSuccessCallback_55(void * context, uint16_t colorTempPhysicalMin) - { - (static_cast(context))->OnSuccessResponse_55(colorTempPhysicalMin); - } - - static void OnFailureCallback_56(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_56(status); - } - - static void OnSuccessCallback_56(void * context, uint16_t colorTempPhysicalMax) - { - (static_cast(context))->OnSuccessResponse_56(colorTempPhysicalMax); - } - - static void OnFailureCallback_57(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_57(status); - } - - static void OnSuccessCallback_57(void * context, uint16_t colorTempPhysicalMax) - { - (static_cast(context))->OnSuccessResponse_57(colorTempPhysicalMax); - } - - static void OnFailureCallback_58(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_58(status); - } - - static void OnSuccessCallback_58(void * context) { (static_cast(context))->OnSuccessResponse_58(); } - - static void OnFailureCallback_59(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_59(status); - } - - static void OnSuccessCallback_59(void * context, uint16_t colorTempPhysicalMax) - { - (static_cast(context))->OnSuccessResponse_59(colorTempPhysicalMax); - } - - static void OnFailureCallback_60(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_60(status); - } - - static void OnSuccessCallback_60(void * context, uint16_t coupleColorTempToLevelMinMireds) - { - (static_cast(context))->OnSuccessResponse_60(coupleColorTempToLevelMinMireds); - } - - static void OnFailureCallback_61(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_61(status); - } - - static void OnSuccessCallback_61(void * context) { (static_cast(context))->OnSuccessResponse_61(); } - - static void OnFailureCallback_62(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_62(status); - } - - static void OnSuccessCallback_62(void * context, uint16_t coupleColorTempToLevelMinMireds) - { - (static_cast(context))->OnSuccessResponse_62(coupleColorTempToLevelMinMireds); - } - - static void OnFailureCallback_63(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_63(status); - } - - static void OnSuccessCallback_63(void * context, uint16_t startUpColorTemperatureMireds) - { - (static_cast(context))->OnSuccessResponse_63(startUpColorTemperatureMireds); - } - - static void OnFailureCallback_64(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_64(status); - } - - static void OnSuccessCallback_64(void * context) { (static_cast(context))->OnSuccessResponse_64(); } - - static void OnFailureCallback_65(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_65(status); - } - - static void OnSuccessCallback_65(void * context, uint16_t startUpColorTemperatureMireds) - { - (static_cast(context))->OnSuccessResponse_65(startUpColorTemperatureMireds); - } - - static void OnFailureCallback_66(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_66(status); - } - - static void OnSuccessCallback_66(void * context, uint16_t remainingTime) - { - (static_cast(context))->OnSuccessResponse_66(remainingTime); - } - - static void OnFailureCallback_67(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_67(status); - } - - static void OnSuccessCallback_67(void * context, uint16_t remainingTime) - { - (static_cast(context))->OnSuccessResponse_67(remainingTime); - } - - static void OnFailureCallback_68(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_68(status); - } - - static void OnSuccessCallback_68(void * context) { (static_cast(context))->OnSuccessResponse_68(); } - - static void OnFailureCallback_69(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_69(status); - } - - static void OnSuccessCallback_69(void * context, uint16_t remainingTime) - { - (static_cast(context))->OnSuccessResponse_69(remainingTime); - } - - static void OnFailureCallback_70(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_70(status); - } - - static void OnSuccessCallback_70(void * context, uint8_t driftCompensation) - { - (static_cast(context))->OnSuccessResponse_70(driftCompensation); - } - - static void OnFailureCallback_71(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_71(status); - } - - static void OnSuccessCallback_71(void * context) { (static_cast(context))->OnSuccessResponse_71(); } - - static void OnFailureCallback_72(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_72(status); - } - - static void OnSuccessCallback_72(void * context, uint8_t driftCompensation) - { - (static_cast(context))->OnSuccessResponse_72(driftCompensation); - } - - static void OnFailureCallback_73(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_73(status); - } - - static void OnSuccessCallback_73(void * context, chip::CharSpan compensationText) - { - (static_cast(context))->OnSuccessResponse_73(compensationText); - } - - static void OnFailureCallback_74(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_74(status); - } - - static void OnSuccessCallback_74(void * context, uint8_t numberOfPrimaries) - { - (static_cast(context))->OnSuccessResponse_74(numberOfPrimaries); - } - - static void OnFailureCallback_75(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_75(status); - } - - static void OnSuccessCallback_75(void * context) { (static_cast(context))->OnSuccessResponse_75(); } - - static void OnFailureCallback_76(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_76(status); - } - - static void OnSuccessCallback_76(void * context, uint8_t numberOfPrimaries) - { - (static_cast(context))->OnSuccessResponse_76(numberOfPrimaries); - } - - static void OnFailureCallback_77(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_77(status); - } - - static void OnSuccessCallback_77(void * context, uint16_t primary1X) - { - (static_cast(context))->OnSuccessResponse_77(primary1X); - } - - static void OnFailureCallback_78(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_78(status); - } - - static void OnSuccessCallback_78(void * context) { (static_cast(context))->OnSuccessResponse_78(); } - - static void OnFailureCallback_79(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_79(status); - } - - static void OnSuccessCallback_79(void * context, uint16_t primary1X) - { - (static_cast(context))->OnSuccessResponse_79(primary1X); - } - - static void OnFailureCallback_80(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_80(status); - } - - static void OnSuccessCallback_80(void * context, uint16_t primary1Y) - { - (static_cast(context))->OnSuccessResponse_80(primary1Y); - } - - static void OnFailureCallback_81(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_81(status); - } - - static void OnSuccessCallback_81(void * context) { (static_cast(context))->OnSuccessResponse_81(); } - - static void OnFailureCallback_82(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_82(status); - } - - static void OnSuccessCallback_82(void * context, uint16_t primary1Y) - { - (static_cast(context))->OnSuccessResponse_82(primary1Y); - } - - static void OnFailureCallback_83(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_83(status); - } - - static void OnSuccessCallback_83(void * context, uint8_t primary1Intensity) - { - (static_cast(context))->OnSuccessResponse_83(primary1Intensity); - } - - static void OnFailureCallback_84(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_84(status); - } - - static void OnSuccessCallback_84(void * context, uint16_t primary2X) - { - (static_cast(context))->OnSuccessResponse_84(primary2X); - } - - static void OnFailureCallback_85(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_85(status); - } - - static void OnSuccessCallback_85(void * context) { (static_cast(context))->OnSuccessResponse_85(); } - - static void OnFailureCallback_86(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_86(status); - } - - static void OnSuccessCallback_86(void * context, uint16_t primary2X) - { - (static_cast(context))->OnSuccessResponse_86(primary2X); - } - - static void OnFailureCallback_87(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_87(status); - } - - static void OnSuccessCallback_87(void * context, uint16_t primary2Y) - { - (static_cast(context))->OnSuccessResponse_87(primary2Y); - } - - static void OnFailureCallback_88(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_88(status); - } - - static void OnSuccessCallback_88(void * context) { (static_cast(context))->OnSuccessResponse_88(); } - - static void OnFailureCallback_89(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_89(status); - } - - static void OnSuccessCallback_89(void * context, uint16_t primary2Y) - { - (static_cast(context))->OnSuccessResponse_89(primary2Y); - } - - static void OnFailureCallback_90(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_90(status); - } - - static void OnSuccessCallback_90(void * context, uint8_t primary2Intensity) - { - (static_cast(context))->OnSuccessResponse_90(primary2Intensity); - } - - static void OnFailureCallback_91(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_91(status); - } - - static void OnSuccessCallback_91(void * context, uint16_t primary3X) - { - (static_cast(context))->OnSuccessResponse_91(primary3X); - } - - static void OnFailureCallback_92(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_92(status); - } - - static void OnSuccessCallback_92(void * context) { (static_cast(context))->OnSuccessResponse_92(); } - - static void OnFailureCallback_93(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_93(status); - } - - static void OnSuccessCallback_93(void * context, uint16_t primary3X) - { - (static_cast(context))->OnSuccessResponse_93(primary3X); - } - - static void OnFailureCallback_94(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_94(status); - } - - static void OnSuccessCallback_94(void * context, uint16_t primary3Y) - { - (static_cast(context))->OnSuccessResponse_94(primary3Y); - } - - static void OnFailureCallback_95(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_95(status); - } - - static void OnSuccessCallback_95(void * context) { (static_cast(context))->OnSuccessResponse_95(); } - - static void OnFailureCallback_96(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_96(status); - } - - static void OnSuccessCallback_96(void * context, uint16_t primary3Y) - { - (static_cast(context))->OnSuccessResponse_96(primary3Y); - } - - static void OnFailureCallback_97(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_97(status); - } - - static void OnSuccessCallback_97(void * context, uint8_t primary3Intensity) - { - (static_cast(context))->OnSuccessResponse_97(primary3Intensity); - } - - static void OnFailureCallback_98(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_98(status); - } - - static void OnSuccessCallback_98(void * context, uint16_t primary4X) - { - (static_cast(context))->OnSuccessResponse_98(primary4X); - } - - static void OnFailureCallback_99(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_99(status); - } - - static void OnSuccessCallback_99(void * context) { (static_cast(context))->OnSuccessResponse_99(); } - - static void OnFailureCallback_100(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_100(status); - } - - static void OnSuccessCallback_100(void * context, uint16_t primary4X) - { - (static_cast(context))->OnSuccessResponse_100(primary4X); - } - - static void OnFailureCallback_101(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_101(status); - } - - static void OnSuccessCallback_101(void * context, uint16_t primary4Y) - { - (static_cast(context))->OnSuccessResponse_101(primary4Y); - } - - static void OnFailureCallback_102(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_102(status); - } - - static void OnSuccessCallback_102(void * context) { (static_cast(context))->OnSuccessResponse_102(); } - - static void OnFailureCallback_103(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_103(status); - } - - static void OnSuccessCallback_103(void * context, uint16_t primary4Y) - { - (static_cast(context))->OnSuccessResponse_103(primary4Y); - } - - static void OnFailureCallback_104(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_104(status); - } - - static void OnSuccessCallback_104(void * context, uint8_t primary4Intensity) - { - (static_cast(context))->OnSuccessResponse_104(primary4Intensity); - } - - static void OnFailureCallback_105(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_105(status); - } - - static void OnSuccessCallback_105(void * context, uint16_t primary5X) - { - (static_cast(context))->OnSuccessResponse_105(primary5X); - } - - static void OnFailureCallback_106(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_106(status); - } - - static void OnSuccessCallback_106(void * context) { (static_cast(context))->OnSuccessResponse_106(); } - - static void OnFailureCallback_107(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_107(status); - } - - static void OnSuccessCallback_107(void * context, uint16_t primary5X) - { - (static_cast(context))->OnSuccessResponse_107(primary5X); - } - - static void OnFailureCallback_108(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_108(status); - } - - static void OnSuccessCallback_108(void * context, uint16_t primary5Y) - { - (static_cast(context))->OnSuccessResponse_108(primary5Y); - } - - static void OnFailureCallback_109(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_109(status); - } - - static void OnSuccessCallback_109(void * context) { (static_cast(context))->OnSuccessResponse_109(); } - - static void OnFailureCallback_110(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_110(status); - } - - static void OnSuccessCallback_110(void * context, uint16_t primary5Y) - { - (static_cast(context))->OnSuccessResponse_110(primary5Y); - } - - static void OnFailureCallback_111(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_111(status); - } - - static void OnSuccessCallback_111(void * context, uint8_t primary5Intensity) - { - (static_cast(context))->OnSuccessResponse_111(primary5Intensity); - } - - static void OnFailureCallback_112(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_112(status); - } - - static void OnSuccessCallback_112(void * context, uint16_t primary6X) - { - (static_cast(context))->OnSuccessResponse_112(primary6X); - } - - static void OnFailureCallback_113(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_113(status); - } - - static void OnSuccessCallback_113(void * context) { (static_cast(context))->OnSuccessResponse_113(); } - - static void OnFailureCallback_114(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_114(status); - } - - static void OnSuccessCallback_114(void * context, uint16_t primary6X) - { - (static_cast(context))->OnSuccessResponse_114(primary6X); - } - - static void OnFailureCallback_115(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_115(status); - } - - static void OnSuccessCallback_115(void * context, uint16_t primary6Y) - { - (static_cast(context))->OnSuccessResponse_115(primary6Y); - } - - static void OnFailureCallback_116(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_116(status); - } - - static void OnSuccessCallback_116(void * context) { (static_cast(context))->OnSuccessResponse_116(); } - - static void OnFailureCallback_117(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_117(status); - } - - static void OnSuccessCallback_117(void * context, uint16_t primary6Y) - { - (static_cast(context))->OnSuccessResponse_117(primary6Y); - } - - static void OnFailureCallback_118(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_118(status); - } - - static void OnSuccessCallback_118(void * context, uint8_t primary6Intensity) - { - (static_cast(context))->OnSuccessResponse_118(primary6Intensity); - } - - static void OnFailureCallback_119(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_119(status); - } - - static void OnSuccessCallback_119(void * context, uint16_t whitePointX) - { - (static_cast(context))->OnSuccessResponse_119(whitePointX); - } - - static void OnFailureCallback_120(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_120(status); - } - - static void OnSuccessCallback_120(void * context) { (static_cast(context))->OnSuccessResponse_120(); } - - static void OnFailureCallback_121(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_121(status); - } - - static void OnSuccessCallback_121(void * context, uint16_t whitePointX) - { - (static_cast(context))->OnSuccessResponse_121(whitePointX); - } - - static void OnFailureCallback_122(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_122(status); - } - - static void OnSuccessCallback_122(void * context, uint16_t whitePointY) - { - (static_cast(context))->OnSuccessResponse_122(whitePointY); - } - - static void OnFailureCallback_123(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_123(status); - } - - static void OnSuccessCallback_123(void * context) { (static_cast(context))->OnSuccessResponse_123(); } - - static void OnFailureCallback_124(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_124(status); - } - - static void OnSuccessCallback_124(void * context, uint16_t whitePointY) - { - (static_cast(context))->OnSuccessResponse_124(whitePointY); - } - - static void OnFailureCallback_125(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_125(status); - } - - static void OnSuccessCallback_125(void * context, uint16_t colorPointRX) - { - (static_cast(context))->OnSuccessResponse_125(colorPointRX); - } - - static void OnFailureCallback_126(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_126(status); - } - - static void OnSuccessCallback_126(void * context) { (static_cast(context))->OnSuccessResponse_126(); } - - static void OnFailureCallback_127(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_127(status); - } - - static void OnSuccessCallback_127(void * context, uint16_t colorPointRX) - { - (static_cast(context))->OnSuccessResponse_127(colorPointRX); - } - - static void OnFailureCallback_128(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_128(status); - } - - static void OnSuccessCallback_128(void * context, uint16_t colorPointRY) - { - (static_cast(context))->OnSuccessResponse_128(colorPointRY); - } - - static void OnFailureCallback_129(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_129(status); - } - - static void OnSuccessCallback_129(void * context) { (static_cast(context))->OnSuccessResponse_129(); } - - static void OnFailureCallback_130(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_130(status); - } - - static void OnSuccessCallback_130(void * context, uint16_t colorPointRY) - { - (static_cast(context))->OnSuccessResponse_130(colorPointRY); - } - - static void OnFailureCallback_131(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_131(status); - } - - static void OnSuccessCallback_131(void * context, uint8_t colorPointRIntensity) - { - (static_cast(context))->OnSuccessResponse_131(colorPointRIntensity); - } - - static void OnFailureCallback_132(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_132(status); - } - - static void OnSuccessCallback_132(void * context, uint16_t colorPointGX) - { - (static_cast(context))->OnSuccessResponse_132(colorPointGX); - } - - static void OnFailureCallback_133(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_133(status); - } - - static void OnSuccessCallback_133(void * context) { (static_cast(context))->OnSuccessResponse_133(); } - - static void OnFailureCallback_134(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_134(status); - } - - static void OnSuccessCallback_134(void * context, uint16_t colorPointGX) - { - (static_cast(context))->OnSuccessResponse_134(colorPointGX); - } - - static void OnFailureCallback_135(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_135(status); - } - - static void OnSuccessCallback_135(void * context, uint16_t colorPointGY) - { - (static_cast(context))->OnSuccessResponse_135(colorPointGY); - } - - static void OnFailureCallback_136(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_136(status); - } - - static void OnSuccessCallback_136(void * context) { (static_cast(context))->OnSuccessResponse_136(); } - - static void OnFailureCallback_137(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_137(status); - } - - static void OnSuccessCallback_137(void * context, uint16_t colorPointGY) - { - (static_cast(context))->OnSuccessResponse_137(colorPointGY); - } - - static void OnFailureCallback_138(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_138(status); - } - - static void OnSuccessCallback_138(void * context, uint8_t colorPointGIntensity) - { - (static_cast(context))->OnSuccessResponse_138(colorPointGIntensity); - } - - static void OnFailureCallback_139(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_139(status); - } - - static void OnSuccessCallback_139(void * context, uint16_t colorPointBX) - { - (static_cast(context))->OnSuccessResponse_139(colorPointBX); - } - - static void OnFailureCallback_140(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_140(status); - } - - static void OnSuccessCallback_140(void * context) { (static_cast(context))->OnSuccessResponse_140(); } - - static void OnFailureCallback_141(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_141(status); - } - - static void OnSuccessCallback_141(void * context, uint16_t colorPointBX) - { - (static_cast(context))->OnSuccessResponse_141(colorPointBX); - } - - static void OnFailureCallback_142(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_142(status); - } - - static void OnSuccessCallback_142(void * context, uint16_t colorPointBY) - { - (static_cast(context))->OnSuccessResponse_142(colorPointBY); - } - - static void OnFailureCallback_143(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_143(status); - } - - static void OnSuccessCallback_143(void * context) { (static_cast(context))->OnSuccessResponse_143(); } - - static void OnFailureCallback_144(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_144(status); - } - - static void OnSuccessCallback_144(void * context, uint16_t colorPointBY) - { - (static_cast(context))->OnSuccessResponse_144(colorPointBY); - } - - static void OnFailureCallback_145(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_145(status); - } - - static void OnSuccessCallback_145(void * context, uint8_t colorPointBIntensity) - { - (static_cast(context))->OnSuccessResponse_145(colorPointBIntensity); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadsMandatoryAttributeCurrentHue_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint8_t currentHue) - { - VerifyOrReturn(CheckValue("currentHue", currentHue, 0)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeCurrentHue_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint8_t currentHue) - { - VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); - VerifyOrReturn(CheckConstraintMaxValue("currentHue", currentHue, 254)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValueToMandatoryAttributeCurrentHue_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t currentHueArgument; - currentHueArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - currentHueArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_3() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackMandatoryAttributeCurrentHue_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint8_t currentHue) - { - VerifyOrReturn(CheckValue("currentHue", currentHue, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadsMandatoryAttributeCurrentSaturation_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(uint8_t currentSaturation) - { - VerifyOrReturn(CheckValue("currentSaturation", currentSaturation, 0)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeCurrentSaturation_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(uint8_t currentSaturation) - { - VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); - VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", currentSaturation, 254)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValueToMandatoryAttributeCurrentSaturation_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t currentSaturationArgument; - currentSaturationArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - currentSaturationArgument, this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_7() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackMandatoryAttributeCurrentSaturation_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8(uint8_t currentSaturation) - { - VerifyOrReturn(CheckValue("currentSaturation", currentSaturation, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeCurrentX_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9(uint16_t currentX) - { - VerifyOrReturn(CheckValue("currentX", currentX, 24939U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeCurrentX_10() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_10, OnFailureCallback_10)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10(uint16_t currentX) - { - VerifyOrReturn(CheckConstraintType("currentX", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("currentX", currentX, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValueToMandatoryAttributeCurrentX_11() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t currentXArgument; - currentXArgument = 24939U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - currentXArgument, this, OnSuccessCallback_11, OnFailureCallback_11)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_11() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackMandatoryAttributeCurrentX_12() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_12, OnFailureCallback_12)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_12(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_12(uint16_t currentX) - { - VerifyOrReturn(CheckValue("currentX", currentX, 24939U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeCurrentY_13() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_13, OnFailureCallback_13)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_13(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_13(uint16_t currentY) - { - VerifyOrReturn(CheckValue("currentY", currentY, 24701U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeCurrentY_14() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_14, OnFailureCallback_14)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_14(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_14(uint16_t currentY) - { - VerifyOrReturn(CheckConstraintType("currentY", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("currentY", currentY, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeCurrentY_15() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t currentYArgument; - currentYArgument = 24701U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - currentYArgument, this, OnSuccessCallback_15, OnFailureCallback_15)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_15(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_15() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackMandatoryAttributeCurrentY_16() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_16, OnFailureCallback_16)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_16(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_16(uint16_t currentY) - { - VerifyOrReturn(CheckValue("currentY", currentY, 24701U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeColorTemperatureMireds_17() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_17, OnFailureCallback_17)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_17(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_17(uint16_t colorTemperature) - { - VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", colorTemperature, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeColorMode_18() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_18, OnFailureCallback_18)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_18(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_18(uint8_t colorMode) - { - VerifyOrReturn(CheckConstraintType("colorMode", "", "enum8")); - VerifyOrReturn(CheckConstraintMaxValue("colorMode", colorMode, 2)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeOptions_19() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_19, OnFailureCallback_19)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_19(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_19(uint8_t colorControlOptions) - { - VerifyOrReturn(CheckValue("colorControlOptions", colorControlOptions, 0)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeOptions_20() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_20, OnFailureCallback_20)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_20(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_20(uint8_t colorControlOptions) - { - VerifyOrReturn(CheckConstraintType("colorControlOptions", "", "map8")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeOptions_21() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t colorControlOptionsArgument; - colorControlOptionsArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - colorControlOptionsArgument, this, OnSuccessCallback_21, OnFailureCallback_21)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_21(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_21() { NextTest(); } - - CHIP_ERROR TestReadsBackMandatoryAttributeOptions_22() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_22, OnFailureCallback_22)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_22(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_22(uint8_t colorControlOptions) - { - VerifyOrReturn(CheckValue("colorControlOptions", colorControlOptions, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeEnhancedCurrentHue_23() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_23, OnFailureCallback_23)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_23(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_23(uint16_t enhancedCurrentHue) - { - VerifyOrReturn(CheckValue("enhancedCurrentHue", enhancedCurrentHue, 0U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeEnhancedCurrentHue_24() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_24, OnFailureCallback_24)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_24(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_24(uint16_t enhancedCurrentHue) - { - VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeEnhancedCurrentHue_25() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t enhancedCurrentHueArgument; - enhancedCurrentHueArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - enhancedCurrentHueArgument, this, OnSuccessCallback_25, OnFailureCallback_25)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_25(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_25() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackMandatoryAttributeEnhancedCurrentHue_26() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_26, OnFailureCallback_26)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_26(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_26(uint16_t enhancedCurrentHue) - { - VerifyOrReturn(CheckValue("enhancedCurrentHue", enhancedCurrentHue, 0U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeEnhancedColorMode_27() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_27, OnFailureCallback_27)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_27(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_27(uint8_t enhancedColorMode) - { - VerifyOrReturn(CheckConstraintType("enhancedColorMode", "", "enum8")); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeColorLoopActive_28() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_28, OnFailureCallback_28)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_28(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_28(uint8_t colorLoopActive) - { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopActive_29() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_29, OnFailureCallback_29)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_29(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_29(uint8_t colorLoopActive) - { - VerifyOrReturn(CheckConstraintType("colorLoopActive", "", "uint8")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopActive_30() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t colorLoopActiveArgument; - colorLoopActiveArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - colorLoopActiveArgument, this, OnSuccessCallback_30, OnFailureCallback_30)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_30(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_30() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopActive_31() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_31, OnFailureCallback_31)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_31(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_31(uint8_t colorLoopActive) - { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeColorLoopDirection_32() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_32, OnFailureCallback_32)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_32(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_32(uint8_t colorLoopDirection) - { - VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 0)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopDirection_33() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_33, OnFailureCallback_33)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_33(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_33(uint8_t colorLoopDirection) - { - VerifyOrReturn(CheckConstraintType("colorLoopDirection", "", "uint8")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopDirection_34() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t colorLoopDirectionArgument; - colorLoopDirectionArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - colorLoopDirectionArgument, this, OnSuccessCallback_34, OnFailureCallback_34)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_34(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_34() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopDirection_35() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_35, OnFailureCallback_35)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_35(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_35(uint8_t colorLoopDirection) - { - VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeColorLoopTime_36() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_36, OnFailureCallback_36)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_36(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_36(uint16_t colorLoopTime) - { - VerifyOrReturn(CheckValue("colorLoopTime", colorLoopTime, 25U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopTime_37() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_37, OnFailureCallback_37)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_37(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_37(uint16_t colorLoopTime) - { - VerifyOrReturn(CheckConstraintType("colorLoopTime", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopTime_38() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t colorLoopTimeArgument; - colorLoopTimeArgument = 25U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - colorLoopTimeArgument, this, OnSuccessCallback_38, OnFailureCallback_38)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_38(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_38() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopTime_39() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_39, OnFailureCallback_39)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_39(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_39(uint16_t colorLoopTime) - { - VerifyOrReturn(CheckValue("colorLoopTime", colorLoopTime, 25U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeColorLoopStartEnhancedHue_40() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_40, OnFailureCallback_40)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_40(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_40(uint16_t colorLoopStartEnhancedHue) - { - VerifyOrReturn(CheckValue("colorLoopStartEnhancedHue", colorLoopStartEnhancedHue, 8960U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopStartEnhancedHue_41() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_41, OnFailureCallback_41)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_41(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_41(uint16_t colorLoopStartEnhancedHue) - { - VerifyOrReturn(CheckConstraintType("colorLoopStartEnhancedHue", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopStartEnhancedHue_42() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t colorLoopStartEnhancedHueArgument; - colorLoopStartEnhancedHueArgument = 8960U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - colorLoopStartEnhancedHueArgument, this, OnSuccessCallback_42, OnFailureCallback_42)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_42(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_42() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopStartEnhancedHue_43() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_43, OnFailureCallback_43)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_43(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_43(uint16_t colorLoopStartEnhancedHue) - { - VerifyOrReturn(CheckValue("colorLoopStartEnhancedHue", colorLoopStartEnhancedHue, 8960U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeColorLoopStoredEnhancedHue_44() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_44, OnFailureCallback_44)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_44(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_44(uint16_t colorLoopStoredEnhancedHue) - { - VerifyOrReturn(CheckValue("colorLoopStoredEnhancedHue", colorLoopStoredEnhancedHue, 0U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopStoredEnhancedHue_45() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_45, OnFailureCallback_45)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_45(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_45(uint16_t colorLoopStoredEnhancedHue) - { - VerifyOrReturn(CheckConstraintType("colorLoopStoredEnhancedHue", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopStoredEnhancedHue_46() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t colorLoopStoredEnhancedHueArgument; - colorLoopStoredEnhancedHueArgument = 0U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - colorLoopStoredEnhancedHueArgument, this, OnSuccessCallback_46, OnFailureCallback_46)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_46(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_46() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopStoredEnhancedHue_47() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_47, OnFailureCallback_47)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_47(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_47(uint16_t colorLoopStoredEnhancedHue) - { - VerifyOrReturn(CheckValue("colorLoopStoredEnhancedHue", colorLoopStoredEnhancedHue, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeColorCapabilities_48() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_48, OnFailureCallback_48)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_48(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_48(uint16_t colorCapabilities) - { - VerifyOrReturn(CheckValue("colorCapabilities", colorCapabilities, 0U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeColorCapabilities_49() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_49, OnFailureCallback_49)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_49(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_49(uint16_t colorCapabilities) - { - VerifyOrReturn(CheckConstraintType("colorCapabilities", "", "map16")); - VerifyOrReturn(CheckConstraintMaxValue("colorCapabilities", colorCapabilities, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorCapabilities_50() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t colorCapabilitiesArgument; - colorCapabilitiesArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - colorCapabilitiesArgument, this, OnSuccessCallback_50, OnFailureCallback_50)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_50(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_50() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackMandatoryAttributeColorCapabilities_51() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_51, OnFailureCallback_51)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_51(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_51(uint16_t colorCapabilities) - { - VerifyOrReturn(CheckValue("colorCapabilities", colorCapabilities, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeColorTempPhysicalMinMireds_52() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_52, OnFailureCallback_52)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_52(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_52(uint16_t colorTempPhysicalMin) - { - VerifyOrReturn(CheckValue("colorTempPhysicalMin", colorTempPhysicalMin, 0U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeColorTempPhysicalMinMireds_53() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_53, OnFailureCallback_53)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_53(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_53(uint16_t colorTempPhysicalMin) - { - VerifyOrReturn(CheckConstraintType("colorTempPhysicalMin", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("colorTempPhysicalMin", colorTempPhysicalMin, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorTempPhysicalMinMireds_54() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t colorTempPhysicalMinArgument; - colorTempPhysicalMinArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - colorTempPhysicalMinArgument, this, OnSuccessCallback_54, OnFailureCallback_54)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_54(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_54() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackMandatoryAttributeColorTempPhysicalMinMireds_55() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_55, OnFailureCallback_55)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_55(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_55(uint16_t colorTempPhysicalMin) - { - VerifyOrReturn(CheckValue("colorTempPhysicalMin", colorTempPhysicalMin, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeColorTempPhysicalMaxMireds_56() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_56, OnFailureCallback_56)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_56(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_56(uint16_t colorTempPhysicalMax) - { - VerifyOrReturn(CheckValue("colorTempPhysicalMax", colorTempPhysicalMax, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeColorTempPhysicalMaxMireds_57() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_57, OnFailureCallback_57)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_57(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_57(uint16_t colorTempPhysicalMax) - { - VerifyOrReturn(CheckConstraintType("colorTempPhysicalMax", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("colorTempPhysicalMax", colorTempPhysicalMax, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorTempPhysicalMaxMireds_58() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t colorTempPhysicalMaxArgument; - colorTempPhysicalMaxArgument = 65279U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - colorTempPhysicalMaxArgument, this, OnSuccessCallback_58, OnFailureCallback_58)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_58(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_58() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackMandatoryAttributeColorTempPhysicalMaxMireds_59() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_59, OnFailureCallback_59)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_59(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_59(uint16_t colorTempPhysicalMax) - { - VerifyOrReturn(CheckValue("colorTempPhysicalMax", colorTempPhysicalMax, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheOptionalAttributeCoupleColorTempToLevelMinMireds_60() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_60, OnFailureCallback_60)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_60(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_60(uint16_t coupleColorTempToLevelMinMireds) - { - VerifyOrReturn(CheckConstraintType("coupleColorTempToLevelMinMireds", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToOptionalAttributeCoupleColorTempToLevelMinMireds_61() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t coupleColorTempToLevelMinMiredsArgument; - coupleColorTempToLevelMinMiredsArgument = 0U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - coupleColorTempToLevelMinMiredsArgument, this, OnSuccessCallback_61, OnFailureCallback_61)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_61(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_61() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackOptionalAttributeCoupleColorTempToLevelMinMireds_62() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_62, OnFailureCallback_62)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_62(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_62(uint16_t coupleColorTempToLevelMinMireds) - { - VerifyOrReturn(CheckValue("coupleColorTempToLevelMinMireds", coupleColorTempToLevelMinMireds, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheOptionalAttributeStartUpColorTemperatureMireds_63() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_63, OnFailureCallback_63)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_63(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_63(uint16_t startUpColorTemperatureMireds) - { - VerifyOrReturn(CheckConstraintType("startUpColorTemperatureMireds", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("startUpColorTemperatureMireds", startUpColorTemperatureMireds, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToOptionalAttributeStartUpColorTemperatureMireds_64() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t startUpColorTemperatureMiredsArgument; - startUpColorTemperatureMiredsArgument = 0U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - startUpColorTemperatureMiredsArgument, this, OnSuccessCallback_64, OnFailureCallback_64)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_64(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_64() { NextTest(); } - - CHIP_ERROR TestReadsBackOptionalAttributeStartUpColorTemperatureMireds_65() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_65, OnFailureCallback_65)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_65(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_65(uint16_t startUpColorTemperatureMireds) - { - VerifyOrReturn(CheckValue("startUpColorTemperatureMireds", startUpColorTemperatureMireds, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheOptionalAttributeRemainingTime_66() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_66, OnFailureCallback_66)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_66(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_66(uint16_t remainingTime) - { - VerifyOrReturn(CheckValue("remainingTime", remainingTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributeRemainingTime_67() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_67, OnFailureCallback_67)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_67(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_67(uint16_t remainingTime) - { - VerifyOrReturn(CheckConstraintType("remainingTime", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("remainingTime", remainingTime, 254U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToOptionalAttributeRemainingTime_68() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t remainingTimeArgument; - remainingTimeArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - remainingTimeArgument, this, OnSuccessCallback_68, OnFailureCallback_68)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_68(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_68() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackOptionalAttributeRemainingTime_69() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_69, OnFailureCallback_69)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_69(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_69(uint16_t remainingTime) - { - VerifyOrReturn(CheckValue("remainingTime", remainingTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheOptionalAttributeDriftCompensation_70() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_70, OnFailureCallback_70)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_70(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_70(uint8_t driftCompensation) - { - VerifyOrReturn(CheckConstraintType("driftCompensation", "", "enum8")); - VerifyOrReturn(CheckConstraintMaxValue("driftCompensation", driftCompensation, 4)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToOptionalAttributeDriftCompensation_71() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t driftCompensationArgument; - driftCompensationArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - driftCompensationArgument, this, OnSuccessCallback_71, OnFailureCallback_71)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_71(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_71() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackOptionalAttributeDriftCompensation_72() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_72, OnFailureCallback_72)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_72(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_72(uint8_t driftCompensation) - { - VerifyOrReturn(CheckValue("driftCompensation", driftCompensation, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadTheOptionalAttributeCompensationText_73() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_73, OnFailureCallback_73)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_73(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_73(chip::CharSpan compensationText) - { - VerifyOrReturn(CheckConstraintType("compensationText", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("compensationText", compensationText.size(), 254)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeNumberOfPrimaries_74() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_74, OnFailureCallback_74)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_74(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_74(uint8_t numberOfPrimaries) - { - VerifyOrReturn(CheckConstraintType("numberOfPrimaries", "", "uint8")); - VerifyOrReturn(CheckConstraintMaxValue("numberOfPrimaries", numberOfPrimaries, 6)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultMandatoryAttributeNumberOfPrimaries_75() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t numberOfPrimariesArgument; - numberOfPrimariesArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - numberOfPrimariesArgument, this, OnSuccessCallback_75, OnFailureCallback_75)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_75(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_75() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadBackTheMandatoryAttributeNumberOfPrimaries_76() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_76, OnFailureCallback_76)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_76(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_76(uint8_t numberOfPrimaries) - { - VerifyOrReturn(CheckValue("numberOfPrimaries", numberOfPrimaries, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributePrimary1X_77() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_77, OnFailureCallback_77)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_77(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_77(uint16_t primary1X) - { - VerifyOrReturn(CheckConstraintType("primary1X", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary1X", primary1X, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary1X_78() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t primary1XArgument; - primary1XArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - primary1XArgument, this, OnSuccessCallback_78, OnFailureCallback_78)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_78(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_78() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary1X_79() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_79, OnFailureCallback_79)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_79(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_79(uint16_t primary1X) - { - VerifyOrReturn(CheckValue("primary1X", primary1X, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributePrimary1Y_80() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_80, OnFailureCallback_80)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_80(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_80(uint16_t primary1Y) - { - VerifyOrReturn(CheckConstraintType("primary1Y", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary1Y", primary1Y, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary1Y_81() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t primary1YArgument; - primary1YArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - primary1YArgument, this, OnSuccessCallback_81, OnFailureCallback_81)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_81(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_81() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary1Y_82() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_82, OnFailureCallback_82)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_82(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_82(uint16_t primary1Y) - { - VerifyOrReturn(CheckValue("primary1Y", primary1Y, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributePrimary1Intensity_83() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_83, OnFailureCallback_83)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_83(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_83(uint8_t primary1Intensity) - { - VerifyOrReturn(CheckConstraintType("primary1Intensity", "", "uint8")); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributePrimary2X_84() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_84, OnFailureCallback_84)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_84(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_84(uint16_t primary2X) - { - VerifyOrReturn(CheckConstraintType("primary2X", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary2X", primary2X, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary2X_85() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t primary2XArgument; - primary2XArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - primary2XArgument, this, OnSuccessCallback_85, OnFailureCallback_85)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_85(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_85() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary2X_86() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_86, OnFailureCallback_86)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_86(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_86(uint16_t primary2X) - { - VerifyOrReturn(CheckValue("primary2X", primary2X, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributePrimary2Y_87() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_87, OnFailureCallback_87)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_87(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_87(uint16_t primary2Y) - { - VerifyOrReturn(CheckConstraintType("primary2Y", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary2Y", primary2Y, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary2Y_88() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t primary2YArgument; - primary2YArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - primary2YArgument, this, OnSuccessCallback_88, OnFailureCallback_88)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_88(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_88() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary2Y_89() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_89, OnFailureCallback_89)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_89(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_89(uint16_t primary2Y) - { - VerifyOrReturn(CheckValue("primary2Y", primary2Y, 0U)); - - NextTest(); - } - - CHIP_ERROR TestValidateConstraintsOfAttributePrimary2Intensity_90() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_90, OnFailureCallback_90)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_90(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_90(uint8_t primary2Intensity) - { - VerifyOrReturn(CheckConstraintType("primary2Intensity", "", "uint8")); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributePrimary3X_91() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_91, OnFailureCallback_91)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_91(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_91(uint16_t primary3X) - { - VerifyOrReturn(CheckConstraintType("primary3X", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary3X", primary3X, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary3X_92() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t primary3XArgument; - primary3XArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - primary3XArgument, this, OnSuccessCallback_92, OnFailureCallback_92)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_92(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_92() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary3X_93() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_93, OnFailureCallback_93)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_93(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_93(uint16_t primary3X) - { - VerifyOrReturn(CheckValue("primary3X", primary3X, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributePrimary3Y_94() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_94, OnFailureCallback_94)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_94(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_94(uint16_t primary3Y) - { - VerifyOrReturn(CheckConstraintType("primary3Y", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary3Y", primary3Y, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary3Y_95() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t primary3YArgument; - primary3YArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - primary3YArgument, this, OnSuccessCallback_95, OnFailureCallback_95)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_95(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_95() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary3Y_96() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_96, OnFailureCallback_96)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_96(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_96(uint16_t primary3Y) - { - VerifyOrReturn(CheckValue("primary3Y", primary3Y, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributePrimary3Intensity_97() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_97, OnFailureCallback_97)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_97(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_97(uint8_t primary3Intensity) - { - VerifyOrReturn(CheckConstraintType("primary3Intensity", "", "uint8")); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributePrimary4X_98() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_98, OnFailureCallback_98)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_98(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_98(uint16_t primary4X) - { - VerifyOrReturn(CheckConstraintType("primary4X", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary4X", primary4X, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary4X_99() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t primary4XArgument; - primary4XArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - primary4XArgument, this, OnSuccessCallback_99, OnFailureCallback_99)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_99(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_99() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary4X_100() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_100, OnFailureCallback_100)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_100(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_100(uint16_t primary4X) - { - VerifyOrReturn(CheckValue("primary4X", primary4X, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributePrimary4Y_101() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_101, OnFailureCallback_101)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_101(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_101(uint16_t primary4Y) - { - VerifyOrReturn(CheckConstraintType("primary4Y", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary4Y", primary4Y, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary4Y_102() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t primary4YArgument; - primary4YArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - primary4YArgument, this, OnSuccessCallback_102, OnFailureCallback_102)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_102(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_102() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary4Y_103() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_103, OnFailureCallback_103)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_103(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_103(uint16_t primary4Y) - { - VerifyOrReturn(CheckValue("primary4Y", primary4Y, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributePrimary4Intensity_104() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_104, OnFailureCallback_104)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_104(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_104(uint8_t primary4Intensity) - { - VerifyOrReturn(CheckConstraintType("primary4Intensity", "", "uint8")); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributePrimary5X_105() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_105, OnFailureCallback_105)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_105(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_105(uint16_t primary5X) - { - VerifyOrReturn(CheckConstraintType("primary5X", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary5X", primary5X, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary5X_106() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t primary5XArgument; - primary5XArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - primary5XArgument, this, OnSuccessCallback_106, OnFailureCallback_106)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_106(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_106() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary5X_107() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_107, OnFailureCallback_107)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_107(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_107(uint16_t primary5X) - { - VerifyOrReturn(CheckValue("primary5X", primary5X, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributePrimary5Y_108() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_108, OnFailureCallback_108)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_108(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_108(uint16_t primary5Y) - { - VerifyOrReturn(CheckConstraintType("primary5Y", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary5Y", primary5Y, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary5Y_109() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t primary5YArgument; - primary5YArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - primary5YArgument, this, OnSuccessCallback_109, OnFailureCallback_109)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_109(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_109() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary5Y_110() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_110, OnFailureCallback_110)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_110(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_110(uint16_t primary5Y) - { - VerifyOrReturn(CheckValue("primary5Y", primary5Y, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributePrimary5Intensity_111() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_111, OnFailureCallback_111)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_111(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_111(uint8_t primary5Intensity) - { - VerifyOrReturn(CheckConstraintType("primary5Intensity", "", "uint8")); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributePrimary6X_112() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_112, OnFailureCallback_112)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_112(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_112(uint16_t primary6X) - { - VerifyOrReturn(CheckConstraintType("primary6X", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary6X", primary6X, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary6X_113() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t primary6XArgument; - primary6XArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - primary6XArgument, this, OnSuccessCallback_113, OnFailureCallback_113)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_113(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_113() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary6X_114() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_114, OnFailureCallback_114)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_114(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_114(uint16_t primary6X) - { - VerifyOrReturn(CheckValue("primary6X", primary6X, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributePrimary6Y_115() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_115, OnFailureCallback_115)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_115(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_115(uint16_t primary6Y) - { - VerifyOrReturn(CheckConstraintType("primary6Y", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary6Y", primary6Y, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary6Y_116() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t primary6YArgument; - primary6YArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - primary6YArgument, this, OnSuccessCallback_116, OnFailureCallback_116)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_116(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_116() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadBackTheMandatoryAttributePrimary6Y_117() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_117, OnFailureCallback_117)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_117(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_117(uint16_t primary6Y) - { - VerifyOrReturn(CheckValue("primary6Y", primary6Y, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributePrimary6Intensity_118() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_118, OnFailureCallback_118)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_118(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_118(uint8_t primary6Intensity) - { - VerifyOrReturn(CheckConstraintType("primary6Intensity", "", "uint8")); - - NextTest(); - } - - CHIP_ERROR TestReadTheOptionalAttributeWhitePointX_119() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_119, OnFailureCallback_119)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_119(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_119(uint16_t whitePointX) - { - VerifyOrReturn(CheckConstraintType("whitePointX", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("whitePointX", whitePointX, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultOptionalAttributeWhitePointX_120() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t whitePointXArgument; - whitePointXArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - whitePointXArgument, this, OnSuccessCallback_120, OnFailureCallback_120)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_120(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_120() { NextTest(); } - - CHIP_ERROR TestReadBackTheOptionalAttributeWhitePointX_121() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_121, OnFailureCallback_121)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_121(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_121(uint16_t whitePointX) - { - VerifyOrReturn(CheckValue("whitePointX", whitePointX, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheOptionalAttributeWhitePointY_122() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_122, OnFailureCallback_122)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_122(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_122(uint16_t whitePointY) - { - VerifyOrReturn(CheckConstraintType("whitePointY", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("whitePointY", whitePointY, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultOptionalAttributeWhitePointY_123() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t whitePointYArgument; - whitePointYArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - whitePointYArgument, this, OnSuccessCallback_123, OnFailureCallback_123)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_123(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_123() { NextTest(); } - - CHIP_ERROR TestReadBackTheOptionalAttributeWhitePointY_124() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_124, OnFailureCallback_124)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_124(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_124(uint16_t whitePointY) - { - VerifyOrReturn(CheckValue("whitePointY", whitePointY, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheOptionalAttributeColorPointRX_125() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_125, OnFailureCallback_125)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_125(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_125(uint16_t colorPointRX) - { - VerifyOrReturn(CheckConstraintType("colorPointRX", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("colorPointRX", colorPointRX, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointRX_126() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t colorPointRXArgument; - colorPointRXArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - colorPointRXArgument, this, OnSuccessCallback_126, OnFailureCallback_126)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_126(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_126() { NextTest(); } - - CHIP_ERROR TestReadBackTheOptionalAttributeColorPointRX_127() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_127, OnFailureCallback_127)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_127(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_127(uint16_t colorPointRX) - { - VerifyOrReturn(CheckValue("colorPointRX", colorPointRX, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheOptionalAttributeColorPointRY_128() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_128, OnFailureCallback_128)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_128(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_128(uint16_t colorPointRY) - { - VerifyOrReturn(CheckConstraintType("colorPointRY", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("colorPointRY", colorPointRY, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointRY_129() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t colorPointRYArgument; - colorPointRYArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - colorPointRYArgument, this, OnSuccessCallback_129, OnFailureCallback_129)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_129(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_129() { NextTest(); } - - CHIP_ERROR TestReadBackTheOptionalAttributeColorPointRY_130() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_130, OnFailureCallback_130)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_130(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_130(uint16_t colorPointRY) - { - VerifyOrReturn(CheckValue("colorPointRY", colorPointRY, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheOptionalAttributeColorPointRIntensity_131() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_131, OnFailureCallback_131)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_131(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_131(uint8_t colorPointRIntensity) - { - VerifyOrReturn(CheckConstraintType("colorPointRIntensity", "", "uint8")); - - NextTest(); - } - - CHIP_ERROR TestReadTheOptionalAttributeColorPointGX_132() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_132, OnFailureCallback_132)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_132(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_132(uint16_t colorPointGX) - { - VerifyOrReturn(CheckConstraintType("colorPointGX", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("colorPointGX", colorPointGX, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointGX_133() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t colorPointGXArgument; - colorPointGXArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - colorPointGXArgument, this, OnSuccessCallback_133, OnFailureCallback_133)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_133(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_133() { NextTest(); } - - CHIP_ERROR TestReadBackTheOptionalAttributeColorPointGX_134() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_134, OnFailureCallback_134)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_134(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_134(uint16_t colorPointGX) - { - VerifyOrReturn(CheckValue("colorPointGX", colorPointGX, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheOptionalAttributeColorPointGY_135() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_135, OnFailureCallback_135)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_135(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_135(uint16_t colorPointGY) - { - VerifyOrReturn(CheckConstraintType("colorPointGY", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("colorPointGY", colorPointGY, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointGY_136() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t colorPointGYArgument; - colorPointGYArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - colorPointGYArgument, this, OnSuccessCallback_136, OnFailureCallback_136)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_136(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_136() { NextTest(); } - - CHIP_ERROR TestReadBackTheOptionalAttributeColorPointGY_137() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_137, OnFailureCallback_137)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_137(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_137(uint16_t colorPointGY) - { - VerifyOrReturn(CheckValue("colorPointGY", colorPointGY, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheOptionalAttributeColorPointGIntensity_138() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_138, OnFailureCallback_138)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_138(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_138(uint8_t colorPointGIntensity) - { - VerifyOrReturn(CheckConstraintType("colorPointGIntensity", "", "uint8")); - - NextTest(); - } - - CHIP_ERROR TestReadTheOptionalAttributeColorPointBX_139() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_139, OnFailureCallback_139)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_139(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_139(uint16_t colorPointBX) - { - VerifyOrReturn(CheckConstraintType("colorPointBX", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("colorPointBX", colorPointBX, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointBX_140() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t colorPointBXArgument; - colorPointBXArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - colorPointBXArgument, this, OnSuccessCallback_140, OnFailureCallback_140)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_140(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_140() { NextTest(); } - - CHIP_ERROR TestReadBackTheOptionalAttributeColorPointBX_141() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_141, OnFailureCallback_141)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_141(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_141(uint16_t colorPointBX) - { - VerifyOrReturn(CheckValue("colorPointBX", colorPointBX, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheOptionalAttributeColorPointBY_142() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_142, OnFailureCallback_142)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_142(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_142(uint16_t colorPointBY) - { - VerifyOrReturn(CheckConstraintType("colorPointBY", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("colorPointBY", colorPointBY, 65279U)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointBY_143() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t colorPointBYArgument; - colorPointBYArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - colorPointBYArgument, this, OnSuccessCallback_143, OnFailureCallback_143)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_143(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_143() { NextTest(); } - - CHIP_ERROR TestReadBackTheOptionalAttributeColorPointBY_144() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_144, OnFailureCallback_144)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_144(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_144(uint16_t colorPointBY) - { - VerifyOrReturn(CheckValue("colorPointBY", colorPointBY, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheOptionalAttributeColorPointBIntensity_145() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_145, OnFailureCallback_145)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_145(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_145(uint8_t colorPointBIntensity) - { - VerifyOrReturn(CheckConstraintType("colorPointBIntensity", "", "uint8")); - - NextTest(); - } -}; - -class Test_TC_CC_3_1 : public TestCommand -{ -public: - Test_TC_CC_3_1() : TestCommand("Test_TC_CC_3_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_3_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_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 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move to hue shortest distance command\n"); - err = TestMoveToHueShortestDistanceCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Move to hue longest distance command\n"); - err = TestMoveToHueLongestDistanceCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Move to hue up command\n"); - err = TestMoveToHueUpCommand_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Move to hue down command\n"); - err = TestMoveToHueDownCommand_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_8(onOff); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestTurnOnLightForColorControlTests_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestMoveToHueShortestDistanceCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToHue::Type; - - RequestType request; - request.hue = 150; - request.direction = static_cast(0); - request.transitionTime = 100U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestMoveToHueLongestDistanceCommand_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToHue::Type; - - RequestType request; - request.hue = 200; - request.direction = static_cast(1); - request.transitionTime = 100U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestMoveToHueUpCommand_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToHue::Type; - - RequestType request; - request.hue = 250; - request.direction = static_cast(2); - request.transitionTime = 100U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_5(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestMoveToHueDownCommand_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToHue::Type; - - RequestType request; - request.hue = 225; - request.direction = static_cast(3); - request.transitionTime = 100U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_6(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_6(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6() { NextTest(); } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_7(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_7(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } -}; - -class Test_TC_CC_3_2 : public TestCommand -{ -public: - Test_TC_CC_3_2() : TestCommand("Test_TC_CC_3_2"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_3_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_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 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move hue up command\n"); - err = TestMoveHueUpCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Move hue stop command\n"); - err = TestMoveHueStopCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Move hue down command\n"); - err = TestMoveHueDownCommand_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Move hue stop command\n"); - err = TestMoveHueStopCommand_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_8(onOff); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestTurnOnLightForColorControlTests_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestMoveHueUpCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveHue::Type; - - RequestType request; - request.moveMode = static_cast(1); - request.rate = 50; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestMoveHueStopCommand_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveHue::Type; - - RequestType request; - request.moveMode = static_cast(0); - request.rate = 50; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestMoveHueDownCommand_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveHue::Type; - - RequestType request; - request.moveMode = static_cast(3); - request.rate = 50; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_5(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestMoveHueStopCommand_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveHue::Type; - - RequestType request; - request.moveMode = static_cast(0); - request.rate = 50; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_6(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_6(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6() { NextTest(); } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_7(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_7(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } -}; - -class Test_TC_CC_3_3 : public TestCommand -{ -public: - Test_TC_CC_3_3() : TestCommand("Test_TC_CC_3_3"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_3_3\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_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 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step hue up command\n"); - err = TestStepHueUpCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step hue down command\n"); - err = TestStepHueDownCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_6(onOff); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestTurnOnLightForColorControlTests_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestStepHueUpCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::StepHue::Type; - - RequestType request; - request.stepMode = static_cast(1); - request.stepSize = 5; - request.transitionTime = 25; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestStepHueDownCommand_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::StepHue::Type; - - RequestType request; - request.stepMode = static_cast(3); - request.stepSize = 5; - request.transitionTime = 25; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_5(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } -}; - -class Test_TC_CC_4_1 : public TestCommand -{ -public: - Test_TC_CC_4_1() : TestCommand("Test_TC_CC_4_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_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 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move to saturation command\n"); - err = TestMoveToSaturationCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_5(onOff); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestTurnOnLightForColorControlTests_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestMoveToSaturationCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToSaturation::Type; - - RequestType request; - request.saturation = 90; - request.transitionTime = 10U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } -}; - -class Test_TC_CC_4_2 : public TestCommand -{ -public: - Test_TC_CC_4_2() : TestCommand("Test_TC_CC_4_2"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_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 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move saturation up command\n"); - err = TestMoveSaturationUpCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Move saturation down command\n"); - err = TestMoveSaturationDownCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Move saturation up command\n"); - err = TestMoveSaturationUpCommand_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Move saturation stop command\n"); - err = TestMoveSaturationStopCommand_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Move saturation down command\n"); - err = TestMoveSaturationDownCommand_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Move saturation stop command\n"); - err = TestMoveSaturationStopCommand_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 11; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - static void OnFailureCallback_10(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_10(status); - } - - static void OnSuccessCallback_10(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_10(onOff); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestTurnOnLightForColorControlTests_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestMoveSaturationUpCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type; - - RequestType request; - request.moveMode = static_cast(1); - request.rate = 5; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestMoveSaturationDownCommand_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type; - - RequestType request; - request.moveMode = static_cast(3); - request.rate = 5; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestMoveSaturationUpCommand_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type; - - RequestType request; - request.moveMode = static_cast(1); - request.rate = 5; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_5(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestMoveSaturationStopCommand_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type; - - RequestType request; - request.moveMode = static_cast(0); - request.rate = 5; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_6(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_6(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6() { NextTest(); } - - CHIP_ERROR TestMoveSaturationDownCommand_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type; - - RequestType request; - request.moveMode = static_cast(3); - request.rate = 5; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_7(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_7(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7() { NextTest(); } - - CHIP_ERROR TestMoveSaturationStopCommand_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type; - - RequestType request; - request.moveMode = static_cast(0); - request.rate = 5; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_8(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_8(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8() { NextTest(); } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_9(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_9(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_10, OnFailureCallback_10)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } -}; - -class Test_TC_CC_4_3 : public TestCommand -{ -public: - Test_TC_CC_4_3() : TestCommand("Test_TC_CC_4_3"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_3\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_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 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step saturation up command\n"); - err = TestStepSaturationUpCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step saturation down command\n"); - err = TestStepSaturationDownCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_6(onOff); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestTurnOnLightForColorControlTests_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestStepSaturationUpCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::StepSaturation::Type; - - RequestType request; - request.stepMode = static_cast(1); - request.stepSize = 15; - request.transitionTime = 10; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestStepSaturationDownCommand_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::StepSaturation::Type; - - RequestType request; - request.stepMode = static_cast(3); - request.stepSize = 20; - request.transitionTime = 10; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_5(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } -}; - -class Test_TC_CC_4_4 : public TestCommand -{ -public: - Test_TC_CC_4_4() : TestCommand("Test_TC_CC_4_4"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_4\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_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 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move To current hue and saturation command\n"); - err = TestMoveToCurrentHueAndSaturationCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_5(onOff); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestTurnOnLightForColorControlTests_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestMoveToCurrentHueAndSaturationCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToHueAndSaturation::Type; - - RequestType request; - request.hue = 40; - request.saturation = 160; - request.transitionTime = 10U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } -}; - -class Test_TC_CC_5_1 : public TestCommand -{ -public: - Test_TC_CC_5_1() : TestCommand("Test_TC_CC_5_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_5_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_5_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 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move to Color command\n"); - err = TestMoveToColorCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_5(onOff); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestTurnOnLightForColorControlTests_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestMoveToColorCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToColor::Type; - - RequestType request; - request.colorX = 200U; - request.colorY = 300U; - request.transitionTime = 20U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } -}; - -class Test_TC_CC_5_2 : public TestCommand -{ -public: - Test_TC_CC_5_2() : TestCommand("Test_TC_CC_5_2"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_5_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_5_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 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move Color command\n"); - err = TestMoveColorCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Stop Move Step command\n"); - err = TestStopMoveStepCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_6(onOff); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestTurnOnLightForColorControlTests_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestMoveColorCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveColor::Type; - - RequestType request; - request.rateX = 15; - request.rateY = 20; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestStopMoveStepCommand_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type; - - RequestType request; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_5(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } -}; - -class Test_TC_CC_5_3 : public TestCommand -{ -public: - Test_TC_CC_5_3() : TestCommand("Test_TC_CC_5_3"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_5_3\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_5_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 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step Color command\n"); - err = TestStepColorCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_5(onOff); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestTurnOnLightForColorControlTests_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestStepColorCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::StepColor::Type; - - RequestType request; - request.stepX = 15; - request.stepY = 20; - request.transitionTime = 50U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } -}; - -class Test_TC_CC_6_1 : public TestCommand -{ -public: - Test_TC_CC_6_1() : TestCommand("Test_TC_CC_6_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_6_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_6_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 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move To Color Temperature command\n"); - err = TestMoveToColorTemperatureCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_5(onOff); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestTurnOnLightForColorControlTests_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestMoveToColorTemperatureCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToColorTemperature::Type; - - RequestType request; - request.colorTemperature = 100U; - request.transitionTime = 10U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } -}; - -class Test_TC_CC_6_2 : public TestCommand -{ -public: - Test_TC_CC_6_2() : TestCommand("Test_TC_CC_6_2"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_6_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_6_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 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move up color temperature command\n"); - err = TestMoveUpColorTemperatureCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Stop Color Temperature command\n"); - err = TestStopColorTemperatureCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Move down color temperature command\n"); - err = TestMoveDownColorTemperatureCommand_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_7(onOff); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestTurnOnLightForColorControlTests_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestMoveUpColorTemperatureCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type; - - RequestType request; - request.moveMode = static_cast(1); - request.rate = 10U; - request.colorTemperatureMinimum = 1U; - request.colorTemperatureMaximum = 255U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestStopColorTemperatureCommand_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type; - - RequestType request; - request.moveMode = static_cast(0); - request.rate = 10U; - request.colorTemperatureMinimum = 1U; - request.colorTemperatureMaximum = 255U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestMoveDownColorTemperatureCommand_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type; - - RequestType request; - request.moveMode = static_cast(3); - request.rate = 20U; - request.colorTemperatureMinimum = 1U; - request.colorTemperatureMaximum = 255U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_5(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_6(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_6(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } -}; - -class Test_TC_CC_6_3 : public TestCommand -{ -public: - Test_TC_CC_6_3() : TestCommand("Test_TC_CC_6_3"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_6_3\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_6_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 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step up color temperature command\n"); - err = TestStepUpColorTemperatureCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step down color temperature command\n"); - err = TestStepDownColorTemperatureCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_6(onOff); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestTurnOnLightForColorControlTests_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestStepUpColorTemperatureCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::StepColorTemperature::Type; - - RequestType request; - request.stepMode = static_cast(1); - request.stepSize = 5U; - request.transitionTime = 50U; - request.colorTemperatureMinimum = 5U; - request.colorTemperatureMaximum = 100U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestStepDownColorTemperatureCommand_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::StepColorTemperature::Type; - - RequestType request; - request.stepMode = static_cast(3); - request.stepSize = 5U; - request.transitionTime = 50U; - request.colorTemperatureMinimum = 5U; - request.colorTemperatureMaximum = 100U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_5(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } -}; - -class Test_TC_CC_7_1 : public TestCommand -{ -public: - Test_TC_CC_7_1() : TestCommand("Test_TC_CC_7_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_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 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Enhanced Move To Hue command\n"); - err = TestEnhancedMoveToHueCommand_3(); - break; - case 4: - ChipLogProgress( - chipTool, " ***** Test Step 4 : Check Remaining time attribute value matched the value sent by the last command\n"); - err = TestCheckRemainingTimeAttributeValueMatchedTheValueSentByTheLastCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint16_t remainingTime) - { - (static_cast(context))->OnSuccessResponse_4(remainingTime); - } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_6(onOff); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestTurnOnLightForColorControlTests_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestEnhancedMoveToHueCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type; - - RequestType request; - request.enhancedHue = 1025U; - request.direction = static_cast(0); - request.transitionTime = 1U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestCheckRemainingTimeAttributeValueMatchedTheValueSentByTheLastCommand_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint16_t remainingTime) - { - VerifyOrReturn(CheckValue("remainingTime", remainingTime, 1U)); - - NextTest(); - } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_5(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } -}; - -class Test_TC_CC_7_2 : public TestCommand -{ -public: - Test_TC_CC_7_2() : TestCommand("Test_TC_CC_7_2"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_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 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Enhanced Move Hue Down command \n"); - err = TestEnhancedMoveHueDownCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Enhanced Move Hue Stop command\n"); - err = TestEnhancedMoveHueStopCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Enhanced Move Hue Up command\n"); - err = TestEnhancedMoveHueUpCommand_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Enhanced Move Hue Stop command\n"); - err = TestEnhancedMoveHueStopCommand_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_8(onOff); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestTurnOnLightForColorControlTests_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestEnhancedMoveHueDownCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type; - - RequestType request; - request.moveMode = static_cast(3); - request.rate = 5U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestEnhancedMoveHueStopCommand_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type; - - RequestType request; - request.moveMode = static_cast(0); - request.rate = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestEnhancedMoveHueUpCommand_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type; - - RequestType request; - request.moveMode = static_cast(1); - request.rate = 50U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_5(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestEnhancedMoveHueStopCommand_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type; - - RequestType request; - request.moveMode = static_cast(0); - request.rate = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_6(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_6(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6() { NextTest(); } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_7(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_7(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } -}; - -class Test_TC_CC_7_3 : public TestCommand -{ -public: - Test_TC_CC_7_3() : TestCommand("Test_TC_CC_7_3"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_3\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_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 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Enhanced Step Hue Up command\n"); - err = TestEnhancedStepHueUpCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Enhanced Step Hue Down command\n"); - err = TestEnhancedStepHueDownCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_6(onOff); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestTurnOnLightForColorControlTests_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestEnhancedStepHueUpCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedStepHue::Type; - - RequestType request; - request.stepMode = static_cast(0); - request.stepSize = 50U; - request.transitionTime = 1U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestEnhancedStepHueDownCommand_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedStepHue::Type; - - RequestType request; - request.stepMode = static_cast(1); - request.stepSize = 75U; - request.transitionTime = 1U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_5(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } -}; - -class Test_TC_CC_7_4 : public TestCommand -{ -public: - Test_TC_CC_7_4() : TestCommand("Test_TC_CC_7_4"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_4\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_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 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Enhanced move to hue and saturation command\n"); - err = TestEnhancedMoveToHueAndSaturationCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_5(onOff); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestTurnOnLightForColorControlTests_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestEnhancedMoveToHueAndSaturationCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHueAndSaturation::Type; - - RequestType request; - request.enhancedHue = 1200U; - request.saturation = 90; - request.transitionTime = 10U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } -}; - -class Test_TC_CC_8_1 : public TestCommand -{ -public: - Test_TC_CC_8_1() : TestCommand("Test_TC_CC_8_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_8_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_8_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 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Color Loop Set Command - Set all Attributs\n"); - err = TestColorLoopSetCommandSetAllAttributs_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Check ColorLoopDirection Value\n"); - err = TestCheckColorLoopDirectionValue_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check ColorLoopTime Value\n"); - err = TestCheckColorLoopTimeValue_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check ColorLoopStartEnhancedHue Value\n"); - err = TestCheckColorLoopStartEnhancedHueValue_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Check ColorLoopActive Value\n"); - err = TestCheckColorLoopActiveValue_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Color Loop Set Command - Start Color Loop\n"); - err = TestColorLoopSetCommandStartColorLoop_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Check ColorLoopActive Value\n"); - err = TestCheckColorLoopActiveValue_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Color Loop Set Command - Set direction and time while running\n"); - err = TestColorLoopSetCommandSetDirectionAndTimeWhileRunning_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Check ColorLoopDirection Value\n"); - err = TestCheckColorLoopDirectionValue_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Check ColorLoopTime Value\n"); - err = TestCheckColorLoopTimeValue_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Color Loop Set Command - Set direction while running\n"); - err = TestColorLoopSetCommandSetDirectionWhileRunning_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Check ColorLoopDirection Value\n"); - err = TestCheckColorLoopDirectionValue_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_16(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 17; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint8_t colorLoopDirection) - { - (static_cast(context))->OnSuccessResponse_4(colorLoopDirection); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, uint16_t colorLoopTime) - { - (static_cast(context))->OnSuccessResponse_5(colorLoopTime); - } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, uint16_t colorLoopStartEnhancedHue) - { - (static_cast(context))->OnSuccessResponse_6(colorLoopStartEnhancedHue); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_7(colorLoopActive); - } - - static void OnFailureCallback_9(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_9(colorLoopActive); - } - - static void OnFailureCallback_11(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_11(status); - } - - static void OnSuccessCallback_11(void * context, uint8_t colorLoopDirection) - { - (static_cast(context))->OnSuccessResponse_11(colorLoopDirection); - } - - static void OnFailureCallback_12(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_12(status); - } - - static void OnSuccessCallback_12(void * context, uint16_t colorLoopTime) - { - (static_cast(context))->OnSuccessResponse_12(colorLoopTime); - } - - static void OnFailureCallback_14(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_14(status); - } - - static void OnSuccessCallback_14(void * context, uint8_t colorLoopDirection) - { - (static_cast(context))->OnSuccessResponse_14(colorLoopDirection); - } - - static void OnFailureCallback_16(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_16(status); - } - - static void OnSuccessCallback_16(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_16(onOff); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestTurnOnLightForColorControlTests_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestColorLoopSetCommandSetAllAttributs_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(14); - request.action = static_cast(0); - request.direction = static_cast(1); - request.time = 100U; - request.startHue = 500U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestCheckColorLoopDirectionValue_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint8_t colorLoopDirection) - { - VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 1)); - - NextTest(); - } - - CHIP_ERROR TestCheckColorLoopTimeValue_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(uint16_t colorLoopTime) - { - VerifyOrReturn(CheckValue("colorLoopTime", colorLoopTime, 100U)); - - NextTest(); - } - - CHIP_ERROR TestCheckColorLoopStartEnhancedHueValue_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(uint16_t colorLoopStartEnhancedHue) - { - VerifyOrReturn(CheckValue("colorLoopStartEnhancedHue", colorLoopStartEnhancedHue, 500U)); - - NextTest(); - } - - CHIP_ERROR TestCheckColorLoopActiveValue_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(uint8_t colorLoopActive) - { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); - - NextTest(); - } - - CHIP_ERROR TestColorLoopSetCommandStartColorLoop_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(1); - request.action = static_cast(1); - request.direction = static_cast(0); - request.time = 0U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_8(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_8(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8() { NextTest(); } - - CHIP_ERROR TestCheckColorLoopActiveValue_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9(uint8_t colorLoopActive) - { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 1)); - - NextTest(); - } - - CHIP_ERROR TestColorLoopSetCommandSetDirectionAndTimeWhileRunning_10() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(6); - request.action = static_cast(0); - request.direction = static_cast(0); - request.time = 3500U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_10(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_10(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10() { NextTest(); } - - CHIP_ERROR TestCheckColorLoopDirectionValue_11() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_11, OnFailureCallback_11)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_11(uint8_t colorLoopDirection) - { - VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 0)); - - NextTest(); - } - - CHIP_ERROR TestCheckColorLoopTimeValue_12() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_12, OnFailureCallback_12)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_12(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_12(uint16_t colorLoopTime) - { - VerifyOrReturn(CheckValue("colorLoopTime", colorLoopTime, 3500U)); - - NextTest(); - } - - CHIP_ERROR TestColorLoopSetCommandSetDirectionWhileRunning_13() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(2); - request.action = static_cast(0); - request.direction = static_cast(1); - request.time = 0U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_13(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_13(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_13(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_13() { NextTest(); } - - CHIP_ERROR TestCheckColorLoopDirectionValue_14() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_14, OnFailureCallback_14)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_14(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_14(uint8_t colorLoopDirection) - { - VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 1)); - - NextTest(); - } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_15() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_15(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_15(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_15(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_15() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_16() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_16, OnFailureCallback_16)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_16(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_16(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } -}; - -class Test_TC_CC_9_1 : public TestCommand -{ -public: - Test_TC_CC_9_1() : TestCommand("Test_TC_CC_9_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_9_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_9_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 : Precondition : Turn on light for color control tests\n"); - err = TestPreconditionTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read ColorLoopDirection attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPDIRECTION") ? CHIP_NO_ERROR : TestReadColorLoopDirectionAttributeFromDut_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read ColorLoopTime attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPTIME") ? CHIP_NO_ERROR : TestReadColorLoopTimeAttributeFromDut_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Read ColorLoopStartEnhancedHue attribute from DUT\n"); - err = - ShouldSkip("A_COLORLOOPSTARTENHANCEDHUE") ? CHIP_NO_ERROR : TestReadColorLoopStartEnhancedHueAttributeFromDut_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Read ColorLoopDirection attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPDIRECTION") ? CHIP_NO_ERROR : TestReadColorLoopDirectionAttributeFromDut_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Enhanced Move To Hue command 10\n"); - err = ShouldSkip("CR_ENHANCEDMOVETOHUE") ? CHIP_NO_ERROR : TestEnhancedMoveToHueCommand10_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Wait 2000ms\n"); - err = TestWait2000ms_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Read EnhancedCurrentHue attribute from DUT\n"); - err = ShouldSkip("A_ENHANCEDCURRENTHUE") ? CHIP_NO_ERROR : TestReadEnhancedCurrentHueAttributeFromDut_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Read ColorLoopDirection attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPDIRECTION") ? CHIP_NO_ERROR : TestReadColorLoopDirectionAttributeFromDut_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_26(); - break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_27(); - break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_28(); - break; - case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_29(); - break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_30(); - break; - case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : Read ColorLoopDirection attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPDIRECTION") ? CHIP_NO_ERROR : TestReadColorLoopDirectionAttributeFromDut_31(); - break; - case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_32(); - break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_33(); - break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_34(); - break; - case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_35(); - break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : Turn Off light for color control tests\n"); - err = TestTurnOffLightForColorControlTests_36(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 37; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_4(colorLoopActive); - } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, uint8_t colorLoopDirection) - { - (static_cast(context))->OnSuccessResponse_6(colorLoopDirection); - } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context, uint16_t colorLoopTime) - { - (static_cast(context))->OnSuccessResponse_8(colorLoopTime); - } - - static void OnFailureCallback_10(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_10(status); - } - - static void OnSuccessCallback_10(void * context, uint16_t colorLoopStartEnhancedHue) - { - (static_cast(context))->OnSuccessResponse_10(colorLoopStartEnhancedHue); - } - - static void OnFailureCallback_12(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_12(status); - } - - static void OnSuccessCallback_12(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_12(colorLoopActive); - } - - static void OnFailureCallback_14(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_14(status); - } - - static void OnSuccessCallback_14(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_14(colorLoopActive); - } - - static void OnFailureCallback_16(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_16(status); - } - - static void OnSuccessCallback_16(void * context, uint8_t colorLoopDirection) - { - (static_cast(context))->OnSuccessResponse_16(colorLoopDirection); - } - - static void OnFailureCallback_18(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_18(status); - } - - static void OnSuccessCallback_18(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_18(colorLoopActive); - } - - static void OnFailureCallback_20(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_20(status); - } - - static void OnSuccessCallback_20(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_20(colorLoopActive); - } - - static void OnFailureCallback_23(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_23(status); - } - - static void OnSuccessCallback_23(void * context, uint16_t enhancedCurrentHue) - { - (static_cast(context))->OnSuccessResponse_23(enhancedCurrentHue); - } - - static void OnFailureCallback_25(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_25(status); - } - - static void OnSuccessCallback_25(void * context, uint8_t colorLoopDirection) - { - (static_cast(context))->OnSuccessResponse_25(colorLoopDirection); - } - - static void OnFailureCallback_27(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_27(status); - } - - static void OnSuccessCallback_27(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_27(colorLoopActive); - } - - static void OnFailureCallback_29(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_29(status); - } - - static void OnSuccessCallback_29(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_29(colorLoopActive); - } - - static void OnFailureCallback_31(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_31(status); - } - - static void OnSuccessCallback_31(void * context, uint8_t colorLoopDirection) - { - (static_cast(context))->OnSuccessResponse_31(colorLoopDirection); - } - - static void OnFailureCallback_33(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_33(status); - } - - static void OnSuccessCallback_33(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_33(colorLoopActive); - } - - static void OnFailureCallback_35(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_35(status); - } - - static void OnSuccessCallback_35(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_35(colorLoopActive); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestPreconditionTurnOnLightForColorControlTests_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(1); - request.action = static_cast(0); - request.direction = static_cast(0); - request.time = 0U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint8_t colorLoopActive) - { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); - - NextTest(); - } - - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(2); - request.action = static_cast(0); - request.direction = static_cast(0); - request.time = 0U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_5(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(uint8_t colorLoopDirection) - { - VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 0)); - - NextTest(); - } - - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(4); - request.action = static_cast(0); - request.direction = static_cast(0); - request.time = 30U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_7(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_7(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7() { NextTest(); } - - CHIP_ERROR TestReadColorLoopTimeAttributeFromDut_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8(uint16_t colorLoopTime) - { - VerifyOrReturn(CheckValue("colorLoopTime", colorLoopTime, 30U)); - - NextTest(); - } - - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(8); - request.action = static_cast(0); - request.direction = static_cast(0); - request.time = 0U; - request.startHue = 160U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_9(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_9(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9() { NextTest(); } - - CHIP_ERROR TestReadColorLoopStartEnhancedHueAttributeFromDut_10() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_10, OnFailureCallback_10)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10(uint16_t colorLoopStartEnhancedHue) - { - VerifyOrReturn(CheckValue("colorLoopStartEnhancedHue", colorLoopStartEnhancedHue, 160U)); - - NextTest(); - } - - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_11() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(1); - request.action = static_cast(1); - request.direction = static_cast(0); - request.time = 0U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_11(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_11(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_11() { NextTest(); } - - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_12() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_12, OnFailureCallback_12)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_12(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_12(uint8_t colorLoopActive) - { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 1)); - - NextTest(); - } - - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_13() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(1); - request.action = static_cast(0); - request.direction = static_cast(0); - request.time = 0U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_13(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_13(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_13(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_13() { NextTest(); } - - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_14() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_14, OnFailureCallback_14)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_14(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_14(uint8_t colorLoopActive) - { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); - - NextTest(); - } - - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_15() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(2); - request.action = static_cast(0); - request.direction = static_cast(1); - request.time = 0U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_15(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_15(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_15(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_15() { NextTest(); } - - CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_16() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_16, OnFailureCallback_16)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_16(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_16(uint8_t colorLoopDirection) - { - VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 1)); - - NextTest(); - } - - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_17() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(1); - request.action = static_cast(1); - request.direction = static_cast(0); - request.time = 0U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_17(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_17(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_17(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_17() { NextTest(); } - - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_18() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_18, OnFailureCallback_18)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_18(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_18(uint8_t colorLoopActive) - { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 1)); - - NextTest(); - } - - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_19() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(1); - request.action = static_cast(0); - request.direction = static_cast(0); - request.time = 0U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_19(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_19(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_19(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_19() { NextTest(); } - - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_20() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_20, OnFailureCallback_20)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_20(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_20(uint8_t colorLoopActive) - { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); - - NextTest(); - } - - CHIP_ERROR TestEnhancedMoveToHueCommand10_21() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type; - - RequestType request; - request.enhancedHue = 40960U; - request.direction = static_cast(0); - request.transitionTime = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_21(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_21(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_21(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_21() { NextTest(); } - - CHIP_ERROR TestWait2000ms_22() - { - SetIdentity(kIdentityAlpha); - return WaitForMs(2000); - } - - CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_23() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_23, OnFailureCallback_23)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_23(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_23(uint16_t enhancedCurrentHue) - { - VerifyOrReturn(CheckValue("enhancedCurrentHue", enhancedCurrentHue, 40960U)); - - NextTest(); - } - - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_24() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(2); - request.action = static_cast(0); - request.direction = static_cast(0); - request.time = 0U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_24(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_24(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_24(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_24() { NextTest(); } - - CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_25() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_25, OnFailureCallback_25)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_25(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_25(uint8_t colorLoopDirection) - { - VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 0)); - - NextTest(); - } - - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_26() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(1); - request.action = static_cast(2); - request.direction = static_cast(0); - request.time = 0U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_26(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_26(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_26(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_26() { NextTest(); } - - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_27() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_27, OnFailureCallback_27)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_27(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_27(uint8_t colorLoopActive) - { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 1)); - - NextTest(); - } - - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_28() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(1); - request.action = static_cast(0); - request.direction = static_cast(0); - request.time = 0U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_28(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_28(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_28(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_28() { NextTest(); } - - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_29() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_29, OnFailureCallback_29)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_29(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_29(uint8_t colorLoopActive) - { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); - - NextTest(); - } - - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_30() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(2); - request.action = static_cast(0); - request.direction = static_cast(1); - request.time = 0U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_30(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_30(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_30(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_30() { NextTest(); } - - CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_31() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_31, OnFailureCallback_31)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_31(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_31(uint8_t colorLoopDirection) - { - VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 1)); - - NextTest(); - } - - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_32() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(1); - request.action = static_cast(2); - request.direction = static_cast(0); - request.time = 0U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_32(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_32(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_32(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_32() { NextTest(); } - - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_33() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_33, OnFailureCallback_33)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_33(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_33(uint8_t colorLoopActive) - { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 1)); - - NextTest(); - } - - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_34() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(1); - request.action = static_cast(0); - request.direction = static_cast(0); - request.time = 0U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_34(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_34(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_34(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_34() { NextTest(); } - - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_35() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_35, OnFailureCallback_35)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_35(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_35(uint8_t colorLoopActive) - { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); - - NextTest(); - } - - CHIP_ERROR TestTurnOffLightForColorControlTests_36() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_36(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_36(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_36(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_36() { NextTest(); } -}; - -class Test_TC_CC_9_2 : public TestCommand -{ -public: - Test_TC_CC_9_2() : TestCommand("Test_TC_CC_9_2"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_9_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_9_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 : Precondition: Turn on light for color control tests\n"); - err = TestPreconditionTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Precondition: Check on/off attribute value is true after on command\n"); - err = TestPreconditionCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read ColorLoopDirection attribute from DUT.\n"); - err = ShouldSkip("A_COLORLOOPDIRECTION") ? CHIP_NO_ERROR : TestReadColorLoopDirectionAttributeFromDut_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read ColorLoopTime attribute from DUT.\n"); - err = ShouldSkip("A_COLORLOOPTIME") ? CHIP_NO_ERROR : TestReadColorLoopTimeAttributeFromDut_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read ColorLoopStartEnhancedHue attribute from DUT.\n"); - err = ShouldSkip("A_COLORLOOPSTARTENHANCEDHUE") ? CHIP_NO_ERROR : TestReadColorLoopStartEnhancedHueAttributeFromDut_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Color Loop Set Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestColorLoopSetCommandSetAllAttributes_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read ColorLoopActive attribute from DUT.\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Color Loop Set Command - Start Color Loop\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestColorLoopSetCommandStartColorLoop_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Read ColorLoopDirection attribute from DUT.\n"); - err = ShouldSkip("A_COLORLOOPDIRECTION") ? CHIP_NO_ERROR : TestReadColorLoopDirectionAttributeFromDut_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Color Loop Set Command - Start Color Loop\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestColorLoopSetCommandStartColorLoop_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Turn off light for color control tests\n"); - err = TestTurnOffLightForColorControlTests_14(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 15; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_4(colorLoopActive); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, uint8_t colorLoopDirection) - { - (static_cast(context))->OnSuccessResponse_5(colorLoopDirection); - } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, uint16_t colorLoopTime) - { - (static_cast(context))->OnSuccessResponse_6(colorLoopTime); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, uint16_t colorLoopStartEnhancedHue) - { - (static_cast(context))->OnSuccessResponse_7(colorLoopStartEnhancedHue); - } - - static void OnFailureCallback_9(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_9(colorLoopActive); - } - - static void OnFailureCallback_11(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_11(status); - } - - static void OnSuccessCallback_11(void * context, uint8_t colorLoopDirection) - { - (static_cast(context))->OnSuccessResponse_11(colorLoopDirection); - } - - static void OnFailureCallback_13(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_13(status); - } - - static void OnSuccessCallback_13(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_13(colorLoopActive); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestPreconditionTurnOnLightForColorControlTests_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestPreconditionCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(15); - request.action = static_cast(0); - request.direction = static_cast(0); - request.time = 30U; - request.startHue = 160U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint8_t colorLoopActive) - { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(uint8_t colorLoopDirection) - { - VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadColorLoopTimeAttributeFromDut_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(uint16_t colorLoopTime) - { - VerifyOrReturn(CheckValue("colorLoopTime", colorLoopTime, 30U)); - - NextTest(); - } - - CHIP_ERROR TestReadColorLoopStartEnhancedHueAttributeFromDut_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(uint16_t colorLoopStartEnhancedHue) - { - VerifyOrReturn(CheckValue("colorLoopStartEnhancedHue", colorLoopStartEnhancedHue, 160U)); - - NextTest(); - } - - CHIP_ERROR TestColorLoopSetCommandSetAllAttributes_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(1); - request.action = static_cast(1); - request.direction = static_cast(0); - request.time = 0U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_8(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_8(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8() { NextTest(); } - - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9(uint8_t colorLoopActive) - { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 1)); - - NextTest(); - } - - CHIP_ERROR TestColorLoopSetCommandStartColorLoop_10() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(2); - request.action = static_cast(0); - request.direction = static_cast(1); - request.time = 0U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_10(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_10(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10() { NextTest(); } - - CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_11() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_11, OnFailureCallback_11)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_11(uint8_t colorLoopDirection) - { - VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 1)); - - NextTest(); - } - - CHIP_ERROR TestColorLoopSetCommandStartColorLoop_12() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(1); - request.action = static_cast(0); - request.direction = static_cast(0); - request.time = 0U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_12(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_12(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_12(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_12() { NextTest(); } - - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_13() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_13, OnFailureCallback_13)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_13(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_13(uint8_t colorLoopActive) - { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); - - NextTest(); - } - - CHIP_ERROR TestTurnOffLightForColorControlTests_14() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_14(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_14(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_14(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_14() { NextTest(); } -}; - -class Test_TC_CC_9_3 : public TestCommand -{ -public: - Test_TC_CC_9_3() : TestCommand("Test_TC_CC_9_3"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_9_3\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_9_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 : Precondition: Turn on light for color control tests\n"); - err = TestPreconditionTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Precondition: Check on/off attribute value is true after on command\n"); - err = TestPreconditionCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read ColorLoopDirection attribute from DUT.\n"); - err = ShouldSkip("A_COLORLOOPDIRECTION") ? CHIP_NO_ERROR : TestReadColorLoopDirectionAttributeFromDut_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read ColorLoopTime attribute from DUT.\n"); - err = ShouldSkip("A_COLORLOOPTIME") ? CHIP_NO_ERROR : TestReadColorLoopTimeAttributeFromDut_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read ColorLoopStartEnhancedHue attribute from DUT.\n"); - err = ShouldSkip("A_COLORLOOPSTARTENHANCEDHUE") ? CHIP_NO_ERROR : TestReadColorLoopStartEnhancedHueAttributeFromDut_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Color Loop Set Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestColorLoopSetCommandSetAllAttributes_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read ColorLoopActive attribute from DUT.\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Color Loop Set Command - Start Color Loop\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestColorLoopSetCommandStartColorLoop_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Read ColorLoopTime attribute from DUT.\n"); - err = ShouldSkip("A_COLORLOOPTIME") ? CHIP_NO_ERROR : TestReadColorLoopTimeAttributeFromDut_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Color Loop Set Command - Start Color Loop\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestColorLoopSetCommandStartColorLoop_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Turn off light for color control tests\n"); - err = TestTurnOffLightForColorControlTests_14(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 15; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_4(colorLoopActive); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, uint8_t colorLoopDirection) - { - (static_cast(context))->OnSuccessResponse_5(colorLoopDirection); - } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, uint16_t colorLoopTime) - { - (static_cast(context))->OnSuccessResponse_6(colorLoopTime); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, uint16_t colorLoopStartEnhancedHue) - { - (static_cast(context))->OnSuccessResponse_7(colorLoopStartEnhancedHue); - } - - static void OnFailureCallback_9(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_9(colorLoopActive); - } - - static void OnFailureCallback_11(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_11(status); - } - - static void OnSuccessCallback_11(void * context, uint16_t colorLoopTime) - { - (static_cast(context))->OnSuccessResponse_11(colorLoopTime); - } - - static void OnFailureCallback_13(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_13(status); - } - - static void OnSuccessCallback_13(void * context, uint8_t colorLoopActive) - { - (static_cast(context))->OnSuccessResponse_13(colorLoopActive); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestPreconditionTurnOnLightForColorControlTests_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestPreconditionCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(15); - request.action = static_cast(0); - request.direction = static_cast(0); - request.time = 30U; - request.startHue = 160U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint8_t colorLoopActive) - { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(uint8_t colorLoopDirection) - { - VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadColorLoopTimeAttributeFromDut_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(uint16_t colorLoopTime) - { - VerifyOrReturn(CheckValue("colorLoopTime", colorLoopTime, 30U)); - - NextTest(); - } - - CHIP_ERROR TestReadColorLoopStartEnhancedHueAttributeFromDut_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(uint16_t colorLoopStartEnhancedHue) - { - VerifyOrReturn(CheckValue("colorLoopStartEnhancedHue", colorLoopStartEnhancedHue, 160U)); - - NextTest(); - } - - CHIP_ERROR TestColorLoopSetCommandSetAllAttributes_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(1); - request.action = static_cast(1); - request.direction = static_cast(0); - request.time = 0U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_8(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_8(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8() { NextTest(); } - - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9(uint8_t colorLoopActive) - { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 1)); - - NextTest(); - } - - CHIP_ERROR TestColorLoopSetCommandStartColorLoop_10() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(4); - request.action = static_cast(0); - request.direction = static_cast(0); - request.time = 60U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_10(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_10(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10() { NextTest(); } - - CHIP_ERROR TestReadColorLoopTimeAttributeFromDut_11() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_11, OnFailureCallback_11)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_11(uint16_t colorLoopTime) - { - VerifyOrReturn(CheckValue("colorLoopTime", colorLoopTime, 60U)); - - NextTest(); - } - - CHIP_ERROR TestColorLoopSetCommandStartColorLoop_12() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(1); - request.action = static_cast(0); - request.direction = static_cast(0); - request.time = 0U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_12(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_12(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_12(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_12() { NextTest(); } - - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_13() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_13, OnFailureCallback_13)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_13(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_13(uint8_t colorLoopActive) - { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); - - NextTest(); - } - - CHIP_ERROR TestTurnOffLightForColorControlTests_14() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_14(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_14(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_14(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_14() { NextTest(); } -}; - -class Test_TC_DD_1_5 : public TestCommand -{ -public: - Test_TC_DD_1_5() : TestCommand("Test_TC_DD_1_5"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DD_1_5\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DD_1_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 : Step 1\n"); - err = TestStep1_0(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; - - // - // Tests methods - // - - CHIP_ERROR TestStep1_0() - { - SetIdentity(kIdentityAlpha); - return Log("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"); - } -}; - -class Test_TC_DD_1_6 : public TestCommand -{ -public: - Test_TC_DD_1_6() : TestCommand("Test_TC_DD_1_6"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DD_1_6\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DD_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 : Step 1\n"); - err = TestStep1_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Step 1 verification\n"); - err = TestStep1Verification_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 2 verificaiton\n"); - err = TestStep2Verificaiton_2(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - // - // Tests methods - // - - CHIP_ERROR TestStep1_0() - { - SetIdentity(kIdentityAlpha); - return Log("Scan the DUTs QR code using a QR code reader"); - } - - CHIP_ERROR TestStep1Verification_1() - { - SetIdentity(kIdentityAlpha); - return Log( - "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"); - } - - CHIP_ERROR TestStep2Verificaiton_2() - { - SetIdentity(kIdentityAlpha); - return Log("Verify QR code version is 1 or higher"); - } -}; - -class Test_TC_DD_1_7 : public TestCommand -{ -public: - Test_TC_DD_1_7() : TestCommand("Test_TC_DD_1_7"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DD_1_7\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DD_1_7\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 : Precondition\n"); - err = TestPrecondition_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Step 1\n"); - err = TestStep1_1(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; - - // - // Tests methods - // - - CHIP_ERROR TestPrecondition_0() - { - SetIdentity(kIdentityAlpha); - return Log("Verify manual pairing code is printed on the device or in additional provided materials"); - } - - CHIP_ERROR TestStep1_1() - { - SetIdentity(kIdentityAlpha); - return Log("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"); - } -}; - -class Test_TC_DD_1_8 : public TestCommand -{ -public: - Test_TC_DD_1_8() : TestCommand("Test_TC_DD_1_8"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DD_1_8\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DD_1_8\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 : Step 1\n"); - err = TestStep1_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Step 1 verification\n"); - err = TestStep1Verification_1(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; - - // - // Tests methods - // - - CHIP_ERROR TestStep1_0() - { - SetIdentity(kIdentityAlpha); - return Log("Scan the device QR code using DUT"); - } - - CHIP_ERROR TestStep1Verification_1() - { - SetIdentity(kIdentityAlpha); - return Log("Verify the DUT is able to scan and parse the QR code successfully to onboard the device onto the CHIP network"); - } -}; - -class Test_TC_DD_1_9 : public TestCommand -{ -public: - Test_TC_DD_1_9() : TestCommand("Test_TC_DD_1_9"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DD_1_9\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DD_1_9\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 : Precondition\n"); - err = TestPrecondition_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Step 1\n"); - err = TestStep1_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 1 verification\n"); - err = TestStep1Verification_2(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - // - // Tests methods - // - - CHIP_ERROR TestPrecondition_0() - { - SetIdentity(kIdentityAlpha); - return Log("Verify that the manual pairing code is printed on the device or in additional provided materials"); - } - - CHIP_ERROR TestStep1_1() - { - SetIdentity(kIdentityAlpha); - return Log("Provide the 11 digit or 21 digit pairing code from the Device in text speech or any format supported by DUT"); - } - - CHIP_ERROR TestStep1Verification_2() - { - SetIdentity(kIdentityAlpha); - return Log( - "Verify that the manual pairing code can be provided to DUT and parsed to onboard the device onto the CHIP network"); - } -}; - -class Test_TC_DM_1_1 : public TestCommand -{ -public: - Test_TC_DM_1_1() : TestCommand("Test_TC_DM_1_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DM_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DM_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 : Query Interaction Model Version\n"); - err = TestQueryInteractionModelVersion_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Query Vendor Name\n"); - err = TestQueryVendorName_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Query VendorID\n"); - err = TestQueryVendorID_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Query Product Name\n"); - err = TestQueryProductName_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Query ProductID\n"); - err = TestQueryProductID_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Query Node Label\n"); - err = TestQueryNodeLabel_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Query User Location\n"); - err = TestQueryUserLocation_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Query HardwareVersion\n"); - err = TestQueryHardwareVersion_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Query HardwareVersionString\n"); - err = TestQueryHardwareVersionString_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Query SoftwareVersion\n"); - err = TestQuerySoftwareVersion_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Query SoftwareVersionString\n"); - err = TestQuerySoftwareVersionString_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Query ManufacturingDate\n"); - err = ShouldSkip("MANF_DATE") ? CHIP_NO_ERROR : TestQueryManufacturingDate_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Query PartNumber\n"); - err = ShouldSkip("PART_NUM") ? CHIP_NO_ERROR : TestQueryPartNumber_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Query ProductURL\n"); - err = TestQueryProductURL_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Query ProductLabel\n"); - err = TestQueryProductLabel_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Query SerialNumber\n"); - err = TestQuerySerialNumber_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Query LocalConfigDisabled\n"); - err = TestQueryLocalConfigDisabled_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Query Reachable\n"); - err = TestQueryReachable_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Query UniqueID\n"); - err = TestQueryUniqueID_19(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 20; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint16_t interactionModelVersion) - { - (static_cast(context))->OnSuccessResponse_1(interactionModelVersion); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, chip::CharSpan vendorName) - { - (static_cast(context))->OnSuccessResponse_2(vendorName); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, uint16_t vendorID) - { - (static_cast(context))->OnSuccessResponse_3(vendorID); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, chip::CharSpan productName) - { - (static_cast(context))->OnSuccessResponse_4(productName); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, uint16_t productID) - { - (static_cast(context))->OnSuccessResponse_5(productID); - } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, chip::CharSpan nodeLabel) - { - (static_cast(context))->OnSuccessResponse_6(nodeLabel); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, chip::CharSpan location) - { - (static_cast(context))->OnSuccessResponse_7(location); - } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context, uint16_t hardwareVersion) - { - (static_cast(context))->OnSuccessResponse_8(hardwareVersion); - } - - static void OnFailureCallback_9(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context, chip::CharSpan hardwareVersionString) - { - (static_cast(context))->OnSuccessResponse_9(hardwareVersionString); - } - - static void OnFailureCallback_10(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_10(status); - } - - static void OnSuccessCallback_10(void * context, uint32_t softwareVersion) - { - (static_cast(context))->OnSuccessResponse_10(softwareVersion); - } - - static void OnFailureCallback_11(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_11(status); - } - - static void OnSuccessCallback_11(void * context, chip::CharSpan softwareVersionString) - { - (static_cast(context))->OnSuccessResponse_11(softwareVersionString); - } - - static void OnFailureCallback_12(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_12(status); - } - - static void OnSuccessCallback_12(void * context, chip::CharSpan manufacturingDate) - { - (static_cast(context))->OnSuccessResponse_12(manufacturingDate); - } - - static void OnFailureCallback_13(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_13(status); - } - - static void OnSuccessCallback_13(void * context, chip::CharSpan partNumber) - { - (static_cast(context))->OnSuccessResponse_13(partNumber); - } - - static void OnFailureCallback_14(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_14(status); - } - - static void OnSuccessCallback_14(void * context, chip::CharSpan productURL) - { - (static_cast(context))->OnSuccessResponse_14(productURL); - } - - static void OnFailureCallback_15(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_15(status); - } - - static void OnSuccessCallback_15(void * context, chip::CharSpan productLabel) - { - (static_cast(context))->OnSuccessResponse_15(productLabel); - } - - static void OnFailureCallback_16(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_16(status); - } - - static void OnSuccessCallback_16(void * context, chip::CharSpan serialNumber) - { - (static_cast(context))->OnSuccessResponse_16(serialNumber); - } - - static void OnFailureCallback_17(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_17(status); - } - - static void OnSuccessCallback_17(void * context, bool localConfigDisabled) - { - (static_cast(context))->OnSuccessResponse_17(localConfigDisabled); - } - - static void OnFailureCallback_18(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_18(status); - } - - static void OnSuccessCallback_18(void * context, bool reachable) - { - (static_cast(context))->OnSuccessResponse_18(reachable); - } - - static void OnFailureCallback_19(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_19(status); - } - - static void OnSuccessCallback_19(void * context, chip::CharSpan uniqueID) - { - (static_cast(context))->OnSuccessResponse_19(uniqueID); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestQueryInteractionModelVersion_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint16_t interactionModelVersion) - { - VerifyOrReturn(CheckConstraintType("interactionModelVersion", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestQueryVendorName_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(chip::CharSpan vendorName) - { - VerifyOrReturn(CheckConstraintType("vendorName", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("vendorName", vendorName.size(), 32)); - - NextTest(); - } - - CHIP_ERROR TestQueryVendorID_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(uint16_t vendorID) - { - VerifyOrReturn(CheckConstraintType("vendorID", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestQueryProductName_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(chip::CharSpan productName) - { - VerifyOrReturn(CheckConstraintType("productName", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("productName", productName.size(), 32)); - - NextTest(); - } - - CHIP_ERROR TestQueryProductID_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(uint16_t productID) - { - VerifyOrReturn(CheckConstraintType("productID", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestQueryNodeLabel_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(chip::CharSpan nodeLabel) - { - VerifyOrReturn(CheckConstraintType("nodeLabel", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("nodeLabel", nodeLabel.size(), 32)); - - NextTest(); - } - - CHIP_ERROR TestQueryUserLocation_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(chip::CharSpan location) - { - VerifyOrReturn(CheckConstraintType("location", "", "string")); - VerifyOrReturn(CheckConstraintFormat("location", "", "ISO 3166-1 alpha-2")); - VerifyOrReturn(CheckConstraintMaxLength("location", location.size(), 2)); - - NextTest(); - } - - CHIP_ERROR TestQueryHardwareVersion_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8(uint16_t hardwareVersion) - { - VerifyOrReturn(CheckConstraintType("hardwareVersion", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestQueryHardwareVersionString_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9(chip::CharSpan hardwareVersionString) - { - VerifyOrReturn(CheckConstraintType("hardwareVersionString", "", "string")); - VerifyOrReturn(CheckConstraintMinLength("hardwareVersionString", hardwareVersionString.size(), 1)); - VerifyOrReturn(CheckConstraintMaxLength("hardwareVersionString", hardwareVersionString.size(), 64)); - - NextTest(); - } - - CHIP_ERROR TestQuerySoftwareVersion_10() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_10, OnFailureCallback_10)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10(uint32_t softwareVersion) - { - VerifyOrReturn(CheckConstraintType("softwareVersion", "", "uint32")); - - NextTest(); - } - - CHIP_ERROR TestQuerySoftwareVersionString_11() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_11, OnFailureCallback_11)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_11(chip::CharSpan softwareVersionString) - { - VerifyOrReturn(CheckConstraintType("softwareVersionString", "", "string")); - VerifyOrReturn(CheckConstraintFormat("softwareVersionString", "", "ASCII")); - VerifyOrReturn(CheckConstraintMinLength("softwareVersionString", softwareVersionString.size(), 1)); - VerifyOrReturn(CheckConstraintMaxLength("softwareVersionString", softwareVersionString.size(), 64)); - - NextTest(); - } - - CHIP_ERROR TestQueryManufacturingDate_12() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_12, OnFailureCallback_12)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_12(EmberAfStatus status) - { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); - } - - void OnSuccessResponse_12(chip::CharSpan manufacturingDate) - { - VerifyOrReturn(CheckConstraintType("manufacturingDate", "", "string")); - VerifyOrReturn(CheckConstraintFormat("manufacturingDate", "", "ISO 8601")); - VerifyOrReturn(CheckConstraintMinLength("manufacturingDate", manufacturingDate.size(), 8)); - VerifyOrReturn(CheckConstraintMaxLength("manufacturingDate", manufacturingDate.size(), 16)); - - NextTest(); - } - - CHIP_ERROR TestQueryPartNumber_13() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_13, OnFailureCallback_13)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_13(EmberAfStatus status) - { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); - } - - void OnSuccessResponse_13(chip::CharSpan partNumber) - { - VerifyOrReturn(CheckConstraintType("partNumber", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("partNumber", partNumber.size(), 32)); - - NextTest(); - } - - CHIP_ERROR TestQueryProductURL_14() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_14, OnFailureCallback_14)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_14(EmberAfStatus status) - { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); - } - - void OnSuccessResponse_14(chip::CharSpan productURL) - { - VerifyOrReturn(CheckConstraintType("productURL", "", "string")); - VerifyOrReturn(CheckConstraintFormat("productURL", "", "RFC3986")); - VerifyOrReturn(CheckConstraintMaxLength("productURL", productURL.size(), 256)); - - NextTest(); - } - - CHIP_ERROR TestQueryProductLabel_15() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_15, OnFailureCallback_15)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_15(EmberAfStatus status) - { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); - } - - void OnSuccessResponse_15(chip::CharSpan productLabel) - { - VerifyOrReturn(CheckConstraintType("productLabel", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("productLabel", productLabel.size(), 64)); - - NextTest(); - } - - CHIP_ERROR TestQuerySerialNumber_16() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_16, OnFailureCallback_16)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_16(EmberAfStatus status) - { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); - } - - void OnSuccessResponse_16(chip::CharSpan serialNumber) - { - VerifyOrReturn(CheckConstraintType("serialNumber", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("serialNumber", serialNumber.size(), 32)); - - NextTest(); - } - - CHIP_ERROR TestQueryLocalConfigDisabled_17() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_17, OnFailureCallback_17)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_17(EmberAfStatus status) - { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); - } - - void OnSuccessResponse_17(bool localConfigDisabled) - { - VerifyOrReturn(CheckConstraintType("localConfigDisabled", "", "boolean")); - - NextTest(); - } - - CHIP_ERROR TestQueryReachable_18() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_18, OnFailureCallback_18)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_18(EmberAfStatus status) - { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); - } - - void OnSuccessResponse_18(bool reachable) - { - VerifyOrReturn(CheckConstraintType("reachable", "", "boolean")); - - NextTest(); - } - - CHIP_ERROR TestQueryUniqueID_19() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_19, OnFailureCallback_19)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_19(EmberAfStatus status) - { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); - } - - void OnSuccessResponse_19(chip::CharSpan uniqueID) - { - VerifyOrReturn(CheckConstraintType("uniqueID", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("uniqueID", uniqueID.size(), 32)); - - NextTest(); - } -}; - -class Test_TC_DM_3_1 : public TestCommand -{ -public: - Test_TC_DM_3_1() : TestCommand("Test_TC_DM_3_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DM_3_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DM_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; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } -}; - -class Test_TC_DM_2_2 : public TestCommand -{ -public: - Test_TC_DM_2_2() : TestCommand("Test_TC_DM_2_2"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DM_2_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DM_2_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 : Query fabrics list\n"); - err = TestQueryFabricsList_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Query Supported Fabrics\n"); - err = TestQuerySupportedFabrics_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Query Commissioned Fabrics\n"); - err = TestQueryCommissionedFabrics_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Query User Trusted Root Certificates\n"); - err = TestQueryUserTrustedRootCertificates_4(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void - OnSuccessCallback_1(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & fabricsList) - { - (static_cast(context))->OnSuccessResponse_1(fabricsList); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint8_t supportedFabrics) - { - (static_cast(context))->OnSuccessResponse_2(supportedFabrics); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, uint8_t commissionedFabrics) - { - (static_cast(context))->OnSuccessResponse_3(commissionedFabrics); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, - const chip::app::DataModel::DecodableList & trustedRootCertificates) - { - (static_cast(context))->OnSuccessResponse_4(trustedRootCertificates); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestQueryFabricsList_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::OperationalCredentialsClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(const chip::app::DataModel::DecodableList< - chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & fabricsList) - { - auto iter = fabricsList.begin(); - VerifyOrReturn(CheckNextListItemDecodes("fabricsList", iter, 0)); - VerifyOrReturn(CheckNoMoreListItems("fabricsList", iter, 1)); - - NextTest(); - } - - CHIP_ERROR TestQuerySupportedFabrics_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::OperationalCredentialsClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint8_t supportedFabrics) - { - VerifyOrReturn(CheckValue("supportedFabrics", supportedFabrics, 16)); - - NextTest(); - } - - CHIP_ERROR TestQueryCommissionedFabrics_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::OperationalCredentialsClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(uint8_t commissionedFabrics) - { - VerifyOrReturn(CheckValue("commissionedFabrics", commissionedFabrics, 1)); - - NextTest(); - } - - CHIP_ERROR TestQueryUserTrustedRootCertificates_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::OperationalCredentialsClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(const chip::app::DataModel::DecodableList & trustedRootCertificates) - { - VerifyOrReturn(CheckConstraintType("trustedRootCertificates", "", "list")); - - NextTest(); - } -}; - -class Test_TC_EMR_1_1 : public TestCommand -{ -public: - Test_TC_EMR_1_1() : TestCommand("Test_TC_EMR_1_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_EMR_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_EMR_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 : 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; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_2(clusterRevision); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_4(clusterRevision); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ElectricalMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 3U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ElectricalMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint16_t clusterRevision) - { - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ElectricalMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 1U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_3() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ElectricalMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 3U)); - - NextTest(); - } -}; - -class Test_TC_FLW_1_1 : public TestCommand -{ -public: - Test_TC_FLW_1_1() : TestCommand("Test_TC_FLW_1_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_FLW_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FLW_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 constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); - break; - case 2: - ChipLogProgress(chipTool, - " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint16_t clusterRevision) - { - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 2U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_2() { ThrowSuccessResponse(); } -}; - -class Test_TC_FLW_2_1 : public TestCommand -{ -public: - Test_TC_FLW_2_1() : TestCommand("Test_TC_FLW_2_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_FLW_2_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FLW_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 : read the mandatory attribute: MeasuredValue\n"); - err = TestReadTheMandatoryAttributeMeasuredValue_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: MinMeasuredValue\n"); - err = TestReadTheMandatoryAttributeMinMeasuredValue_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : read the mandatory attribute: MaxMeasuredValue\n"); - err = TestReadTheMandatoryAttributeMaxMeasuredValue_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : write the default value to optional attribute: MinMeasuredValue\n"); - err = TestWriteTheDefaultValueToOptionalAttributeMinMeasuredValue_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : write the default value to optional attribute: MaxMeasuredValue\n"); - err = TestWriteTheDefaultValueToOptionalAttributeMaxMeasuredValue_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : read the mandatory attribute: MeasuredValue\n"); - err = TestReadTheMandatoryAttributeMeasuredValue_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : read the mandatory attribute: MinMeasuredValue\n"); - err = TestReadTheMandatoryAttributeMinMeasuredValue_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : read the mandatory attribute: MaxMeasuredValue\n"); - err = TestReadTheMandatoryAttributeMaxMeasuredValue_8(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, int16_t measuredValue) - { - (static_cast(context))->OnSuccessResponse_1(measuredValue); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, int16_t minMeasuredValue) - { - (static_cast(context))->OnSuccessResponse_2(minMeasuredValue); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, int16_t maxMeasuredValue) - { - (static_cast(context))->OnSuccessResponse_3(maxMeasuredValue); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, int16_t measuredValue) - { - (static_cast(context))->OnSuccessResponse_6(measuredValue); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, int16_t minMeasuredValue) - { - (static_cast(context))->OnSuccessResponse_7(minMeasuredValue); - } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context, int16_t maxMeasuredValue) - { - (static_cast(context))->OnSuccessResponse_8(maxMeasuredValue); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(int16_t measuredValue) - { - VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeMinMeasuredValue_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(int16_t minMeasuredValue) - { - VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeMaxMeasuredValue_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(int16_t maxMeasuredValue) - { - VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValueToOptionalAttributeMinMeasuredValue_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t minMeasuredValueArgument; - minMeasuredValueArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minMeasuredValueArgument, this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_4() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteTheDefaultValueToOptionalAttributeMaxMeasuredValue_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t maxMeasuredValueArgument; - maxMeasuredValueArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - maxMeasuredValueArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_5() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(int16_t measuredValue) - { - VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeMinMeasuredValue_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(int16_t minMeasuredValue) - { - VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeMaxMeasuredValue_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8(int16_t maxMeasuredValue) - { - VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "uint16")); - - NextTest(); - } -}; - -class Test_TC_FLW_2_2 : public TestCommand -{ -public: - Test_TC_FLW_2_2() : TestCommand("Test_TC_FLW_2_2"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_FLW_2_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FLW_2_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 : read the mandatory attribute: MeasuredValue\n"); - err = TestReadTheMandatoryAttributeMeasuredValue_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: MeasuredValue\n"); - err = TestReadTheMandatoryAttributeMeasuredValue_2(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, int16_t measuredValue) - { - (static_cast(context))->OnSuccessResponse_1(measuredValue); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, int16_t measuredValue) - { - (static_cast(context))->OnSuccessResponse_2(measuredValue); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(int16_t measuredValue) - { - VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(int16_t measuredValue) - { - VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); - - NextTest(); - } -}; - -class Test_TC_ILL_1_1 : public TestCommand -{ -public: - Test_TC_ILL_1_1() : TestCommand("Test_TC_ILL_1_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_ILL_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ILL_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 : 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; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_2(clusterRevision); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_4(clusterRevision); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::IlluminanceMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 2U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::IlluminanceMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint16_t clusterRevision) - { - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::IlluminanceMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 1U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_3() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::IlluminanceMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 2U)); - - NextTest(); - } -}; - -class Test_TC_LVL_1_1 : public TestCommand -{ -public: - Test_TC_LVL_1_1() : TestCommand("Test_TC_LVL_1_1"), mTestIndex(0) {} - - /////////// 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 constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); - break; - case 2: - ChipLogProgress(chipTool, - " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint16_t clusterRevision) - { - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 4U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_2() { ThrowSuccessResponse(); } -}; - -class Test_TC_LVL_2_1 : public TestCommand -{ -public: - Test_TC_LVL_2_1() : TestCommand("Test_TC_LVL_2_1"), mTestIndex(0) {} - - /////////// 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 : reads current Level attribute from DUT\n"); - err = TestReadsCurrentLevelAttributeFromDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : sends a Move to level command\n"); - err = TestSendsAMoveToLevelCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Wait 100ms\n"); - err = TestWait100ms_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : reads current Level attribute from DUT\n"); - err = TestReadsCurrentLevelAttributeFromDut_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : sends a Move to level command\n"); - err = TestSendsAMoveToLevelCommand_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 200ms\n"); - err = TestWait200ms_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : reads current Level attribute from DUT\n"); - err = TestReadsCurrentLevelAttributeFromDut_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : reads On Off Transition Time attribute from DUT\n"); - err = TestReadsOnOffTransitionTimeAttributeFromDut_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : sends a Move to level command\n"); - err = TestSendsAMoveToLevelCommand_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Wait 10ms\n"); - err = TestWait10ms_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : reads current Level attribute from DUT\n"); - err = TestReadsCurrentLevelAttributeFromDut_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Reset level to 0\n"); - err = TestResetLevelTo0_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Wait 100ms\n"); - err = TestWait100ms_13(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 14; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint8_t currentLevel) - { - (static_cast(context))->OnSuccessResponse_1(currentLevel); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint8_t currentLevel) - { - (static_cast(context))->OnSuccessResponse_4(currentLevel); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, uint8_t currentLevel) - { - (static_cast(context))->OnSuccessResponse_7(currentLevel); - } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context, uint16_t onOffTransitionTime) - { - (static_cast(context))->OnSuccessResponse_8(onOffTransitionTime); - } - - static void OnFailureCallback_11(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_11(status); - } - - static void OnSuccessCallback_11(void * context, uint8_t currentLevel) - { - (static_cast(context))->OnSuccessResponse_11(currentLevel); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint8_t currentLevel) - { - VerifyOrReturn(CheckValue("currentLevel", currentLevel, 0)); - - NextTest(); - } - - CHIP_ERROR TestSendsAMoveToLevelCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type; - - RequestType request; - request.level = 64; - request.transitionTime = 0U; - request.optionMask = 1; - request.optionOverride = 1; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_2(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_2(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2() { NextTest(); } - - CHIP_ERROR TestWait100ms_3() - { - SetIdentity(kIdentityAlpha); - return WaitForMs(100); - } - - CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint8_t currentLevel) - { - VerifyOrReturn(CheckValue("currentLevel", currentLevel, 64)); - - NextTest(); - } - - CHIP_ERROR TestSendsAMoveToLevelCommand_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type; - - RequestType request; - request.level = 128; - request.transitionTime = 1U; - request.optionMask = 1; - request.optionOverride = 1; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_5(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestWait200ms_6() - { - SetIdentity(kIdentityAlpha); - return WaitForMs(200); - } - - CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(uint8_t currentLevel) - { - VerifyOrReturn(CheckValue("currentLevel", currentLevel, 128)); - - NextTest(); - } - - CHIP_ERROR TestReadsOnOffTransitionTimeAttributeFromDut_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8(uint16_t onOffTransitionTime) - { - VerifyOrReturn(CheckValue("onOffTransitionTime", onOffTransitionTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestSendsAMoveToLevelCommand_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type; - - RequestType request; - request.level = 254; - request.transitionTime = 65535U; - request.optionMask = 1; - request.optionOverride = 1; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_9(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_9(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9() { NextTest(); } - - CHIP_ERROR TestWait10ms_10() - { - SetIdentity(kIdentityAlpha); - return WaitForMs(10); - } - - CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_11() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_11, OnFailureCallback_11)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_11(uint8_t currentLevel) - { - VerifyOrReturn(CheckValue("currentLevel", currentLevel, 254)); - - NextTest(); - } - - CHIP_ERROR TestResetLevelTo0_12() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type; - - RequestType request; - request.level = 0; - request.transitionTime = 0U; - request.optionMask = 1; - request.optionOverride = 1; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_12(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_12(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_12(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_12() { NextTest(); } - - CHIP_ERROR TestWait100ms_13() - { - SetIdentity(kIdentityAlpha); - return WaitForMs(100); - } -}; - -class Test_TC_LVL_3_1 : public TestCommand -{ -public: - Test_TC_LVL_3_1() : TestCommand("Test_TC_LVL_3_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_3_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_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 : reads current level attribute from DUT\n"); - err = TestReadsCurrentLevelAttributeFromDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : reads max level attribute from DUT\n"); - err = TestReadsMaxLevelAttributeFromDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : sends a Move up command\n"); - err = TestSendsAMoveUpCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Wait 3000ms\n"); - err = TestWait3000ms_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : reads current level attribute from DUT\n"); - err = TestReadsCurrentLevelAttributeFromDut_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : reads min level attribute from DUT\n"); - err = TestReadsMinLevelAttributeFromDut_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : sends a Move down command\n"); - err = TestSendsAMoveDownCommand_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Wait 3000ms\n"); - err = TestWait3000ms_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : reads current level attribute from DUT\n"); - err = TestReadsCurrentLevelAttributeFromDut_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Write default move rate attribute from DUT\n"); - err = TestWriteDefaultMoveRateAttributeFromDut_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : reads default move rate attribute from DUT\n"); - err = TestReadsDefaultMoveRateAttributeFromDut_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : sends a Move up command at default move rate\n"); - err = TestSendsAMoveUpCommandAtDefaultMoveRate_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Wait 100ms\n"); - err = TestWait100ms_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : reads current level attribute from DUT\n"); - err = TestReadsCurrentLevelAttributeFromDut_14(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 15; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint8_t currentLevel) - { - (static_cast(context))->OnSuccessResponse_1(currentLevel); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint8_t maxLevel) - { - (static_cast(context))->OnSuccessResponse_2(maxLevel); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, uint8_t currentLevel) - { - (static_cast(context))->OnSuccessResponse_5(currentLevel); - } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, uint8_t minLevel) - { - (static_cast(context))->OnSuccessResponse_6(minLevel); - } - - static void OnFailureCallback_9(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context, uint8_t currentLevel) - { - (static_cast(context))->OnSuccessResponse_9(currentLevel); - } - - static void OnFailureCallback_10(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_10(status); - } - - static void OnSuccessCallback_10(void * context) { (static_cast(context))->OnSuccessResponse_10(); } - - static void OnFailureCallback_11(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_11(status); - } - - static void OnSuccessCallback_11(void * context, const chip::app::DataModel::Nullable & defaultMoveRate) - { - (static_cast(context))->OnSuccessResponse_11(defaultMoveRate); - } - - static void OnFailureCallback_14(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_14(status); - } - - static void OnSuccessCallback_14(void * context, uint8_t currentLevel) - { - (static_cast(context))->OnSuccessResponse_14(currentLevel); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint8_t currentLevel) - { - VerifyOrReturn(CheckValue("currentLevel", currentLevel, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadsMaxLevelAttributeFromDut_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint8_t maxLevel) - { - VerifyOrReturn(CheckValue("maxLevel", maxLevel, 255)); - - NextTest(); - } - - CHIP_ERROR TestSendsAMoveUpCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::LevelControl::Commands::Move::Type; - - RequestType request; - request.moveMode = static_cast(0); - request.rate = 200; - request.optionMask = 1; - request.optionOverride = 1; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestWait3000ms_4() - { - SetIdentity(kIdentityAlpha); - return WaitForMs(3000); - } - - CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(uint8_t currentLevel) - { - VerifyOrReturn(CheckValue("currentLevel", currentLevel, 255)); - - NextTest(); - } - - CHIP_ERROR TestReadsMinLevelAttributeFromDut_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(uint8_t minLevel) - { - VerifyOrReturn(CheckValue("minLevel", minLevel, 0)); - - NextTest(); - } - - CHIP_ERROR TestSendsAMoveDownCommand_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::LevelControl::Commands::Move::Type; - - RequestType request; - request.moveMode = static_cast(1); - request.rate = 250; - request.optionMask = 1; - request.optionOverride = 1; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_7(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_7(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7() { NextTest(); } - - CHIP_ERROR TestWait3000ms_8() - { - SetIdentity(kIdentityAlpha); - return WaitForMs(3000); - } - - CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9(uint8_t currentLevel) - { - VerifyOrReturn(CheckValue("currentLevel", currentLevel, 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteDefaultMoveRateAttributeFromDut_10() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable defaultMoveRateArgument; - defaultMoveRateArgument.SetNonNull() = 20; - - ReturnErrorOnFailure(cluster.WriteAttribute( - defaultMoveRateArgument, this, OnSuccessCallback_10, OnFailureCallback_10)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10() { NextTest(); } - - CHIP_ERROR TestReadsDefaultMoveRateAttributeFromDut_11() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_11, OnFailureCallback_11)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_11(const chip::app::DataModel::Nullable & defaultMoveRate) - { - VerifyOrReturn(CheckValueNonNull("defaultMoveRate", defaultMoveRate)); - VerifyOrReturn(CheckValue("defaultMoveRate.Value()", defaultMoveRate.Value(), 20)); - - NextTest(); - } - - CHIP_ERROR TestSendsAMoveUpCommandAtDefaultMoveRate_12() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::LevelControl::Commands::Move::Type; - - RequestType request; - request.moveMode = static_cast(1); - request.rate = 255; - request.optionMask = 1; - request.optionOverride = 1; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_12(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_12(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_12(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_12() { NextTest(); } - - CHIP_ERROR TestWait100ms_13() - { - SetIdentity(kIdentityAlpha); - return WaitForMs(100); - } - - CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_14() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_14, OnFailureCallback_14)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_14(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_14(uint8_t currentLevel) - { - VerifyOrReturn(CheckConstraintNotValue("currentLevel", currentLevel, 255)); - - NextTest(); - } -}; - -class Test_TC_LVL_4_1 : public TestCommand -{ -public: - Test_TC_LVL_4_1() : TestCommand("Test_TC_LVL_4_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_4_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_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 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Sending on command\n"); - err = TestSendingOnCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Precondition: DUT level is set to 0x80\n"); - err = TestPreconditionDutLevelIsSetTo0x80_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Wait 3000ms\n"); - err = TestWait3000ms_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads current level attribute from DUT\n"); - err = TestReadsCurrentLevelAttributeFromDut_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Sends step down command to DUT\n"); - err = TestSendsStepDownCommandToDut_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 3000ms\n"); - err = TestWait3000ms_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Reads current level attribute from DUT\n"); - err = TestReadsCurrentLevelAttributeFromDut_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Sends a Step up command\n"); - err = TestSendsAStepUpCommand_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Wait 3000ms\n"); - err = TestWait3000ms_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Reads current level attribute from DUT\n"); - err = TestReadsCurrentLevelAttributeFromDut_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Sending off command\n"); - err = TestSendingOffCommand_11(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 12; - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint8_t currentLevel) - { - (static_cast(context))->OnSuccessResponse_4(currentLevel); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, uint8_t currentLevel) - { - (static_cast(context))->OnSuccessResponse_7(currentLevel); - } - - static void OnFailureCallback_10(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_10(status); - } - - static void OnSuccessCallback_10(void * context, uint8_t currentLevel) - { - (static_cast(context))->OnSuccessResponse_10(currentLevel); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestSendingOnCommand_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestPreconditionDutLevelIsSetTo0x80_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::LevelControl::Commands::Step::Type; - - RequestType request; - request.stepMode = static_cast(0); - request.stepSize = 128; - request.transitionTime = 20U; - request.optionMask = 0; - request.optionOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_2(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_2(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2() { NextTest(); } - - CHIP_ERROR TestWait3000ms_3() - { - SetIdentity(kIdentityAlpha); - return WaitForMs(3000); - } - - CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint8_t currentLevel) - { - VerifyOrReturn(CheckValue("currentLevel", currentLevel, 128)); - - NextTest(); - } - - CHIP_ERROR TestSendsStepDownCommandToDut_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::LevelControl::Commands::Step::Type; - - RequestType request; - request.stepMode = static_cast(1); - request.stepSize = 64; - request.transitionTime = 20U; - request.optionMask = 0; - request.optionOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_5(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestWait3000ms_6() - { - SetIdentity(kIdentityAlpha); - return WaitForMs(3000); - } - - CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(uint8_t currentLevel) - { - VerifyOrReturn(CheckValue("currentLevel", currentLevel, 64)); - - NextTest(); - } - - CHIP_ERROR TestSendsAStepUpCommand_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::LevelControl::Commands::Step::Type; - - RequestType request; - request.stepMode = static_cast(0); - request.stepSize = 64; - request.transitionTime = 20U; - request.optionMask = 0; - request.optionOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_8(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_8(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8() { NextTest(); } - - CHIP_ERROR TestWait3000ms_9() - { - SetIdentity(kIdentityAlpha); - return WaitForMs(3000); - } - - CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_10() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_10, OnFailureCallback_10)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10(uint8_t currentLevel) - { - VerifyOrReturn(CheckValue("currentLevel", currentLevel, 128)); - - NextTest(); - } - - CHIP_ERROR TestSendingOffCommand_11() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_11(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_11(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_11() { NextTest(); } -}; - -class Test_TC_LVL_5_1 : public TestCommand -{ -public: - Test_TC_LVL_5_1() : TestCommand("Test_TC_LVL_5_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_5_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_5_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 : Sending on command\n"); - err = TestSendingOnCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Precondition: DUT level is set to 0x80\n"); - err = TestPreconditionDutLevelIsSetTo0x80_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Wait 3000ms\n"); - err = TestWait3000ms_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Sends a move up command to DUT\n"); - err = TestSendsAMoveUpCommandToDut_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Wait 3000ms\n"); - err = TestWait3000ms_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Sends stop command to DUT\n"); - err = TestSendsStopCommandToDut_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Sending off command\n"); - err = TestSendingOffCommand_7(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestSendingOnCommand_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestPreconditionDutLevelIsSetTo0x80_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::LevelControl::Commands::Step::Type; - - RequestType request; - request.stepMode = static_cast(0); - request.stepSize = 128; - request.transitionTime = 20U; - request.optionMask = 0; - request.optionOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_2(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_2(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2() { NextTest(); } - - CHIP_ERROR TestWait3000ms_3() - { - SetIdentity(kIdentityAlpha); - return WaitForMs(3000); - } - - CHIP_ERROR TestSendsAMoveUpCommandToDut_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::LevelControl::Commands::Move::Type; - - RequestType request; - request.moveMode = static_cast(0); - request.rate = 1; - request.optionMask = 1; - request.optionOverride = 1; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestWait3000ms_5() - { - SetIdentity(kIdentityAlpha); - return WaitForMs(3000); - } - - CHIP_ERROR TestSendsStopCommandToDut_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::LevelControl::Commands::Stop::Type; - - RequestType request; - request.optionMask = 0; - request.optionOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_6(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_6(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6() { NextTest(); } - - CHIP_ERROR TestSendingOffCommand_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_7(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_7(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7() { NextTest(); } -}; - -class Test_TC_MC_1_1 : public TestCommand -{ -public: - Test_TC_MC_1_1() : TestCommand("Test_TC_MC_1_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_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 constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); - break; - case 2: - ChipLogProgress(chipTool, - " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::MediaInputClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint16_t clusterRevision) - { - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::MediaInputClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 1U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_2() { ThrowSuccessResponse(); } -}; - -class Test_TC_MC_2_1 : public TestCommand -{ -public: - Test_TC_MC_2_1() : TestCommand("Test_TC_MC_2_1"), mTestIndex(0) {} - - /////////// 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); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestPutTheDeviceIntoLowPowerMode_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::LowPower::Commands::Sleep::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } -}; - -class Test_TC_MC_3_1 : public TestCommand -{ -public: - Test_TC_MC_3_1() : TestCommand("Test_TC_MC_3_1"), mTestIndex(0) {} - - /////////// 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; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } -}; - -class Test_TC_MC_3_2 : public TestCommand -{ -public: - Test_TC_MC_3_2() : TestCommand("Test_TC_MC_3_2"), mTestIndex(0) {} - - /////////// 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; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } -}; - -class Test_TC_MC_3_3 : public TestCommand -{ -public: - Test_TC_MC_3_3() : TestCommand("Test_TC_MC_3_3"), mTestIndex(0) {} - - /////////// 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; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } -}; - -class Test_TC_MC_3_4 : public TestCommand -{ -public: - Test_TC_MC_3_4() : TestCommand("Test_TC_MC_3_4"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_4\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_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 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } -}; - -class Test_TC_MC_3_5 : public TestCommand -{ -public: - Test_TC_MC_3_5() : TestCommand("Test_TC_MC_3_5"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_5\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_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 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } -}; - -class Test_TC_MC_3_6 : public TestCommand -{ -public: - Test_TC_MC_3_6() : TestCommand("Test_TC_MC_3_6"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_6\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_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; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } -}; - -class Test_TC_MC_3_7 : public TestCommand -{ -public: - Test_TC_MC_3_7() : TestCommand("Test_TC_MC_3_7"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_7\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_7\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; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } -}; - -class Test_TC_MC_3_8 : public TestCommand -{ -public: - Test_TC_MC_3_8() : TestCommand("Test_TC_MC_3_8"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_8\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_8\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; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } -}; - -class Test_TC_MC_3_9 : public TestCommand -{ -public: - Test_TC_MC_3_9() : TestCommand("Test_TC_MC_3_9"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_9\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_9\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; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } -}; - -class Test_TC_MC_3_10 : public TestCommand -{ -public: - Test_TC_MC_3_10() : TestCommand("Test_TC_MC_3_10"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_10\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_10\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; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } -}; - -class Test_TC_MC_3_11 : public TestCommand -{ -public: - Test_TC_MC_3_11() : TestCommand("Test_TC_MC_3_11"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_11\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_11\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; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } -}; - -class Test_TC_OCC_1_1 : public TestCommand -{ -public: - Test_TC_OCC_1_1() : TestCommand("Test_TC_OCC_1_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OCC_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OCC_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 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_2(clusterRevision); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 2U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint16_t clusterRevision) - { - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 2U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_3() { ThrowSuccessResponse(); } -}; - -class Test_TC_OCC_2_1 : public TestCommand -{ -public: - Test_TC_OCC_2_1() : TestCommand("Test_TC_OCC_2_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OCC_2_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OCC_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 : Reads mandatory attribute constrains: Occupancy\n"); - err = TestReadsMandatoryAttributeConstrainsOccupancy_1(); - break; - case 2: - ChipLogProgress(chipTool, - " ***** Test Step 2 : Writes the respective default value to mandatory attribute: Occupancy\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancy_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads back mandatory attribute: Occupancy\n"); - err = TestReadsBackMandatoryAttributeOccupancy_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads mandatory attribute constrains: OccupancySensorType\n"); - err = TestReadsMandatoryAttributeConstrainsOccupancySensorType_4(); - break; - case 5: - ChipLogProgress( - chipTool, " ***** Test Step 5 : Writes the respective default value to mandatory attribute: OccupancySensorType\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancySensorType_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Reads back mandatory attribute: OccupancySensorType\n"); - err = TestReadsBackMandatoryAttributeOccupancySensorType_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Reads mandatory attribute constrains: OccupancySensorTypeBitmap\n"); - err = TestReadsMandatoryAttributeConstrainsOccupancySensorTypeBitmap_7(); - break; - case 8: - ChipLogProgress( - chipTool, - " ***** Test Step 8 : Writes the respective default value to mandatory attribute: OccupancySensorTypeBitmap\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancySensorTypeBitmap_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Reads back mandatory attribute: OccupancySensorTypeBitmap\n"); - err = TestReadsBackMandatoryAttributeOccupancySensorTypeBitmap_9(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint8_t occupancy) - { - (static_cast(context))->OnSuccessResponse_1(occupancy); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, uint8_t occupancy) - { - (static_cast(context))->OnSuccessResponse_3(occupancy); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint8_t occupancySensorType) - { - (static_cast(context))->OnSuccessResponse_4(occupancySensorType); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, uint8_t occupancySensorType) - { - (static_cast(context))->OnSuccessResponse_6(occupancySensorType); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, uint8_t occupancySensorTypeBitmap) - { - (static_cast(context))->OnSuccessResponse_7(occupancySensorTypeBitmap); - } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } - - static void OnFailureCallback_9(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context, uint8_t occupancySensorTypeBitmap) - { - (static_cast(context))->OnSuccessResponse_9(occupancySensorTypeBitmap); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadsMandatoryAttributeConstrainsOccupancy_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint8_t occupancy) - { - VerifyOrReturn(CheckConstraintType("occupancy", "", "map8")); - VerifyOrReturn(CheckConstraintMaxValue("occupancy", occupancy, 1)); - - NextTest(); - } - - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancy_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t occupancyArgument; - occupancyArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupancyArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_2() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackMandatoryAttributeOccupancy_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(uint8_t occupancy) - { - VerifyOrReturn(CheckValue("occupancy", occupancy, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadsMandatoryAttributeConstrainsOccupancySensorType_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint8_t occupancySensorType) - { - VerifyOrReturn(CheckConstraintType("occupancySensorType", "", "enum8")); - VerifyOrReturn(CheckConstraintMaxValue("occupancySensorType", occupancySensorType, 3)); - - NextTest(); - } - - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancySensorType_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t occupancySensorTypeArgument; - occupancySensorTypeArgument = 0; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - occupancySensorTypeArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_5() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackMandatoryAttributeOccupancySensorType_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(uint8_t occupancySensorType) - { - VerifyOrReturn(CheckValue("occupancySensorType", occupancySensorType, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadsMandatoryAttributeConstrainsOccupancySensorTypeBitmap_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(uint8_t occupancySensorTypeBitmap) - { - VerifyOrReturn(CheckConstraintType("occupancySensorTypeBitmap", "", "map8")); - VerifyOrReturn(CheckConstraintMinValue("occupancySensorTypeBitmap", occupancySensorTypeBitmap, 1)); - VerifyOrReturn(CheckConstraintMaxValue("occupancySensorTypeBitmap", occupancySensorTypeBitmap, 7)); - - NextTest(); - } - - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancySensorTypeBitmap_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t occupancySensorTypeBitmapArgument; - occupancySensorTypeBitmapArgument = 1; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - occupancySensorTypeBitmapArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_8() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackMandatoryAttributeOccupancySensorTypeBitmap_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9(uint8_t occupancySensorTypeBitmap) - { - VerifyOrReturn(CheckValue("occupancySensorTypeBitmap", occupancySensorTypeBitmap, 1)); - - NextTest(); - } -}; - -class Test_TC_OCC_2_2 : public TestCommand -{ -public: - Test_TC_OCC_2_2() : TestCommand("Test_TC_OCC_2_2"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OCC_2_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OCC_2_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 : Reads Occupancy attribute from DUT\n"); - err = ShouldSkip("A_OCCUPANCY") ? CHIP_NO_ERROR : TestReadsOccupancyAttributeFromDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads Occupancy attribute from DUT\n"); - err = ShouldSkip("A_OCCUPANCY") ? CHIP_NO_ERROR : TestReadsOccupancyAttributeFromDut_2(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint8_t occupancy) - { - (static_cast(context))->OnSuccessResponse_1(occupancy); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint8_t occupancy) - { - (static_cast(context))->OnSuccessResponse_2(occupancy); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadsOccupancyAttributeFromDut_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint8_t occupancy) - { - VerifyOrReturn(CheckConstraintType("occupancy", "", "map8")); - - NextTest(); - } - - CHIP_ERROR TestReadsOccupancyAttributeFromDut_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint8_t occupancy) - { - VerifyOrReturn(CheckConstraintType("occupancy", "", "map8")); - - NextTest(); - } -}; - -class Test_TC_OO_1_1 : public TestCommand -{ -public: - Test_TC_OO_1_1() : TestCommand("Test_TC_OO_1_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_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 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_3(); - break; - case 4: - ChipLogProgress(chipTool, - " ***** Test Step 4 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : read the optional global attribute: FeatureMap\n"); - 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) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_2(clusterRevision); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_3(clusterRevision); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_5(clusterRevision); - } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, uint32_t featureMap) - { - (static_cast(context))->OnSuccessResponse_6(featureMap); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, uint32_t featureMap) - { - (static_cast(context))->OnSuccessResponse_7(featureMap); - } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } - - static void OnFailureCallback_9(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context, uint32_t featureMap) - { - (static_cast(context))->OnSuccessResponse_9(featureMap); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_1() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 4U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(uint16_t clusterRevision) - { - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 3U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_4() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 4U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(uint32_t featureMap) - { - VerifyOrReturn(CheckValue("featureMap", featureMap, 0UL)); - - NextTest(); - } - - CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(uint32_t featureMap) - { - VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint32_t featureMapArgument; - featureMapArgument = 0UL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - featureMapArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_8() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackOptionalGlobalAttributeFeatureMap_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9(uint32_t featureMap) - { - VerifyOrReturn(CheckValue("featureMap", featureMap, 0UL)); - - NextTest(); - } -}; - -class Test_TC_OO_2_1 : public TestCommand -{ -public: - Test_TC_OO_2_1() : TestCommand("Test_TC_OO_2_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_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 : read the mandatory attribute: OnOff\n"); - err = TestReadTheMandatoryAttributeOnOff_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : reads back mandatory attribute: OnOff\n"); - err = TestReadsBackMandatoryAttributeOnOff_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : read LT attribute: GlobalSceneControl\n"); - err = TestReadLtAttributeGlobalSceneControl_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : read LT attribute: OnTime\n"); - err = TestReadLtAttributeOnTime_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : read LT attribute: OffWaitTime\n"); - err = TestReadLtAttributeOffWaitTime_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : read LT attribute: StartUpOnOff\n"); - err = TestReadLtAttributeStartUpOnOff_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : write the default value to LT attribute: OnTime\n"); - err = TestWriteTheDefaultValueToLtAttributeOnTime_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : write the default value to LT attribute: OffWaitTime\n"); - err = TestWriteTheDefaultValueToLtAttributeOffWaitTime_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : write the default value to LT attribute: StartUpOnOff\n"); - err = TestWriteTheDefaultValueToLtAttributeStartUpOnOff_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : reads back LT attribute: OnTime\n"); - err = TestReadsBackLtAttributeOnTime_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : reads back LT attribute: OffWaitTime\n"); - err = TestReadsBackLtAttributeOffWaitTime_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : reads back LT attribute: StartUpOnOff\n"); - err = TestReadsBackLtAttributeStartUpOnOff_12(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 13; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_1(onOff); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, bool globalSceneControl) - { - (static_cast(context))->OnSuccessResponse_3(globalSceneControl); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint16_t onTime) - { - (static_cast(context))->OnSuccessResponse_4(onTime); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, uint16_t offWaitTime) - { - (static_cast(context))->OnSuccessResponse_5(offWaitTime); - } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, uint8_t startUpOnOff) - { - (static_cast(context))->OnSuccessResponse_6(startUpOnOff); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } - - static void OnFailureCallback_9(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context) { (static_cast(context))->OnSuccessResponse_9(); } - - static void OnFailureCallback_10(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_10(status); - } - - static void OnSuccessCallback_10(void * context, uint16_t onTime) - { - (static_cast(context))->OnSuccessResponse_10(onTime); - } - - static void OnFailureCallback_11(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_11(status); - } - - static void OnSuccessCallback_11(void * context, uint16_t offWaitTime) - { - (static_cast(context))->OnSuccessResponse_11(offWaitTime); - } - - static void OnFailureCallback_12(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_12(status); - } - - static void OnSuccessCallback_12(void * context, uint8_t startUpOnOff) - { - (static_cast(context))->OnSuccessResponse_12(startUpOnOff); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeOnOff_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadsBackMandatoryAttributeOnOff_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadLtAttributeGlobalSceneControl_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(bool globalSceneControl) - { - VerifyOrReturn(CheckValue("globalSceneControl", globalSceneControl, 1)); - - NextTest(); - } - - CHIP_ERROR TestReadLtAttributeOnTime_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint16_t onTime) - { - VerifyOrReturn(CheckValue("onTime", onTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadLtAttributeOffWaitTime_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(uint16_t offWaitTime) - { - VerifyOrReturn(CheckValue("offWaitTime", offWaitTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadLtAttributeStartUpOnOff_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(uint8_t startUpOnOff) - { - VerifyOrReturn(CheckValue("startUpOnOff", startUpOnOff, 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValueToLtAttributeOnTime_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t onTimeArgument; - onTimeArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - onTimeArgument, this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7() { NextTest(); } - - CHIP_ERROR TestWriteTheDefaultValueToLtAttributeOffWaitTime_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t offWaitTimeArgument; - offWaitTimeArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - offWaitTimeArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8() { NextTest(); } - - CHIP_ERROR TestWriteTheDefaultValueToLtAttributeStartUpOnOff_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t startUpOnOffArgument; - startUpOnOffArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - startUpOnOffArgument, this, OnSuccessCallback_9, OnFailureCallback_9)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9() { NextTest(); } - - CHIP_ERROR TestReadsBackLtAttributeOnTime_10() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_10, OnFailureCallback_10)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10(uint16_t onTime) - { - VerifyOrReturn(CheckValue("onTime", onTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadsBackLtAttributeOffWaitTime_11() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_11, OnFailureCallback_11)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_11(uint16_t offWaitTime) - { - VerifyOrReturn(CheckValue("offWaitTime", offWaitTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadsBackLtAttributeStartUpOnOff_12() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_12, OnFailureCallback_12)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_12(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_12(uint8_t startUpOnOff) - { - VerifyOrReturn(CheckValue("startUpOnOff", startUpOnOff, 0)); - - NextTest(); - } -}; - -class Test_TC_OO_2_2 : public TestCommand -{ -public: - Test_TC_OO_2_2() : TestCommand("Test_TC_OO_2_2"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_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 Off Command\n"); - err = TestSendOffCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Send On Command\n"); - err = TestSendOnCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Send Off Command\n"); - err = TestSendOffCommand_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Send Toggle Command\n"); - err = TestSendToggleCommand_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Check on/off attribute value is true after toggle command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterToggleCommand_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Send Toggle Command\n"); - err = TestSendToggleCommand_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Check on/off attribute value is false after toggle command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterToggleCommand_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Send On Command\n"); - err = TestSendOnCommand_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Send Off Command\n"); - err = TestSendOffCommand_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_14(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 15; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_4(onOff); - } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_6(onOff); - } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_8(onOff); - } - - static void OnFailureCallback_10(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_10(status); - } - - static void OnSuccessCallback_10(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_10(onOff); - } - - static void OnFailureCallback_12(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_12(status); - } - - static void OnSuccessCallback_12(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_12(onOff); - } - - static void OnFailureCallback_14(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_14(status); - } - - static void OnSuccessCallback_14(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_14(onOff); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestSendOffCommand_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } - - CHIP_ERROR TestSendOnCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestSendOffCommand_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_5(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } - - CHIP_ERROR TestSendToggleCommand_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Toggle::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_7(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_7(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterToggleCommand_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestSendToggleCommand_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Toggle::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_9(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_9(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterToggleCommand_10() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_10, OnFailureCallback_10)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } - - CHIP_ERROR TestSendOnCommand_11() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_11(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_11(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_11() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_12() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_12, OnFailureCallback_12)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_12(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_12(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestSendOffCommand_13() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_13(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_13(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_13(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_13() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_14() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_14, OnFailureCallback_14)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_14(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_14(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } -}; - -class Test_TC_OO_2_3 : public TestCommand -{ -public: - Test_TC_OO_2_3() : TestCommand("Test_TC_OO_2_3"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_3\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_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 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Send On Command\n"); - err = ShouldSkip("CR_ON") ? CHIP_NO_ERROR : TestSendOnCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Wait 1000ms\n"); - err = TestWait1000ms_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads GlobalSceneControl attribute from DUT\n"); - err = ShouldSkip("A_GLOBALSCENECONTROL") ? CHIP_NO_ERROR : TestReadsGlobalSceneControlAttributeFromDut_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Send On Command\n"); - err = ShouldSkip("CR_ON") ? CHIP_NO_ERROR : TestSendOnCommand_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 1000ms\n"); - err = TestWait1000ms_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Reads GlobalSceneControl attribute from DUT\n"); - err = ShouldSkip("A_GLOBALSCENECONTROL") ? CHIP_NO_ERROR : TestReadsGlobalSceneControlAttributeFromDut_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Send On Command\n"); - err = ShouldSkip("CR_ON") ? CHIP_NO_ERROR : TestSendOnCommand_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Wait 1000ms\n"); - err = TestWait1000ms_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Reads GlobalSceneControl attribute from DUT\n"); - err = ShouldSkip("A_GLOBALSCENECONTROL") ? CHIP_NO_ERROR : TestReadsGlobalSceneControlAttributeFromDut_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Reads OnTime attribute from DUT\n"); - err = ShouldSkip("A_ONTIME") ? CHIP_NO_ERROR : TestReadsOnTimeAttributeFromDut_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Reads OffWaitTime attribute from DUT\n"); - err = ShouldSkip("A_OFFWAITTIME") ? CHIP_NO_ERROR : TestReadsOffWaitTimeAttributeFromDut_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Send On Command\n"); - err = ShouldSkip("CR_ON") ? CHIP_NO_ERROR : TestSendOnCommand_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Reads OnTime attribute from DUT\n"); - err = ShouldSkip("A_ONTIME") ? CHIP_NO_ERROR : TestReadsOnTimeAttributeFromDut_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Reads OffWaitTime attribute from DUT\n"); - err = ShouldSkip("A_OFFWAITTIME") ? CHIP_NO_ERROR : TestReadsOffWaitTimeAttributeFromDut_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Send Off Command\n"); - err = ShouldSkip("CR_OFF") ? CHIP_NO_ERROR : TestSendOffCommand_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Reads OnTime attribute from DUT\n"); - err = ShouldSkip("A_ONTIME") ? CHIP_NO_ERROR : TestReadsOnTimeAttributeFromDut_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Reads OnTime attribute from DUT\n"); - err = ShouldSkip("A_ONTIME") ? CHIP_NO_ERROR : TestReadsOnTimeAttributeFromDut_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : Reads OffWaitTime attribute from DUT\n"); - err = ShouldSkip("A_OFFWAITTIME") ? CHIP_NO_ERROR : TestReadsOffWaitTimeAttributeFromDut_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Send On Command\n"); - err = ShouldSkip("CR_ON") ? CHIP_NO_ERROR : TestSendOnCommand_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Reads OnTime attribute from DUT\n"); - err = ShouldSkip("A_ONTIME") ? CHIP_NO_ERROR : TestReadsOnTimeAttributeFromDut_26(); - break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Reads OffWaitTime attribute from DUT\n"); - err = ShouldSkip("A_OFFWAITTIME") ? CHIP_NO_ERROR : TestReadsOffWaitTimeAttributeFromDut_27(); - break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Send Off Command\n"); - err = ShouldSkip("CR_OFF") ? CHIP_NO_ERROR : TestSendOffCommand_28(); - break; - case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_29(); - break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Reads OnTime attribute from DUT\n"); - err = ShouldSkip("A_ONTIME") ? CHIP_NO_ERROR : TestReadsOnTimeAttributeFromDut_30(); - break; - case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_31(); - break; - case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : Reads OnTime attribute from DUT\n"); - err = ShouldSkip("A_ONTIME") ? CHIP_NO_ERROR : TestReadsOnTimeAttributeFromDut_32(); - break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : Send On Command\n"); - err = ShouldSkip("CR_ON") ? CHIP_NO_ERROR : TestSendOnCommand_33(); - break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_34(); - break; - case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : Reads OnTime attribute from DUT\n"); - err = ShouldSkip("A_ONTIME") ? CHIP_NO_ERROR : TestReadsOnTimeAttributeFromDut_35(); - break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : Reads OffWaitTime attribute from DUT\n"); - err = ShouldSkip("A_OFFWAITTIME") ? CHIP_NO_ERROR : TestReadsOffWaitTimeAttributeFromDut_36(); - break; - case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : Send Off Command\n"); - err = ShouldSkip("CR_OFF") ? CHIP_NO_ERROR : TestSendOffCommand_37(); - break; - case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_38(); - break; - case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : Reads OnTime attribute from DUT\n"); - err = ShouldSkip("A_ONTIME") ? CHIP_NO_ERROR : TestReadsOnTimeAttributeFromDut_39(); - break; - case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_40(); - break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : Reads OnTime attribute from DUT\n"); - err = ShouldSkip("A_ONTIME") ? CHIP_NO_ERROR : TestReadsOnTimeAttributeFromDut_41(); - break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : Reads OffWaitTime attribute from DUT\n"); - err = ShouldSkip("A_OFFWAITTIME") ? CHIP_NO_ERROR : TestReadsOffWaitTimeAttributeFromDut_42(); - break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_43(); - break; - case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : Reads OnTime attribute from DUT\n"); - err = ShouldSkip("A_ONTIME") ? CHIP_NO_ERROR : TestReadsOnTimeAttributeFromDut_44(); - break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Reads OffWaitTime attribute from DUT\n"); - err = ShouldSkip("A_OFFWAITTIME") ? CHIP_NO_ERROR : TestReadsOffWaitTimeAttributeFromDut_45(); - break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : Send Off Command\n"); - err = ShouldSkip("CR_OFF") ? CHIP_NO_ERROR : TestSendOffCommand_46(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 47; - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_3(onOff); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, bool globalSceneControl) - { - (static_cast(context))->OnSuccessResponse_4(globalSceneControl); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_7(onOff); - } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context, bool globalSceneControl) - { - (static_cast(context))->OnSuccessResponse_8(globalSceneControl); - } - - static void OnFailureCallback_11(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_11(status); - } - - static void OnSuccessCallback_11(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_11(onOff); - } - - static void OnFailureCallback_12(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_12(status); - } - - static void OnSuccessCallback_12(void * context, bool globalSceneControl) - { - (static_cast(context))->OnSuccessResponse_12(globalSceneControl); - } - - static void OnFailureCallback_13(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_13(status); - } - - static void OnSuccessCallback_13(void * context, uint16_t onTime) - { - (static_cast(context))->OnSuccessResponse_13(onTime); - } - - static void OnFailureCallback_14(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_14(status); - } - - static void OnSuccessCallback_14(void * context, uint16_t offWaitTime) - { - (static_cast(context))->OnSuccessResponse_14(offWaitTime); - } - - static void OnFailureCallback_16(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_16(status); - } - - static void OnSuccessCallback_16(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_16(onOff); - } - - static void OnFailureCallback_17(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_17(status); - } - - static void OnSuccessCallback_17(void * context, uint16_t onTime) - { - (static_cast(context))->OnSuccessResponse_17(onTime); - } - - static void OnFailureCallback_18(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_18(status); - } - - static void OnSuccessCallback_18(void * context, uint16_t offWaitTime) - { - (static_cast(context))->OnSuccessResponse_18(offWaitTime); - } - - static void OnFailureCallback_20(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_20(status); - } - - static void OnSuccessCallback_20(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_20(onOff); - } - - static void OnFailureCallback_21(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_21(status); - } - - static void OnSuccessCallback_21(void * context, uint16_t onTime) - { - (static_cast(context))->OnSuccessResponse_21(onTime); - } - - static void OnFailureCallback_22(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_22(status); - } - - static void OnSuccessCallback_22(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_22(onOff); - } - - static void OnFailureCallback_23(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_23(status); - } - - static void OnSuccessCallback_23(void * context, uint16_t onTime) - { - (static_cast(context))->OnSuccessResponse_23(onTime); - } - - static void OnFailureCallback_24(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_24(status); - } - - static void OnSuccessCallback_24(void * context, uint16_t offWaitTime) - { - (static_cast(context))->OnSuccessResponse_24(offWaitTime); - } - - static void OnFailureCallback_26(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_26(status); - } - - static void OnSuccessCallback_26(void * context, uint16_t onTime) - { - (static_cast(context))->OnSuccessResponse_26(onTime); - } - - static void OnFailureCallback_27(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_27(status); - } - - static void OnSuccessCallback_27(void * context, uint16_t offWaitTime) - { - (static_cast(context))->OnSuccessResponse_27(offWaitTime); - } - - static void OnFailureCallback_29(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_29(status); - } - - static void OnSuccessCallback_29(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_29(onOff); - } - - static void OnFailureCallback_30(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_30(status); - } - - static void OnSuccessCallback_30(void * context, uint16_t onTime) - { - (static_cast(context))->OnSuccessResponse_30(onTime); - } - - static void OnFailureCallback_31(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_31(status); - } - - static void OnSuccessCallback_31(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_31(onOff); - } - - static void OnFailureCallback_32(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_32(status); - } - - static void OnSuccessCallback_32(void * context, uint16_t onTime) - { - (static_cast(context))->OnSuccessResponse_32(onTime); - } - - static void OnFailureCallback_34(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_34(status); - } - - static void OnSuccessCallback_34(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_34(onOff); - } - - static void OnFailureCallback_35(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_35(status); - } - - static void OnSuccessCallback_35(void * context, uint16_t onTime) - { - (static_cast(context))->OnSuccessResponse_35(onTime); - } - - static void OnFailureCallback_36(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_36(status); - } - - static void OnSuccessCallback_36(void * context, uint16_t offWaitTime) - { - (static_cast(context))->OnSuccessResponse_36(offWaitTime); - } - - static void OnFailureCallback_38(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_38(status); - } - - static void OnSuccessCallback_38(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_38(onOff); - } - - static void OnFailureCallback_39(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_39(status); - } - - static void OnSuccessCallback_39(void * context, uint16_t onTime) - { - (static_cast(context))->OnSuccessResponse_39(onTime); - } - - static void OnFailureCallback_40(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_40(status); - } - - static void OnSuccessCallback_40(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_40(onOff); - } - - static void OnFailureCallback_41(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_41(status); - } - - static void OnSuccessCallback_41(void * context, uint16_t onTime) - { - (static_cast(context))->OnSuccessResponse_41(onTime); - } - - static void OnFailureCallback_42(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_42(status); - } - - static void OnSuccessCallback_42(void * context, uint16_t offWaitTime) - { - (static_cast(context))->OnSuccessResponse_42(offWaitTime); - } - - static void OnFailureCallback_43(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_43(status); - } - - static void OnSuccessCallback_43(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_43(onOff); - } - - static void OnFailureCallback_44(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_44(status); - } - - static void OnSuccessCallback_44(void * context, uint16_t onTime) - { - (static_cast(context))->OnSuccessResponse_44(onTime); - } - - static void OnFailureCallback_45(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_45(status); - } - - static void OnSuccessCallback_45(void * context, uint16_t offWaitTime) - { - (static_cast(context))->OnSuccessResponse_45(offWaitTime); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestSendOnCommand_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestWait1000ms_2() - { - SetIdentity(kIdentityAlpha); - return WaitForMs(1000); - } - - CHIP_ERROR TestReadsOnOffAttributeFromDut_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestReadsGlobalSceneControlAttributeFromDut_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(bool globalSceneControl) - { - VerifyOrReturn(CheckValue("globalSceneControl", globalSceneControl, 1)); - - NextTest(); - } - - CHIP_ERROR TestSendOnCommand_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_5(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestWait1000ms_6() - { - SetIdentity(kIdentityAlpha); - return WaitForMs(1000); - } - - CHIP_ERROR TestReadsOnOffAttributeFromDut_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestReadsGlobalSceneControlAttributeFromDut_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8(bool globalSceneControl) - { - VerifyOrReturn(CheckValue("globalSceneControl", globalSceneControl, 1)); - - NextTest(); - } - - CHIP_ERROR TestSendOnCommand_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_9(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_9(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9() { NextTest(); } - - CHIP_ERROR TestWait1000ms_10() - { - SetIdentity(kIdentityAlpha); - return WaitForMs(1000); - } - - CHIP_ERROR TestReadsOnOffAttributeFromDut_11() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_11, OnFailureCallback_11)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_11(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestReadsGlobalSceneControlAttributeFromDut_12() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_12, OnFailureCallback_12)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_12(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_12(bool globalSceneControl) - { - VerifyOrReturn(CheckValue("globalSceneControl", globalSceneControl, 1)); - - NextTest(); - } - - CHIP_ERROR TestReadsOnTimeAttributeFromDut_13() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_13, OnFailureCallback_13)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_13(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_13(uint16_t onTime) - { - VerifyOrReturn(CheckValue("onTime", onTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_14() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_14, OnFailureCallback_14)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_14(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_14(uint16_t offWaitTime) - { - VerifyOrReturn(CheckValue("offWaitTime", offWaitTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestSendOnCommand_15() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_15(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_15(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_15(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_15() { NextTest(); } - - CHIP_ERROR TestReadsOnOffAttributeFromDut_16() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_16, OnFailureCallback_16)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_16(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_16(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestReadsOnTimeAttributeFromDut_17() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_17, OnFailureCallback_17)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_17(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_17(uint16_t onTime) - { - VerifyOrReturn(CheckValue("onTime", onTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_18() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_18, OnFailureCallback_18)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_18(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_18(uint16_t offWaitTime) - { - VerifyOrReturn(CheckValue("offWaitTime", offWaitTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestSendOffCommand_19() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_19(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_19(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_19(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_19() { NextTest(); } - - CHIP_ERROR TestReadsOnOffAttributeFromDut_20() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_20, OnFailureCallback_20)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_20(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_20(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadsOnTimeAttributeFromDut_21() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_21, OnFailureCallback_21)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_21(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_21(uint16_t onTime) - { - VerifyOrReturn(CheckValue("onTime", onTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadsOnOffAttributeFromDut_22() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_22, OnFailureCallback_22)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_22(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_22(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadsOnTimeAttributeFromDut_23() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_23, OnFailureCallback_23)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_23(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_23(uint16_t onTime) - { - VerifyOrReturn(CheckValue("onTime", onTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_24() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_24, OnFailureCallback_24)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_24(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_24(uint16_t offWaitTime) - { - VerifyOrReturn(CheckValue("offWaitTime", offWaitTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestSendOnCommand_25() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_25(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_25(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_25(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_25() { NextTest(); } - - CHIP_ERROR TestReadsOnTimeAttributeFromDut_26() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_26, OnFailureCallback_26)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_26(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_26(uint16_t onTime) - { - VerifyOrReturn(CheckValue("onTime", onTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_27() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_27, OnFailureCallback_27)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_27(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_27(uint16_t offWaitTime) - { - VerifyOrReturn(CheckValue("offWaitTime", offWaitTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestSendOffCommand_28() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_28(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_28(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_28(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_28() { NextTest(); } - - CHIP_ERROR TestReadsOnOffAttributeFromDut_29() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_29, OnFailureCallback_29)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_29(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_29(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadsOnTimeAttributeFromDut_30() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_30, OnFailureCallback_30)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_30(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_30(uint16_t onTime) - { - VerifyOrReturn(CheckValue("onTime", onTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadsOnOffAttributeFromDut_31() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_31, OnFailureCallback_31)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_31(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_31(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadsOnTimeAttributeFromDut_32() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_32, OnFailureCallback_32)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_32(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_32(uint16_t onTime) - { - VerifyOrReturn(CheckValue("onTime", onTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestSendOnCommand_33() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_33(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_33(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_33(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_33() { NextTest(); } - - CHIP_ERROR TestReadsOnOffAttributeFromDut_34() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_34, OnFailureCallback_34)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_34(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_34(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - - NextTest(); - } - - CHIP_ERROR TestReadsOnTimeAttributeFromDut_35() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_35, OnFailureCallback_35)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_35(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_35(uint16_t onTime) - { - VerifyOrReturn(CheckValue("onTime", onTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_36() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_36, OnFailureCallback_36)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_36(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_36(uint16_t offWaitTime) - { - VerifyOrReturn(CheckValue("offWaitTime", offWaitTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestSendOffCommand_37() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_37(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_37(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_37(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_37() { NextTest(); } - - CHIP_ERROR TestReadsOnOffAttributeFromDut_38() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_38, OnFailureCallback_38)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_38(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_38(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadsOnTimeAttributeFromDut_39() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_39, OnFailureCallback_39)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_39(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_39(uint16_t onTime) - { - VerifyOrReturn(CheckValue("onTime", onTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadsOnOffAttributeFromDut_40() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_40, OnFailureCallback_40)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_40(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_40(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadsOnTimeAttributeFromDut_41() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_41, OnFailureCallback_41)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_41(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_41(uint16_t onTime) - { - VerifyOrReturn(CheckValue("onTime", onTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_42() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_42, OnFailureCallback_42)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_42(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_42(uint16_t offWaitTime) - { - VerifyOrReturn(CheckValue("offWaitTime", offWaitTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadsOnOffAttributeFromDut_43() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_43, OnFailureCallback_43)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_43(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_43(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadsOnTimeAttributeFromDut_44() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_44, OnFailureCallback_44)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_44(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_44(uint16_t onTime) - { - VerifyOrReturn(CheckValue("onTime", onTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_45() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_45, OnFailureCallback_45)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_45(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_45(uint16_t offWaitTime) - { - VerifyOrReturn(CheckValue("offWaitTime", offWaitTime, 0U)); - - NextTest(); - } - - CHIP_ERROR TestSendOffCommand_46() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_46(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_46(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_46(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_46() { NextTest(); } -}; - -class Test_TC_PRS_1_1 : public TestCommand -{ -public: - Test_TC_PRS_1_1() : TestCommand("Test_TC_PRS_1_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PRS_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PRS_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 constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); - break; - case 2: - ChipLogProgress(chipTool, - " ***** Test Step 2 : Write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint16_t clusterRevision) - { - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 3U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_2() { ThrowSuccessResponse(); } -}; - -class Test_TC_PRS_2_1 : public TestCommand -{ -public: - Test_TC_PRS_2_1() : TestCommand("Test_TC_PRS_2_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PRS_2_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PRS_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 : Read the mandatory attribute constraints: MeasuredValue\n"); - err = TestReadTheMandatoryAttributeConstraintsMeasuredValue_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Write the default values to mandatory attribute: MeasuredValue\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeMeasuredValue_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads back mandatory attribute: MeasuredValue\n"); - err = TestReadsBackMandatoryAttributeMeasuredValue_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the mandatory attribute constraints: MinMeasuredValue\n"); - err = TestReadTheMandatoryAttributeConstraintsMinMeasuredValue_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Write the default values to mandatory attribute: MinMeasuredValue\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeMinMeasuredValue_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Reads back mandatory attribute: MinMeasuredValue\n"); - err = TestReadsBackMandatoryAttributeMinMeasuredValue_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the mandatory attribute constraints: MaxMeasuredValue\n"); - err = TestReadTheMandatoryAttributeConstraintsMaxMeasuredValue_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Write the default values to mandatory attribute: MaxMeasuredValue\n"); - err = TestWriteTheDefaultValuesToMandatoryAttributeMaxMeasuredValue_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Reads back mandatory attribute: MaxMeasuredValue\n"); - err = TestReadsBackMandatoryAttributeMaxMeasuredValue_9(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, int16_t measuredValue) - { - (static_cast(context))->OnSuccessResponse_1(measuredValue); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, int16_t measuredValue) - { - (static_cast(context))->OnSuccessResponse_3(measuredValue); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, int16_t minMeasuredValue) - { - (static_cast(context))->OnSuccessResponse_4(minMeasuredValue); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, int16_t minMeasuredValue) - { - (static_cast(context))->OnSuccessResponse_6(minMeasuredValue); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, int16_t maxMeasuredValue) - { - (static_cast(context))->OnSuccessResponse_7(maxMeasuredValue); - } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } - - static void OnFailureCallback_9(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context, int16_t maxMeasuredValue) - { - (static_cast(context))->OnSuccessResponse_9(maxMeasuredValue); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMeasuredValue_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(int16_t measuredValue) - { - VerifyOrReturn(CheckConstraintType("measuredValue", "", "int16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeMeasuredValue_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t measuredValueArgument; - measuredValueArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - measuredValueArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_2() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackMandatoryAttributeMeasuredValue_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(int16_t measuredValue) - { - VerifyOrReturn(CheckValue("measuredValue", measuredValue, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMinMeasuredValue_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(int16_t minMeasuredValue) - { - VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "int16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeMinMeasuredValue_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t minMeasuredValueArgument; - minMeasuredValueArgument = 0; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - minMeasuredValueArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_5() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackMandatoryAttributeMinMeasuredValue_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(int16_t minMeasuredValue) - { - VerifyOrReturn(CheckValue("minMeasuredValue", minMeasuredValue, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMaxMeasuredValue_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(int16_t maxMeasuredValue) - { - VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "int16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeMaxMeasuredValue_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t maxMeasuredValueArgument; - maxMeasuredValueArgument = 0; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - maxMeasuredValueArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_8() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackMandatoryAttributeMaxMeasuredValue_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9(int16_t maxMeasuredValue) - { - VerifyOrReturn(CheckValue("maxMeasuredValue", maxMeasuredValue, 0)); - - NextTest(); - } -}; - -class Test_TC_PCC_1_1 : public TestCommand -{ -public: - Test_TC_PCC_1_1() : TestCommand("Test_TC_PCC_1_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_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 constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); - break; - case 2: - ChipLogProgress(chipTool, - " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : read the optional global attribute: FeatureMap\n"); - err = TestReadTheOptionalGlobalAttributeFeatureMap_3(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, uint32_t featureMap) - { - (static_cast(context))->OnSuccessResponse_3(featureMap); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint16_t clusterRevision) - { - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 3U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_2() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(uint32_t featureMap) - { - VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); - - NextTest(); - } -}; - -class Test_TC_PCC_2_1 : public TestCommand -{ -public: - Test_TC_PCC_2_1() : TestCommand("Test_TC_PCC_2_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_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 : read the mandatory attribute: MaxPressure\n"); - err = TestReadTheMandatoryAttributeMaxPressure_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: EffectiveOperationMode\n"); - err = TestReadTheMandatoryAttributeEffectiveOperationMode_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : read the mandatory attribute: EffectiveControlMode\n"); - err = TestReadTheMandatoryAttributeEffectiveControlMode_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : read the mandatory attribute: Capacity\n"); - err = TestReadTheMandatoryAttributeCapacity_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : read the mandatory attribute: MaxPressure\n"); - err = TestReadTheMandatoryAttributeMaxPressure_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : read the mandatory attribute: EffectiveOperationMode\n"); - err = TestReadTheMandatoryAttributeEffectiveOperationMode_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : read the mandatory attribute: EffectiveControlMode\n"); - err = TestReadTheMandatoryAttributeEffectiveControlMode_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : read the mandatory attribute: Capacity\n"); - err = TestReadTheMandatoryAttributeCapacity_8(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, int16_t maxPressure) - { - (static_cast(context))->OnSuccessResponse_1(maxPressure); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint8_t effectiveOperationMode) - { - (static_cast(context))->OnSuccessResponse_2(effectiveOperationMode); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, uint8_t effectiveControlMode) - { - (static_cast(context))->OnSuccessResponse_3(effectiveControlMode); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, int16_t capacity) - { - (static_cast(context))->OnSuccessResponse_4(capacity); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, int16_t maxPressure) - { - (static_cast(context))->OnSuccessResponse_5(maxPressure); - } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, uint8_t effectiveOperationMode) - { - (static_cast(context))->OnSuccessResponse_6(effectiveOperationMode); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, uint8_t effectiveControlMode) - { - (static_cast(context))->OnSuccessResponse_7(effectiveControlMode); - } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context, int16_t capacity) - { - (static_cast(context))->OnSuccessResponse_8(capacity); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(int16_t maxPressure) - { - VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint8_t effectiveOperationMode) - { - VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(uint8_t effectiveControlMode) - { - VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeCapacity_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(int16_t capacity) - { - VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(int16_t maxPressure) - { - VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(uint8_t effectiveOperationMode) - { - VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(uint8_t effectiveControlMode) - { - VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeCapacity_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8(int16_t capacity) - { - VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); - - NextTest(); - } -}; - -class Test_TC_PCC_2_2 : public TestCommand -{ -public: - Test_TC_PCC_2_2() : TestCommand("Test_TC_PCC_2_2"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_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 : Write 1 to the OperationMode attribute to DUT: OperationMode\n"); - err = ShouldSkip("A_OPERATIONMODE") ? CHIP_NO_ERROR : TestWrite1ToTheOperationModeAttributeToDutOperationMode_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Write 2 to the OperationMode attribute to DUT: OperationMode\n"); - err = ShouldSkip("A_OPERATIONMODE") ? CHIP_NO_ERROR : TestWrite2ToTheOperationModeAttributeToDutOperationMode_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Write 3 to the OperationMode attribute to DUT: OperationMode\n"); - err = ShouldSkip("A_OPERATIONMODE") ? CHIP_NO_ERROR : TestWrite3ToTheOperationModeAttributeToDutOperationMode_3(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestWrite1ToTheOperationModeAttributeToDutOperationMode_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t operationModeArgument; - operationModeArgument = 1; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - operationModeArgument, this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestWrite2ToTheOperationModeAttributeToDutOperationMode_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t operationModeArgument; - operationModeArgument = 2; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - operationModeArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2() { NextTest(); } - - CHIP_ERROR TestWrite3ToTheOperationModeAttributeToDutOperationMode_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t operationModeArgument; - operationModeArgument = 3; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - operationModeArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } -}; - -class Test_TC_PCC_2_3 : public TestCommand -{ -public: - Test_TC_PCC_2_3() : TestCommand("Test_TC_PCC_2_3"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_3\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_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 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Write 0 to the OperationMode attribute to DUT\n"); - err = ShouldSkip("A_OPERATIONMODE") ? CHIP_NO_ERROR : TestWrite0ToTheOperationModeAttributeToDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the attribute: EffectiveOperationMode\n"); - err = ShouldSkip("A_EFFECTIVEOPERATIONMODE") ? CHIP_NO_ERROR : TestReadsTheAttributeEffectiveOperationMode_2(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint8_t effectiveOperationMode) - { - (static_cast(context))->OnSuccessResponse_2(effectiveOperationMode); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestWrite0ToTheOperationModeAttributeToDut_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t operationModeArgument; - operationModeArgument = 0; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - operationModeArgument, this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestReadsTheAttributeEffectiveOperationMode_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint8_t effectiveOperationMode) - { - VerifyOrReturn(CheckValue("effectiveOperationMode", effectiveOperationMode, 0)); - - NextTest(); - } -}; - -class Test_TC_RH_1_1 : public TestCommand -{ -public: - Test_TC_RH_1_1() : TestCommand("Test_TC_RH_1_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_RH_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RH_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 constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); - break; - case 2: - ChipLogProgress(chipTool, - " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::RelativeHumidityMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint16_t clusterRevision) - { - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::RelativeHumidityMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 1U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_2() { ThrowSuccessResponse(); } -}; - -class Test_TC_RH_2_1 : public TestCommand -{ -public: - Test_TC_RH_2_1() : TestCommand("Test_TC_RH_2_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_RH_2_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RH_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 : Reads constraints of attribute: MeasuredValue\n"); - err = TestReadsConstraintsOfAttributeMeasuredValue_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads constraints of attribute: MinMeasuredValue\n"); - err = TestReadsConstraintsOfAttributeMinMeasuredValue_2(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint16_t measuredValue) - { - (static_cast(context))->OnSuccessResponse_1(measuredValue); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint16_t minMeasuredValue) - { - (static_cast(context))->OnSuccessResponse_2(minMeasuredValue); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadsConstraintsOfAttributeMeasuredValue_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::RelativeHumidityMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint16_t measuredValue) - { - VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestReadsConstraintsOfAttributeMinMeasuredValue_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::RelativeHumidityMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint16_t minMeasuredValue) - { - VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", minMeasuredValue, 9999U)); - - NextTest(); - } -}; - -class Test_TC_RH_2_2 : public TestCommand -{ -public: - Test_TC_RH_2_2() : TestCommand("Test_TC_RH_2_2"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_RH_2_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RH_2_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 : Reads MeasuredValue attribute from DUT\n"); - err = ShouldSkip("A_RELATIVEHUMIDITY") ? CHIP_NO_ERROR : TestReadsMeasuredValueAttributeFromDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the mandatory attribute: MeasuredValue\n"); - err = ShouldSkip("A_RELATIVEHUMIDITY") ? CHIP_NO_ERROR : TestReadTheMandatoryAttributeMeasuredValue_2(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint16_t measuredValue) - { - (static_cast(context))->OnSuccessResponse_1(measuredValue); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint16_t measuredValue) - { - (static_cast(context))->OnSuccessResponse_2(measuredValue); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadsMeasuredValueAttributeFromDut_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::RelativeHumidityMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint16_t measuredValue) - { - VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::RelativeHumidityMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint16_t measuredValue) - { - VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); - - NextTest(); - } -}; - -class Test_TC_TM_1_1 : public TestCommand -{ -public: - Test_TC_TM_1_1() : TestCommand("Test_TC_TM_1_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TM_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TM_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 : 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; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_2(clusterRevision); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_4(clusterRevision); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TemperatureMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 3U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TemperatureMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint16_t clusterRevision) - { - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TemperatureMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 3U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_3() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TemperatureMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 3U)); - - NextTest(); - } -}; - -class Test_TC_TM_2_1 : public TestCommand -{ -public: - Test_TC_TM_2_1() : TestCommand("Test_TC_TM_2_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TM_2_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TM_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 : read the mandatory attribute: MeasuredValue\n"); - err = TestReadTheMandatoryAttributeMeasuredValue_1(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, int16_t measuredValue) - { - (static_cast(context))->OnSuccessResponse_1(measuredValue); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TemperatureMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(int16_t measuredValue) - { - VerifyOrReturn(CheckConstraintType("measuredValue", "", "int16")); - - NextTest(); - } -}; - -class Test_TC_TM_2_2 : public TestCommand -{ -public: - Test_TC_TM_2_2() : TestCommand("Test_TC_TM_2_2"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TM_2_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TM_2_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 : Reads MeasuredValue attribute from DUT\n"); - err = ShouldSkip("A_TEMPERATURE") ? CHIP_NO_ERROR : TestReadsMeasuredValueAttributeFromDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the mandatory attribute: MeasuredValue\n"); - err = ShouldSkip("A_TEMPERATURE") ? CHIP_NO_ERROR : TestReadTheMandatoryAttributeMeasuredValue_2(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, int16_t measuredValue) - { - (static_cast(context))->OnSuccessResponse_1(measuredValue); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, int16_t measuredValue) - { - (static_cast(context))->OnSuccessResponse_2(measuredValue); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadsMeasuredValueAttributeFromDut_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TemperatureMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(int16_t measuredValue) - { - VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TemperatureMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(int16_t measuredValue) - { - VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); - - NextTest(); - } -}; - -class Test_TC_TSTAT_1_1 : public TestCommand -{ -public: - Test_TC_TSTAT_1_1() : TestCommand("Test_TC_TSTAT_1_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSTAT_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSTAT_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 constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); - break; - case 2: - ChipLogProgress(chipTool, - " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the optional global attribute constraints: FeatureMap\n"); - err = TestReadTheOptionalGlobalAttributeConstraintsFeatureMap_3(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, uint32_t featureMap) - { - (static_cast(context))->OnSuccessResponse_3(featureMap); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint16_t clusterRevision) - { - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 5U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_2() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadTheOptionalGlobalAttributeConstraintsFeatureMap_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(uint32_t featureMap) - { - VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); - - NextTest(); - } -}; - -class Test_TC_TSTAT_2_1 : public TestCommand -{ -public: - Test_TC_TSTAT_2_1() : TestCommand("Test_TC_TSTAT_2_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSTAT_2_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSTAT_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 : Reads constraints of mandatory attributes from DUT: LocalTemperature\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutLocalTemperature_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads mandatory attributes from DUT: AbsMinHeatSetpointLimit\n"); - err = TestReadsMandatoryAttributesFromDutAbsMinHeatSetpointLimit_2(); - break; - case 3: - ChipLogProgress(chipTool, - " ***** Test Step 3 : Reads constraints of mandatory attributes from DUT: AbsMinHeatSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutAbsMinHeatSetpointLimit_3(); - break; - case 4: - ChipLogProgress(chipTool, - " ***** Test Step 4 : Writes the respective default value to mandatory attributes to DUT: " - "AbsMinHeatSetpointLimit\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMinHeatSetpointLimit_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read back mandatory attributes from DUT: AbsMinHeatSetpointLimit\n"); - err = TestReadBackMandatoryAttributesFromDutAbsMinHeatSetpointLimit_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Reads mandatory attributes from DUT: AbsMaxHeatSetpointLimit\n"); - err = TestReadsMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_6(); - break; - case 7: - ChipLogProgress(chipTool, - " ***** Test Step 7 : Reads constraints of mandatory attributes from DUT: AbsMaxHeatSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_7(); - break; - case 8: - ChipLogProgress(chipTool, - " ***** Test Step 8 : Writes the respective default value to mandatory attributes to DUT: " - "AbsMaxHeatSetpointLimit\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMaxHeatSetpointLimit_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read back mandatory attributes from DUT: AbsMaxHeatSetpointLimit\n"); - err = TestReadBackMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Reads mandatory attributes from DUT: AbsMinCoolSetpointLimit\n"); - err = TestReadsMandatoryAttributesFromDutAbsMinCoolSetpointLimit_10(); - break; - case 11: - ChipLogProgress(chipTool, - " ***** Test Step 11 : Reads constraints of mandatory attributes from DUT: AbsMinCoolSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutAbsMinCoolSetpointLimit_11(); - break; - case 12: - ChipLogProgress(chipTool, - " ***** Test Step 12 : Writes the respective default value to mandatory attributes to DUT: " - "AbsMinCoolSetpointLimit\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMinCoolSetpointLimit_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Read back mandatory attributes from DUT: AbsMinCoolSetpointLimit\n"); - err = TestReadBackMandatoryAttributesFromDutAbsMinCoolSetpointLimit_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Reads mandatory attributes from DUT: AbsMaxCoolSetpointLimit\n"); - err = TestReadsMandatoryAttributesFromDutAbsMaxCoolSetpointLimit_14(); - break; - case 15: - ChipLogProgress(chipTool, - " ***** Test Step 15 : Reads constraints of mandatory attributes from DUT: AbsMaxCoolSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutAbsMaxCoolSetpointLimit_15(); - break; - case 16: - ChipLogProgress(chipTool, - " ***** Test Step 16 : Writes the respective default value to mandatory attributes to DUT: " - "AbsMaxCoolSetpointLimit\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMaxCoolSetpointLimit_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Read back mandatory attributes from DUT: AbsMaxCoolSetpointLimit\n"); - err = TestReadBackMandatoryAttributesFromDutAbsMaxCoolSetpointLimit_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Reads mandatory attributes from DUT: OccupiedCoolingSetpoint\n"); - err = TestReadsMandatoryAttributesFromDutOccupiedCoolingSetpoint_18(); - break; - case 19: - ChipLogProgress(chipTool, - " ***** Test Step 19 : Reads constraints of mandatory attributes from DUT: OccupiedCoolingSetpoint\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedCoolingSetpoint_19(); - break; - case 20: - ChipLogProgress(chipTool, - " ***** Test Step 20 : Writes the respective default value to mandatory attributes to DUT: " - "OccupiedCoolingSetpoint\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutOccupiedCoolingSetpoint_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Read back mandatory attributes from DUT: OccupiedCoolingSetpoint\n"); - err = TestReadBackMandatoryAttributesFromDutOccupiedCoolingSetpoint_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Reads mandatory attributes from DUT: OccupiedHeatingSetpoint\n"); - err = TestReadsMandatoryAttributesFromDutOccupiedHeatingSetpoint_22(); - break; - case 23: - ChipLogProgress(chipTool, - " ***** Test Step 23 : Reads constraints of mandatory attributes from DUT: OccupiedHeatingSetpoint\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedHeatingSetpoint_23(); - break; - case 24: - ChipLogProgress(chipTool, - " ***** Test Step 24 : Writes the respective default value to mandatory attributes to DUT: " - "OccupiedHeatingSetpoint\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutOccupiedHeatingSetpoint_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Read back mandatory attributes from DUT: OccupiedHeatingSetpoint\n"); - err = TestReadBackMandatoryAttributesFromDutOccupiedHeatingSetpoint_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Reads mandatory attributes from DUT: MinHeatSetpointLimit\n"); - err = TestReadsMandatoryAttributesFromDutMinHeatSetpointLimit_26(); - break; - case 27: - ChipLogProgress(chipTool, - " ***** Test Step 27 : Reads constraints of mandatory attributes from DUT: MinHeatSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutMinHeatSetpointLimit_27(); - break; - case 28: - ChipLogProgress( - chipTool, - " ***** Test Step 28 : Writes the respective default value to mandatory attributes to DUT: MinHeatSetpointLimit\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMinHeatSetpointLimit_28(); - break; - case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Read back mandatory attributes from DUT: MinHeatSetpointLimit\n"); - err = TestReadBackMandatoryAttributesFromDutMinHeatSetpointLimit_29(); - break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Reads mandatory attributes from DUT: MaxHeatSetpointLimit\n"); - err = TestReadsMandatoryAttributesFromDutMaxHeatSetpointLimit_30(); - break; - case 31: - ChipLogProgress(chipTool, - " ***** Test Step 31 : Reads constraints of mandatory attributes from DUT: MaxHeatSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutMaxHeatSetpointLimit_31(); - break; - case 32: - ChipLogProgress( - chipTool, - " ***** Test Step 32 : Writes the respective default value to mandatory attributes to DUT: MaxHeatSetpointLimit\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMaxHeatSetpointLimit_32(); - break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : Read back mandatory attributes from DUT: MaxHeatSetpointLimit\n"); - err = TestReadBackMandatoryAttributesFromDutMaxHeatSetpointLimit_33(); - break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : Reads mandatory attributes from DUT: MinCoolSetpointLimit\n"); - err = TestReadsMandatoryAttributesFromDutMinCoolSetpointLimit_34(); - break; - case 35: - ChipLogProgress(chipTool, - " ***** Test Step 35 : Reads constraints of mandatory attributes from DUT: MinCoolSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutMinCoolSetpointLimit_35(); - break; - case 36: - ChipLogProgress( - chipTool, - " ***** Test Step 36 : Writes the respective default value to mandatory attributes to DUT: MinCoolSetpointLimit\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMinCoolSetpointLimit_36(); - break; - case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : Read back mandatory attributes from DUT: MinCoolSetpointLimit\n"); - err = TestReadBackMandatoryAttributesFromDutMinCoolSetpointLimit_37(); - break; - case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : Reads mandatory attributes from DUT: MaxCoolSetpointLimit\n"); - err = TestReadsMandatoryAttributesFromDutMaxCoolSetpointLimit_38(); - break; - case 39: - ChipLogProgress(chipTool, - " ***** Test Step 39 : Reads constraints of mandatory attributes from DUT: MaxCoolSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutMaxCoolSetpointLimit_39(); - break; - case 40: - ChipLogProgress( - chipTool, - " ***** Test Step 40 : Writes the respective default value to mandatory attributes to DUT: MaxCoolSetpointLimit\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMaxCoolSetpointLimit_40(); - break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : Read back mandatory attributes from DUT: MaxCoolSetpointLimit\n"); - err = TestReadBackMandatoryAttributesFromDutMaxCoolSetpointLimit_41(); - break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : Reads mandatory attributes from DUT: ControlSequenceOfOperation\n"); - err = TestReadsMandatoryAttributesFromDutControlSequenceOfOperation_42(); - break; - case 43: - ChipLogProgress( - chipTool, " ***** Test Step 43 : Reads constraints of mandatory attributes from DUT: ControlSequenceOfOperation\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutControlSequenceOfOperation_43(); - break; - case 44: - ChipLogProgress(chipTool, - " ***** Test Step 44 : Writes the respective default value to mandatory attributes to DUT: " - "ControlSequenceOfOperation\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutControlSequenceOfOperation_44(); - break; - case 45: - ChipLogProgress(chipTool, - " ***** Test Step 45 : Read back mandatory attributes from DUT: ControlSequenceOfOperation\n"); - err = TestReadBackMandatoryAttributesFromDutControlSequenceOfOperation_45(); - break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : Reads mandatory attributes from DUT: SystemMode\n"); - err = TestReadsMandatoryAttributesFromDutSystemMode_46(); - break; - case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : Reads constraints of mandatory attributes from DUT: SystemMode\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutSystemMode_47(); - break; - case 48: - ChipLogProgress( - chipTool, " ***** Test Step 48 : Writes the respective default value to mandatory attributes to DUT: SystemMode\n"); - err = TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutSystemMode_48(); - break; - case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : Read back mandatory attributes from DUT: SystemMode\n"); - err = TestReadBackMandatoryAttributesFromDutSystemMode_49(); - break; - case 50: - ChipLogProgress(chipTool, " ***** Test Step 50 : Reads optional attributes from DUT: MinSetpointDeadBand\n"); - err = TestReadsOptionalAttributesFromDutMinSetpointDeadBand_50(); - break; - case 51: - ChipLogProgress(chipTool, - " ***** Test Step 51 : Reads constraints of optional attributes from DUT: MinSetpointDeadBand\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutMinSetpointDeadBand_51(); - break; - case 52: - ChipLogProgress( - chipTool, - " ***** Test Step 52 : Writes the respective default value to optional attributes to DUT: MinSetpointDeadBand\n"); - err = TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutMinSetpointDeadBand_52(); - break; - case 53: - ChipLogProgress(chipTool, " ***** Test Step 53 : Read back optional attributes from DUT: MinSetpointDeadBand\n"); - err = TestReadBackOptionalAttributesFromDutMinSetpointDeadBand_53(); - break; - case 54: - ChipLogProgress(chipTool, " ***** Test Step 54 : Reads constraints of optional attributes from DUT: StartOfWeek\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutStartOfWeek_54(); - break; - case 55: - ChipLogProgress( - chipTool, " ***** Test Step 55 : Writes the respective default value to optional attributes to DUT: StartOfWeek\n"); - err = TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutStartOfWeek_55(); - break; - case 56: - ChipLogProgress(chipTool, " ***** Test Step 56 : Read back optional attributes from DUT: StartOfWeek\n"); - err = TestReadBackOptionalAttributesFromDutStartOfWeek_56(); - break; - case 57: - ChipLogProgress(chipTool, - " ***** Test Step 57 : Reads constraints of optional attributes from DUT: NumberOfWeeklyTransitions\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutNumberOfWeeklyTransitions_57(); - break; - case 58: - ChipLogProgress(chipTool, - " ***** Test Step 58 : Writes the respective default value to optional attributes to DUT: " - "NumberOfWeeklyTransitions\n"); - err = TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutNumberOfWeeklyTransitions_58(); - break; - case 59: - ChipLogProgress(chipTool, - " ***** Test Step 59 : Reads constraints of optional attributes from DUT: NumberOfDailyTransitions\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutNumberOfDailyTransitions_59(); - break; - case 60: - ChipLogProgress(chipTool, - " ***** Test Step 60 : Writes the respective default value to optional attributes to DUT: " - "NumberOfDailyTransitions\n"); - err = TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutNumberOfDailyTransitions_60(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 61; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, int16_t localTemperature) - { - (static_cast(context))->OnSuccessResponse_1(localTemperature); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, int16_t absMinHeatSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_2(absMinHeatSetpointLimit); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, int16_t absMinHeatSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_3(absMinHeatSetpointLimit); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, int16_t absMinHeatSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_5(absMinHeatSetpointLimit); - } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, int16_t absMaxHeatSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_6(absMaxHeatSetpointLimit); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, int16_t absMaxHeatSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_7(absMaxHeatSetpointLimit); - } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } - - static void OnFailureCallback_9(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context, int16_t absMaxHeatSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_9(absMaxHeatSetpointLimit); - } - - static void OnFailureCallback_10(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_10(status); - } - - static void OnSuccessCallback_10(void * context, int16_t absMinCoolSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_10(absMinCoolSetpointLimit); - } - - static void OnFailureCallback_11(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_11(status); - } - - static void OnSuccessCallback_11(void * context, int16_t absMinCoolSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_11(absMinCoolSetpointLimit); - } - - static void OnFailureCallback_12(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_12(status); - } - - static void OnSuccessCallback_12(void * context) { (static_cast(context))->OnSuccessResponse_12(); } - - static void OnFailureCallback_13(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_13(status); - } - - static void OnSuccessCallback_13(void * context, int16_t absMinCoolSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_13(absMinCoolSetpointLimit); - } - - static void OnFailureCallback_14(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_14(status); - } - - static void OnSuccessCallback_14(void * context, int16_t absMaxCoolSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_14(absMaxCoolSetpointLimit); - } - - static void OnFailureCallback_15(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_15(status); - } - - static void OnSuccessCallback_15(void * context, int16_t absMaxCoolSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_15(absMaxCoolSetpointLimit); - } - - static void OnFailureCallback_16(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_16(status); - } - - static void OnSuccessCallback_16(void * context) { (static_cast(context))->OnSuccessResponse_16(); } - - static void OnFailureCallback_17(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_17(status); - } - - static void OnSuccessCallback_17(void * context, int16_t absMaxCoolSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_17(absMaxCoolSetpointLimit); - } - - static void OnFailureCallback_18(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_18(status); - } - - static void OnSuccessCallback_18(void * context, int16_t occupiedCoolingSetpoint) - { - (static_cast(context))->OnSuccessResponse_18(occupiedCoolingSetpoint); - } - - static void OnFailureCallback_19(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_19(status); - } - - static void OnSuccessCallback_19(void * context, int16_t occupiedCoolingSetpoint) - { - (static_cast(context))->OnSuccessResponse_19(occupiedCoolingSetpoint); - } - - static void OnFailureCallback_20(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_20(status); - } - - static void OnSuccessCallback_20(void * context) { (static_cast(context))->OnSuccessResponse_20(); } - - static void OnFailureCallback_21(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_21(status); - } - - static void OnSuccessCallback_21(void * context, int16_t occupiedCoolingSetpoint) - { - (static_cast(context))->OnSuccessResponse_21(occupiedCoolingSetpoint); - } - - static void OnFailureCallback_22(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_22(status); - } - - static void OnSuccessCallback_22(void * context, int16_t occupiedHeatingSetpoint) - { - (static_cast(context))->OnSuccessResponse_22(occupiedHeatingSetpoint); - } - - static void OnFailureCallback_23(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_23(status); - } - - static void OnSuccessCallback_23(void * context, int16_t occupiedHeatingSetpoint) - { - (static_cast(context))->OnSuccessResponse_23(occupiedHeatingSetpoint); - } - - static void OnFailureCallback_24(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_24(status); - } - - static void OnSuccessCallback_24(void * context) { (static_cast(context))->OnSuccessResponse_24(); } - - static void OnFailureCallback_25(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_25(status); - } - - static void OnSuccessCallback_25(void * context, int16_t occupiedHeatingSetpoint) - { - (static_cast(context))->OnSuccessResponse_25(occupiedHeatingSetpoint); - } - - static void OnFailureCallback_26(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_26(status); - } - - static void OnSuccessCallback_26(void * context, int16_t minHeatSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_26(minHeatSetpointLimit); - } - - static void OnFailureCallback_27(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_27(status); - } - - static void OnSuccessCallback_27(void * context, int16_t minHeatSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_27(minHeatSetpointLimit); - } - - static void OnFailureCallback_28(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_28(status); - } - - static void OnSuccessCallback_28(void * context) { (static_cast(context))->OnSuccessResponse_28(); } - - static void OnFailureCallback_29(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_29(status); - } - - static void OnSuccessCallback_29(void * context, int16_t minHeatSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_29(minHeatSetpointLimit); - } - - static void OnFailureCallback_30(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_30(status); - } - - static void OnSuccessCallback_30(void * context, int16_t maxHeatSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_30(maxHeatSetpointLimit); - } - - static void OnFailureCallback_31(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_31(status); - } - - static void OnSuccessCallback_31(void * context, int16_t maxHeatSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_31(maxHeatSetpointLimit); - } - - static void OnFailureCallback_32(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_32(status); - } - - static void OnSuccessCallback_32(void * context) { (static_cast(context))->OnSuccessResponse_32(); } - - static void OnFailureCallback_33(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_33(status); - } - - static void OnSuccessCallback_33(void * context, int16_t maxHeatSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_33(maxHeatSetpointLimit); - } - - static void OnFailureCallback_34(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_34(status); - } - - static void OnSuccessCallback_34(void * context, int16_t minCoolSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_34(minCoolSetpointLimit); - } - - static void OnFailureCallback_35(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_35(status); - } - - static void OnSuccessCallback_35(void * context, int16_t minCoolSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_35(minCoolSetpointLimit); - } - - static void OnFailureCallback_36(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_36(status); - } - - static void OnSuccessCallback_36(void * context) { (static_cast(context))->OnSuccessResponse_36(); } - - static void OnFailureCallback_37(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_37(status); - } - - static void OnSuccessCallback_37(void * context, int16_t minCoolSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_37(minCoolSetpointLimit); - } - - static void OnFailureCallback_38(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_38(status); - } - - static void OnSuccessCallback_38(void * context, int16_t maxCoolSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_38(maxCoolSetpointLimit); - } - - static void OnFailureCallback_39(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_39(status); - } - - static void OnSuccessCallback_39(void * context, int16_t maxCoolSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_39(maxCoolSetpointLimit); - } - - static void OnFailureCallback_40(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_40(status); - } - - static void OnSuccessCallback_40(void * context) { (static_cast(context))->OnSuccessResponse_40(); } - - static void OnFailureCallback_41(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_41(status); - } - - static void OnSuccessCallback_41(void * context, int16_t maxCoolSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_41(maxCoolSetpointLimit); - } - - static void OnFailureCallback_42(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_42(status); - } - - static void OnSuccessCallback_42(void * context, uint8_t controlSequenceOfOperation) - { - (static_cast(context))->OnSuccessResponse_42(controlSequenceOfOperation); - } - - static void OnFailureCallback_43(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_43(status); - } - - static void OnSuccessCallback_43(void * context, uint8_t controlSequenceOfOperation) - { - (static_cast(context))->OnSuccessResponse_43(controlSequenceOfOperation); - } - - static void OnFailureCallback_44(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_44(status); - } - - static void OnSuccessCallback_44(void * context) { (static_cast(context))->OnSuccessResponse_44(); } - - static void OnFailureCallback_45(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_45(status); - } - - static void OnSuccessCallback_45(void * context, uint8_t controlSequenceOfOperation) - { - (static_cast(context))->OnSuccessResponse_45(controlSequenceOfOperation); - } - - static void OnFailureCallback_46(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_46(status); - } - - static void OnSuccessCallback_46(void * context, uint8_t systemMode) - { - (static_cast(context))->OnSuccessResponse_46(systemMode); - } - - static void OnFailureCallback_47(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_47(status); - } - - static void OnSuccessCallback_47(void * context, uint8_t systemMode) - { - (static_cast(context))->OnSuccessResponse_47(systemMode); - } - - static void OnFailureCallback_48(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_48(status); - } - - static void OnSuccessCallback_48(void * context) { (static_cast(context))->OnSuccessResponse_48(); } - - static void OnFailureCallback_49(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_49(status); - } - - static void OnSuccessCallback_49(void * context, uint8_t systemMode) - { - (static_cast(context))->OnSuccessResponse_49(systemMode); - } - - static void OnFailureCallback_50(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_50(status); - } - - static void OnSuccessCallback_50(void * context, int8_t minSetpointDeadBand) - { - (static_cast(context))->OnSuccessResponse_50(minSetpointDeadBand); - } - - static void OnFailureCallback_51(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_51(status); - } - - static void OnSuccessCallback_51(void * context, int8_t minSetpointDeadBand) - { - (static_cast(context))->OnSuccessResponse_51(minSetpointDeadBand); - } - - static void OnFailureCallback_52(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_52(status); - } - - static void OnSuccessCallback_52(void * context) { (static_cast(context))->OnSuccessResponse_52(); } - - static void OnFailureCallback_53(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_53(status); - } - - static void OnSuccessCallback_53(void * context, int8_t minSetpointDeadBand) - { - (static_cast(context))->OnSuccessResponse_53(minSetpointDeadBand); - } - - static void OnFailureCallback_54(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_54(status); - } - - static void OnSuccessCallback_54(void * context, uint8_t startOfWeek) - { - (static_cast(context))->OnSuccessResponse_54(startOfWeek); - } - - static void OnFailureCallback_55(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_55(status); - } - - static void OnSuccessCallback_55(void * context) { (static_cast(context))->OnSuccessResponse_55(); } - - static void OnFailureCallback_56(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_56(status); - } - - static void OnSuccessCallback_56(void * context, uint8_t startOfWeek) - { - (static_cast(context))->OnSuccessResponse_56(startOfWeek); - } - - static void OnFailureCallback_57(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_57(status); - } - - static void OnSuccessCallback_57(void * context, uint8_t numberOfWeeklyTransitions) - { - (static_cast(context))->OnSuccessResponse_57(numberOfWeeklyTransitions); - } - - static void OnFailureCallback_58(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_58(status); - } - - static void OnSuccessCallback_58(void * context) { (static_cast(context))->OnSuccessResponse_58(); } - - static void OnFailureCallback_59(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_59(status); - } - - static void OnSuccessCallback_59(void * context, uint8_t numberOfDailyTransitions) - { - (static_cast(context))->OnSuccessResponse_59(numberOfDailyTransitions); - } - - static void OnFailureCallback_60(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_60(status); - } - - static void OnSuccessCallback_60(void * context) { (static_cast(context))->OnSuccessResponse_60(); } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutLocalTemperature_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(int16_t localTemperature) - { - VerifyOrReturn(CheckConstraintType("localTemperature", "", "int16")); - - NextTest(); - } - - CHIP_ERROR TestReadsMandatoryAttributesFromDutAbsMinHeatSetpointLimit_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(int16_t absMinHeatSetpointLimit) - { - VerifyOrReturn(CheckValue("absMinHeatSetpointLimit", absMinHeatSetpointLimit, 700)); - - NextTest(); - } - - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutAbsMinHeatSetpointLimit_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(int16_t absMinHeatSetpointLimit) - { - VerifyOrReturn(CheckConstraintType("absMinHeatSetpointLimit", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("absMinHeatSetpointLimit", absMinHeatSetpointLimit, 700)); - VerifyOrReturn(CheckConstraintMaxValue("absMinHeatSetpointLimit", absMinHeatSetpointLimit, 3000)); - - NextTest(); - } - - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMinHeatSetpointLimit_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t absMinHeatSetpointLimitArgument; - absMinHeatSetpointLimitArgument = 700; - - ReturnErrorOnFailure(cluster.WriteAttribute( - absMinHeatSetpointLimitArgument, this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_4() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadBackMandatoryAttributesFromDutAbsMinHeatSetpointLimit_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(int16_t absMinHeatSetpointLimit) - { - VerifyOrReturn(CheckValue("absMinHeatSetpointLimit", absMinHeatSetpointLimit, 700)); - - NextTest(); - } - - CHIP_ERROR TestReadsMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(int16_t absMaxHeatSetpointLimit) - { - VerifyOrReturn(CheckValue("absMaxHeatSetpointLimit", absMaxHeatSetpointLimit, 3000)); - - NextTest(); - } - - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(int16_t absMaxHeatSetpointLimit) - { - VerifyOrReturn(CheckConstraintType("absMaxHeatSetpointLimit", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("absMaxHeatSetpointLimit", absMaxHeatSetpointLimit, 700)); - VerifyOrReturn(CheckConstraintMaxValue("absMaxHeatSetpointLimit", absMaxHeatSetpointLimit, 3000)); - - NextTest(); - } - - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMaxHeatSetpointLimit_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t absMaxHeatSetpointLimitArgument; - absMaxHeatSetpointLimitArgument = 3000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - absMaxHeatSetpointLimitArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_8() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadBackMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9(int16_t absMaxHeatSetpointLimit) - { - VerifyOrReturn(CheckValue("absMaxHeatSetpointLimit", absMaxHeatSetpointLimit, 3000)); - - NextTest(); - } - - CHIP_ERROR TestReadsMandatoryAttributesFromDutAbsMinCoolSetpointLimit_10() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_10, OnFailureCallback_10)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10(int16_t absMinCoolSetpointLimit) - { - VerifyOrReturn(CheckValue("absMinCoolSetpointLimit", absMinCoolSetpointLimit, 1600)); - - NextTest(); - } - - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutAbsMinCoolSetpointLimit_11() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_11, OnFailureCallback_11)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_11(int16_t absMinCoolSetpointLimit) - { - VerifyOrReturn(CheckConstraintType("absMinCoolSetpointLimit", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("absMinCoolSetpointLimit", absMinCoolSetpointLimit, 1600)); - VerifyOrReturn(CheckConstraintMaxValue("absMinCoolSetpointLimit", absMinCoolSetpointLimit, 3200)); - - NextTest(); - } - - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMinCoolSetpointLimit_12() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t absMinCoolSetpointLimitArgument; - absMinCoolSetpointLimitArgument = 1600; - - ReturnErrorOnFailure(cluster.WriteAttribute( - absMinCoolSetpointLimitArgument, this, OnSuccessCallback_12, OnFailureCallback_12)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_12(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_12() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadBackMandatoryAttributesFromDutAbsMinCoolSetpointLimit_13() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_13, OnFailureCallback_13)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_13(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_13(int16_t absMinCoolSetpointLimit) - { - VerifyOrReturn(CheckValue("absMinCoolSetpointLimit", absMinCoolSetpointLimit, 1600)); - - NextTest(); - } - - CHIP_ERROR TestReadsMandatoryAttributesFromDutAbsMaxCoolSetpointLimit_14() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_14, OnFailureCallback_14)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_14(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_14(int16_t absMaxCoolSetpointLimit) - { - VerifyOrReturn(CheckValue("absMaxCoolSetpointLimit", absMaxCoolSetpointLimit, 3200)); - - NextTest(); - } - - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutAbsMaxCoolSetpointLimit_15() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_15, OnFailureCallback_15)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_15(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_15(int16_t absMaxCoolSetpointLimit) - { - VerifyOrReturn(CheckConstraintType("absMaxCoolSetpointLimit", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("absMaxCoolSetpointLimit", absMaxCoolSetpointLimit, 1600)); - VerifyOrReturn(CheckConstraintMaxValue("absMaxCoolSetpointLimit", absMaxCoolSetpointLimit, 3200)); - - NextTest(); - } - - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMaxCoolSetpointLimit_16() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t absMaxCoolSetpointLimitArgument; - absMaxCoolSetpointLimitArgument = 3200; - - ReturnErrorOnFailure(cluster.WriteAttribute( - absMaxCoolSetpointLimitArgument, this, OnSuccessCallback_16, OnFailureCallback_16)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_16(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_16() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadBackMandatoryAttributesFromDutAbsMaxCoolSetpointLimit_17() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_17, OnFailureCallback_17)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_17(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_17(int16_t absMaxCoolSetpointLimit) - { - VerifyOrReturn(CheckValue("absMaxCoolSetpointLimit", absMaxCoolSetpointLimit, 3200)); - - NextTest(); - } - - CHIP_ERROR TestReadsMandatoryAttributesFromDutOccupiedCoolingSetpoint_18() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_18, OnFailureCallback_18)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_18(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_18(int16_t occupiedCoolingSetpoint) - { - VerifyOrReturn(CheckValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 2600)); - - NextTest(); - } - - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedCoolingSetpoint_19() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_19, OnFailureCallback_19)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_19(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_19(int16_t occupiedCoolingSetpoint) - { - VerifyOrReturn(CheckConstraintType("occupiedCoolingSetpoint", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 1600)); - VerifyOrReturn(CheckConstraintMaxValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 2600)); - - NextTest(); - } - - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutOccupiedCoolingSetpoint_20() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = 2600; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedCoolingSetpointArgument, this, OnSuccessCallback_20, OnFailureCallback_20)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_20(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_20() { NextTest(); } - - CHIP_ERROR TestReadBackMandatoryAttributesFromDutOccupiedCoolingSetpoint_21() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_21, OnFailureCallback_21)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_21(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_21(int16_t occupiedCoolingSetpoint) - { - VerifyOrReturn(CheckValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 2600)); - - NextTest(); - } - - CHIP_ERROR TestReadsMandatoryAttributesFromDutOccupiedHeatingSetpoint_22() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_22, OnFailureCallback_22)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_22(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_22(int16_t occupiedHeatingSetpoint) - { - VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 2000)); - - NextTest(); - } - - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedHeatingSetpoint_23() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_23, OnFailureCallback_23)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_23(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_23(int16_t occupiedHeatingSetpoint) - { - VerifyOrReturn(CheckConstraintType("occupiedHeatingSetpoint", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 700)); - VerifyOrReturn(CheckConstraintMaxValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 2600)); - - NextTest(); - } - - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutOccupiedHeatingSetpoint_24() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = 2000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedHeatingSetpointArgument, this, OnSuccessCallback_24, OnFailureCallback_24)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_24(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_24() { NextTest(); } - - CHIP_ERROR TestReadBackMandatoryAttributesFromDutOccupiedHeatingSetpoint_25() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_25, OnFailureCallback_25)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_25(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_25(int16_t occupiedHeatingSetpoint) - { - VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 2000)); - - NextTest(); - } - - CHIP_ERROR TestReadsMandatoryAttributesFromDutMinHeatSetpointLimit_26() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_26, OnFailureCallback_26)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_26(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_26(int16_t minHeatSetpointLimit) - { - VerifyOrReturn(CheckValue("minHeatSetpointLimit", minHeatSetpointLimit, 700)); - - NextTest(); - } - - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMinHeatSetpointLimit_27() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_27, OnFailureCallback_27)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_27(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_27(int16_t minHeatSetpointLimit) - { - VerifyOrReturn(CheckConstraintType("minHeatSetpointLimit", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("minHeatSetpointLimit", minHeatSetpointLimit, 700)); - VerifyOrReturn(CheckConstraintMaxValue("minHeatSetpointLimit", minHeatSetpointLimit, 3000)); - - NextTest(); - } - - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMinHeatSetpointLimit_28() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t minHeatSetpointLimitArgument; - minHeatSetpointLimitArgument = 700; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minHeatSetpointLimitArgument, this, OnSuccessCallback_28, OnFailureCallback_28)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_28(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_28() { NextTest(); } - - CHIP_ERROR TestReadBackMandatoryAttributesFromDutMinHeatSetpointLimit_29() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_29, OnFailureCallback_29)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_29(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_29(int16_t minHeatSetpointLimit) - { - VerifyOrReturn(CheckValue("minHeatSetpointLimit", minHeatSetpointLimit, 700)); - - NextTest(); - } - - CHIP_ERROR TestReadsMandatoryAttributesFromDutMaxHeatSetpointLimit_30() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_30, OnFailureCallback_30)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_30(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_30(int16_t maxHeatSetpointLimit) - { - VerifyOrReturn(CheckValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 3000)); - - NextTest(); - } - - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMaxHeatSetpointLimit_31() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_31, OnFailureCallback_31)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_31(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_31(int16_t maxHeatSetpointLimit) - { - VerifyOrReturn(CheckConstraintType("maxHeatSetpointLimit", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 700)); - VerifyOrReturn(CheckConstraintMaxValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 3000)); - - NextTest(); - } - - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMaxHeatSetpointLimit_32() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t maxHeatSetpointLimitArgument; - maxHeatSetpointLimitArgument = 3000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - maxHeatSetpointLimitArgument, this, OnSuccessCallback_32, OnFailureCallback_32)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_32(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_32() { NextTest(); } - - CHIP_ERROR TestReadBackMandatoryAttributesFromDutMaxHeatSetpointLimit_33() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_33, OnFailureCallback_33)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_33(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_33(int16_t maxHeatSetpointLimit) - { - VerifyOrReturn(CheckValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 3000)); - - NextTest(); - } - - CHIP_ERROR TestReadsMandatoryAttributesFromDutMinCoolSetpointLimit_34() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_34, OnFailureCallback_34)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_34(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_34(int16_t minCoolSetpointLimit) - { - VerifyOrReturn(CheckValue("minCoolSetpointLimit", minCoolSetpointLimit, 1600)); - - NextTest(); - } - - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMinCoolSetpointLimit_35() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_35, OnFailureCallback_35)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_35(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_35(int16_t minCoolSetpointLimit) - { - VerifyOrReturn(CheckConstraintType("minCoolSetpointLimit", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("minCoolSetpointLimit", minCoolSetpointLimit, 1600)); - VerifyOrReturn(CheckConstraintMaxValue("minCoolSetpointLimit", minCoolSetpointLimit, 3200)); - - NextTest(); - } - - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMinCoolSetpointLimit_36() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t minCoolSetpointLimitArgument; - minCoolSetpointLimitArgument = 1600; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minCoolSetpointLimitArgument, this, OnSuccessCallback_36, OnFailureCallback_36)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_36(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_36() { NextTest(); } - - CHIP_ERROR TestReadBackMandatoryAttributesFromDutMinCoolSetpointLimit_37() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_37, OnFailureCallback_37)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_37(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_37(int16_t minCoolSetpointLimit) - { - VerifyOrReturn(CheckValue("minCoolSetpointLimit", minCoolSetpointLimit, 1600)); - - NextTest(); - } - - CHIP_ERROR TestReadsMandatoryAttributesFromDutMaxCoolSetpointLimit_38() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_38, OnFailureCallback_38)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_38(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_38(int16_t maxCoolSetpointLimit) - { - VerifyOrReturn(CheckValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 3200)); - - NextTest(); - } - - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMaxCoolSetpointLimit_39() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_39, OnFailureCallback_39)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_39(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_39(int16_t maxCoolSetpointLimit) - { - VerifyOrReturn(CheckConstraintType("maxCoolSetpointLimit", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 1600)); - VerifyOrReturn(CheckConstraintMaxValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 3200)); - - NextTest(); - } - - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMaxCoolSetpointLimit_40() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t maxCoolSetpointLimitArgument; - maxCoolSetpointLimitArgument = 3200; - - ReturnErrorOnFailure(cluster.WriteAttribute( - maxCoolSetpointLimitArgument, this, OnSuccessCallback_40, OnFailureCallback_40)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_40(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_40() { NextTest(); } - - CHIP_ERROR TestReadBackMandatoryAttributesFromDutMaxCoolSetpointLimit_41() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_41, OnFailureCallback_41)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_41(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_41(int16_t maxCoolSetpointLimit) - { - VerifyOrReturn(CheckValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 3200)); - - NextTest(); - } - - CHIP_ERROR TestReadsMandatoryAttributesFromDutControlSequenceOfOperation_42() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_42, OnFailureCallback_42)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_42(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_42(uint8_t controlSequenceOfOperation) - { - VerifyOrReturn(CheckValue("controlSequenceOfOperation", controlSequenceOfOperation, 4)); - - NextTest(); - } - - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutControlSequenceOfOperation_43() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_43, OnFailureCallback_43)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_43(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_43(uint8_t controlSequenceOfOperation) - { - VerifyOrReturn(CheckConstraintType("controlSequenceOfOperation", "", "enum8")); - VerifyOrReturn(CheckConstraintMaxValue("controlSequenceOfOperation", controlSequenceOfOperation, 5)); - - NextTest(); - } - - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutControlSequenceOfOperation_44() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t controlSequenceOfOperationArgument; - controlSequenceOfOperationArgument = 4; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - controlSequenceOfOperationArgument, this, OnSuccessCallback_44, OnFailureCallback_44)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_44(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_44() { NextTest(); } - - CHIP_ERROR TestReadBackMandatoryAttributesFromDutControlSequenceOfOperation_45() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_45, OnFailureCallback_45)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_45(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_45(uint8_t controlSequenceOfOperation) - { - VerifyOrReturn(CheckValue("controlSequenceOfOperation", controlSequenceOfOperation, 4)); - - NextTest(); - } - - CHIP_ERROR TestReadsMandatoryAttributesFromDutSystemMode_46() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_46, OnFailureCallback_46)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_46(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_46(uint8_t systemMode) - { - VerifyOrReturn(CheckValue("systemMode", systemMode, 1)); - - NextTest(); - } - - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutSystemMode_47() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_47, OnFailureCallback_47)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_47(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_47(uint8_t systemMode) - { - VerifyOrReturn(CheckConstraintType("systemMode", "", "enum8")); - VerifyOrReturn(CheckConstraintMaxValue("systemMode", systemMode, 9)); - - NextTest(); - } - - CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutSystemMode_48() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t systemModeArgument; - systemModeArgument = 1; - - ReturnErrorOnFailure(cluster.WriteAttribute( - systemModeArgument, this, OnSuccessCallback_48, OnFailureCallback_48)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_48(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_48() { NextTest(); } - - CHIP_ERROR TestReadBackMandatoryAttributesFromDutSystemMode_49() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_49, OnFailureCallback_49)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_49(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_49(uint8_t systemMode) - { - VerifyOrReturn(CheckValue("systemMode", systemMode, 1)); - - NextTest(); - } - - CHIP_ERROR TestReadsOptionalAttributesFromDutMinSetpointDeadBand_50() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_50, OnFailureCallback_50)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_50(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_50(int8_t minSetpointDeadBand) - { - VerifyOrReturn(CheckValue("minSetpointDeadBand", minSetpointDeadBand, 25)); - - NextTest(); - } - - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutMinSetpointDeadBand_51() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_51, OnFailureCallback_51)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_51(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_51(int8_t minSetpointDeadBand) - { - VerifyOrReturn(CheckConstraintType("minSetpointDeadBand", "", "int8")); - VerifyOrReturn(CheckConstraintMaxValue("minSetpointDeadBand", minSetpointDeadBand, 25)); - - NextTest(); - } - - CHIP_ERROR TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutMinSetpointDeadBand_52() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int8_t minSetpointDeadBandArgument; - minSetpointDeadBandArgument = 25; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minSetpointDeadBandArgument, this, OnSuccessCallback_52, OnFailureCallback_52)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_52(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_52() { NextTest(); } - - CHIP_ERROR TestReadBackOptionalAttributesFromDutMinSetpointDeadBand_53() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_53, OnFailureCallback_53)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_53(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_53(int8_t minSetpointDeadBand) - { - VerifyOrReturn(CheckValue("minSetpointDeadBand", minSetpointDeadBand, 25)); - - NextTest(); - } - - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutStartOfWeek_54() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_54, OnFailureCallback_54)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_54(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_54(uint8_t startOfWeek) - { - VerifyOrReturn(CheckConstraintType("startOfWeek", "", "enum8")); - VerifyOrReturn(CheckConstraintMaxValue("startOfWeek", startOfWeek, 6)); - - NextTest(); - } - - CHIP_ERROR TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutStartOfWeek_55() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t startOfWeekArgument; - startOfWeekArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - startOfWeekArgument, this, OnSuccessCallback_55, OnFailureCallback_55)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_55(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_55() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadBackOptionalAttributesFromDutStartOfWeek_56() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_56, OnFailureCallback_56)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_56(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_56(uint8_t startOfWeek) - { - VerifyOrReturn(CheckValue("startOfWeek", startOfWeek, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutNumberOfWeeklyTransitions_57() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_57, OnFailureCallback_57)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_57(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_57(uint8_t numberOfWeeklyTransitions) - { - VerifyOrReturn(CheckConstraintType("numberOfWeeklyTransitions", "", "uint8")); - - NextTest(); - } - - CHIP_ERROR TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutNumberOfWeeklyTransitions_58() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t numberOfWeeklyTransitionsArgument; - numberOfWeeklyTransitionsArgument = 0; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - numberOfWeeklyTransitionsArgument, this, OnSuccessCallback_58, OnFailureCallback_58)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_58(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_58() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutNumberOfDailyTransitions_59() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_59, OnFailureCallback_59)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_59(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_59(uint8_t numberOfDailyTransitions) - { - VerifyOrReturn(CheckConstraintType("numberOfDailyTransitions", "", "uint8")); - - NextTest(); - } - - CHIP_ERROR TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutNumberOfDailyTransitions_60() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t numberOfDailyTransitionsArgument; - numberOfDailyTransitionsArgument = 0; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - numberOfDailyTransitionsArgument, this, OnSuccessCallback_60, OnFailureCallback_60)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_60(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_60() { ThrowSuccessResponse(); } -}; - -class Test_TC_TSTAT_2_2 : public TestCommand -{ -public: - Test_TC_TSTAT_2_2() : TestCommand("Test_TC_TSTAT_2_2"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSTAT_2_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSTAT_2_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 : Reads OccupiedCoolingSetpoint attribute from Server DUT and verifies that the " - "value is within range\n"); - err = ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT") - ? CHIP_NO_ERROR - : TestReadsOccupiedCoolingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_1(); - break; - case 2: - ChipLogProgress( - chipTool, - " ***** Test Step 2 : Writes a value back that is different but valid for OccupiedCoolingSetpoint attribute\n"); - err = ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT") - ? CHIP_NO_ERROR - : TestWritesAValueBackThatIsDifferentButValidForOccupiedCoolingSetpointAttribute_2(); - break; - case 3: - ChipLogProgress( - chipTool, - " ***** Test Step 3 : Reads it back again to confirm the successful write of OccupiedCoolingSetpoint attribute\n"); - err = ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT") - ? CHIP_NO_ERROR - : TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedCoolingSetpointAttribute_3(); - break; - case 4: - ChipLogProgress(chipTool, - " ***** Test Step 4 : Writes the limit of MinCoolSetpointLimit to OccupiedCoolingSetpoint attribute\n"); - err = ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfMinCoolSetpointLimitToOccupiedCoolingSetpointAttribute_4(); - break; - case 5: - ChipLogProgress(chipTool, - " ***** Test Step 5 : Writes the limit of MaxCoolSetpointLimit to OccupiedCoolingSetpoint attribute\n"); - err = ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfMaxCoolSetpointLimitToOccupiedCoolingSetpointAttribute_5(); - break; - case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : Reads OccupiedHeatingSetpoint attribute from Server DUT and verifies that the " - "value is within range\n"); - err = ShouldSkip("A_OCCUPIEDHEATINGSETPOINT") - ? CHIP_NO_ERROR - : TestReadsOccupiedHeatingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_6(); - break; - case 7: - ChipLogProgress( - chipTool, - " ***** Test Step 7 : Writes a value back that is different but valid for OccupiedHeatingSetpoint attribute\n"); - err = ShouldSkip("A_OCCUPIEDHEATINGSETPOINT") - ? CHIP_NO_ERROR - : TestWritesAValueBackThatIsDifferentButValidForOccupiedHeatingSetpointAttribute_7(); - break; - case 8: - ChipLogProgress( - chipTool, - " ***** Test Step 8 : Reads it back again to confirm the successful write of OccupiedHeatingSetpoint attribute\n"); - err = ShouldSkip("A_OCCUPIEDHEATINGSETPOINT") - ? CHIP_NO_ERROR - : TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedHeatingSetpointAttribute_8(); - break; - case 9: - ChipLogProgress(chipTool, - " ***** Test Step 9 : Writes the limit of MinHeatSetpointLimit to OccupiedHeatingSetpoint attribute\n"); - err = ShouldSkip("A_OCCUPIEDHEATINGSETPOINT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfMinHeatSetpointLimitToOccupiedHeatingSetpointAttribute_9(); - break; - case 10: - ChipLogProgress( - chipTool, " ***** Test Step 10 : Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint attribute\n"); - err = ShouldSkip("A_OCCUPIEDHEATINGSETPOINT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfMaxHeatSetpointLimitToOccupiedHeatingSetpointAttribute_10(); - break; - case 11: - ChipLogProgress(chipTool, - " ***** Test Step 11 : Reads MinHeatSetpointLimit attribute from Server DUT and verifies that the " - "value is within range\n"); - err = ShouldSkip("A_MINHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestReadsMinHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_11(); - break; - case 12: - ChipLogProgress( - chipTool, - " ***** Test Step 12 : Writes a value back that is different but valid for MinHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MINHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesAValueBackThatIsDifferentButValidForMinHeatSetpointLimitAttribute_12(); - break; - case 13: - ChipLogProgress( - chipTool, - " ***** Test Step 13 : Reads it back again to confirm the successful write of MinHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MINHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinHeatSetpointLimitAttribute_13(); - break; - case 14: - ChipLogProgress( - chipTool, " ***** Test Step 14 : Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MINHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_14(); - break; - case 15: - ChipLogProgress( - chipTool, " ***** Test Step 15 : Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MINHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_15(); - break; - case 16: - ChipLogProgress(chipTool, - " ***** Test Step 16 : Reads MaxHeatSetpointLimit attribute from Server DUT and verifies that the " - "value is within range\n"); - err = ShouldSkip("A_MAXHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestReadsMaxHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_16(); - break; - case 17: - ChipLogProgress( - chipTool, - " ***** Test Step 17 : Writes a value back that is different but valid for MaxHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MAXHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesAValueBackThatIsDifferentButValidForMaxHeatSetpointLimitAttribute_17(); - break; - case 18: - ChipLogProgress( - chipTool, - " ***** Test Step 18 : Reads it back again to confirm the successful write of MaxHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MAXHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxHeatSetpointLimitAttribute_18(); - break; - case 19: - ChipLogProgress( - chipTool, " ***** Test Step 19 : Writes the limit of AbsMinHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MAXHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfAbsMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_19(); - break; - case 20: - ChipLogProgress( - chipTool, " ***** Test Step 20 : Writes the limit of AbsMaxHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MAXHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_20(); - break; - case 21: - ChipLogProgress(chipTool, - " ***** Test Step 21 : Reads MinCoolSetpointLimit attribute from Server DUT and verifies that the " - "value is within range\n"); - err = ShouldSkip("A_MINCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestReadsMinCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_21(); - break; - case 22: - ChipLogProgress( - chipTool, - " ***** Test Step 22 : Writes a value back that is different but valid for MinCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MINCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesAValueBackThatIsDifferentButValidForMinCoolSetpointLimitAttribute_22(); - break; - case 23: - ChipLogProgress( - chipTool, - " ***** Test Step 23 : Reads it back again to confirm the successful write of MinCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MINCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinCoolSetpointLimitAttribute_23(); - break; - case 24: - ChipLogProgress( - chipTool, " ***** Test Step 24 : Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MINCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_24(); - break; - case 25: - ChipLogProgress(chipTool, - " ***** Test Step 25 : Writes the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MINCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_25(); - break; - case 26: - ChipLogProgress(chipTool, - " ***** Test Step 26 : Reads MaxCoolSetpointLimit attribute from Server DUT and verifies that the " - "value is within range\n"); - err = ShouldSkip("A_MAXCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestReadsMaxCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_26(); - break; - case 27: - ChipLogProgress( - chipTool, - " ***** Test Step 27 : Writes a value back that is different but valid for MaxCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MAXCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesAValueBackThatIsDifferentButValidForMaxCoolSetpointLimitAttribute_27(); - break; - case 28: - ChipLogProgress( - chipTool, - " ***** Test Step 28 : Reads it back again to confirm the successful write of MaxCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MAXCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxCoolSetpointLimitAttribute_28(); - break; - case 29: - ChipLogProgress( - chipTool, " ***** Test Step 29 : Writes the limit of AbsMinCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MAXCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfAbsMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_29(); - break; - case 30: - ChipLogProgress(chipTool, - " ***** Test Step 30 : Writes the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MAXCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_30(); - break; - case 31: - ChipLogProgress( - chipTool, - " ***** Test Step 31 : Writes (sets back) the limit of MinHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MINHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_31(); - break; - case 32: - ChipLogProgress( - chipTool, - " ***** Test Step 32 : Writes (sets back) the limit of MaxHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MINHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_32(); - break; - case 33: - ChipLogProgress( - chipTool, - " ***** Test Step 33 : Writes (sets back) the limit of MinHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MINHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_33(); - break; - case 34: - ChipLogProgress( - chipTool, - " ***** Test Step 34 : Writes (sets back) the limit of MaxHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MINHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_34(); - break; - case 35: - ChipLogProgress( - chipTool, - " ***** Test Step 35 : Writes (sets back) the limit of MinCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MINCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_35(); - break; - case 36: - ChipLogProgress( - chipTool, - " ***** Test Step 36 : Writes (sets back) the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MINCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_36(); - break; - case 37: - ChipLogProgress( - chipTool, - " ***** Test Step 37 : Writes (sets back) the limit of MinCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MAXCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_37(); - break; - case 38: - ChipLogProgress( - chipTool, - " ***** Test Step 38 : Writes (sets back) the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MAXCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_38(); - break; - case 39: - ChipLogProgress( - chipTool, - " ***** Test Step 39 : Reads ControlSequenceOfOperation from Server DUT and verifies that the value is valid\n"); - err = ShouldSkip("A_CONTROLSEQUENCEOFOPERATION") - ? CHIP_NO_ERROR - : TestReadsControlSequenceOfOperationFromServerDutAndVerifiesThatTheValueIsValid_39(); - break; - case 40: - ChipLogProgress( - chipTool, " ***** Test Step 40 : Write Attribute command for ControlSequenceOfOperation with a new valid value\n"); - err = ShouldSkip("A_CONTROLSEQUENCEOFOPERATION") - ? CHIP_NO_ERROR - : TestWriteAttributeCommandForControlSequenceOfOperationWithANewValidValue_40(); - break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : Read it back again to confirm the successful write\n"); - err = ShouldSkip("A_CONTROLSEQUENCEOFOPERATION") ? CHIP_NO_ERROR : TestReadItBackAgainToConfirmTheSuccessfulWrite_41(); - break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : Sets OccupiedHeatingSetpoint to default value\n"); - err = ShouldSkip("A_OCCUPIEDHEATINGSETPOINT") ? CHIP_NO_ERROR : TestSetsOccupiedHeatingSetpointToDefaultValue_42(); - break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : Sets OccupiedHeatingSetpoint to default value\n"); - err = ShouldSkip("A_OCCUPIEDHEATINGSETPOINT") ? CHIP_NO_ERROR : TestSetsOccupiedHeatingSetpointToDefaultValue_43(); - break; - case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : Sets OccupiedCoolingSetpoint to default value\n"); - err = ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT") ? CHIP_NO_ERROR : TestSetsOccupiedCoolingSetpointToDefaultValue_44(); - break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Sets OccupiedCoolingSetpoint to default value\n"); - err = ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT") ? CHIP_NO_ERROR : TestSetsOccupiedCoolingSetpointToDefaultValue_45(); - break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : Sets OccupiedCoolingSetpoint to default value\n"); - err = ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT") ? CHIP_NO_ERROR : TestSetsOccupiedCoolingSetpointToDefaultValue_46(); - break; - case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : Sets OccupiedHeatingSetpoint to default value\n"); - err = ShouldSkip("A_OCCUPIEDHEATINGSETPOINT") ? CHIP_NO_ERROR : TestSetsOccupiedHeatingSetpointToDefaultValue_47(); - break; - case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : Sets OccupiedCoolingSetpoint to default value\n"); - err = ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT") ? CHIP_NO_ERROR : TestSetsOccupiedCoolingSetpointToDefaultValue_48(); - break; - case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : Sets OccupiedHeatingSetpoint to default value\n"); - err = ShouldSkip("A_OCCUPIEDHEATINGSETPOINT") ? CHIP_NO_ERROR : TestSetsOccupiedHeatingSetpointToDefaultValue_49(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 50; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, int16_t occupiedCoolingSetpoint) - { - (static_cast(context))->OnSuccessResponse_1(occupiedCoolingSetpoint); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, int16_t occupiedCoolingSetpoint) - { - (static_cast(context))->OnSuccessResponse_3(occupiedCoolingSetpoint); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, int16_t occupiedHeatingSetpoint) - { - (static_cast(context))->OnSuccessResponse_6(occupiedHeatingSetpoint); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context, int16_t occupiedHeatingSetpoint) - { - (static_cast(context))->OnSuccessResponse_8(occupiedHeatingSetpoint); - } - - static void OnFailureCallback_9(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context) { (static_cast(context))->OnSuccessResponse_9(); } - - static void OnFailureCallback_10(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_10(status); - } - - static void OnSuccessCallback_10(void * context) { (static_cast(context))->OnSuccessResponse_10(); } - - static void OnFailureCallback_11(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_11(status); - } - - static void OnSuccessCallback_11(void * context, int16_t minHeatSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_11(minHeatSetpointLimit); - } - - static void OnFailureCallback_12(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_12(status); - } - - static void OnSuccessCallback_12(void * context) { (static_cast(context))->OnSuccessResponse_12(); } - - static void OnFailureCallback_13(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_13(status); - } - - static void OnSuccessCallback_13(void * context, int16_t minHeatSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_13(minHeatSetpointLimit); - } - - static void OnFailureCallback_14(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_14(status); - } - - static void OnSuccessCallback_14(void * context) { (static_cast(context))->OnSuccessResponse_14(); } - - static void OnFailureCallback_15(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_15(status); - } - - static void OnSuccessCallback_15(void * context) { (static_cast(context))->OnSuccessResponse_15(); } - - static void OnFailureCallback_16(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_16(status); - } - - static void OnSuccessCallback_16(void * context, int16_t maxHeatSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_16(maxHeatSetpointLimit); - } - - static void OnFailureCallback_17(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_17(status); - } - - static void OnSuccessCallback_17(void * context) { (static_cast(context))->OnSuccessResponse_17(); } - - static void OnFailureCallback_18(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_18(status); - } - - static void OnSuccessCallback_18(void * context, int16_t maxHeatSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_18(maxHeatSetpointLimit); - } - - static void OnFailureCallback_19(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_19(status); - } - - static void OnSuccessCallback_19(void * context) { (static_cast(context))->OnSuccessResponse_19(); } - - static void OnFailureCallback_20(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_20(status); - } - - static void OnSuccessCallback_20(void * context) { (static_cast(context))->OnSuccessResponse_20(); } - - static void OnFailureCallback_21(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_21(status); - } - - static void OnSuccessCallback_21(void * context, int16_t minCoolSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_21(minCoolSetpointLimit); - } - - static void OnFailureCallback_22(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_22(status); - } - - static void OnSuccessCallback_22(void * context) { (static_cast(context))->OnSuccessResponse_22(); } - - static void OnFailureCallback_23(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_23(status); - } - - static void OnSuccessCallback_23(void * context, int16_t minCoolSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_23(minCoolSetpointLimit); - } - - static void OnFailureCallback_24(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_24(status); - } - - static void OnSuccessCallback_24(void * context) { (static_cast(context))->OnSuccessResponse_24(); } - - static void OnFailureCallback_25(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_25(status); - } - - static void OnSuccessCallback_25(void * context) { (static_cast(context))->OnSuccessResponse_25(); } - - static void OnFailureCallback_26(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_26(status); - } - - static void OnSuccessCallback_26(void * context, int16_t maxCoolSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_26(maxCoolSetpointLimit); - } - - static void OnFailureCallback_27(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_27(status); - } - - static void OnSuccessCallback_27(void * context) { (static_cast(context))->OnSuccessResponse_27(); } - - static void OnFailureCallback_28(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_28(status); - } - - static void OnSuccessCallback_28(void * context, int16_t maxCoolSetpointLimit) - { - (static_cast(context))->OnSuccessResponse_28(maxCoolSetpointLimit); - } - - static void OnFailureCallback_29(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_29(status); - } - - static void OnSuccessCallback_29(void * context) { (static_cast(context))->OnSuccessResponse_29(); } - - static void OnFailureCallback_30(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_30(status); - } - - static void OnSuccessCallback_30(void * context) { (static_cast(context))->OnSuccessResponse_30(); } - - static void OnFailureCallback_31(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_31(status); - } - - static void OnSuccessCallback_31(void * context) { (static_cast(context))->OnSuccessResponse_31(); } - - static void OnFailureCallback_32(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_32(status); - } - - static void OnSuccessCallback_32(void * context) { (static_cast(context))->OnSuccessResponse_32(); } - - static void OnFailureCallback_33(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_33(status); - } - - static void OnSuccessCallback_33(void * context) { (static_cast(context))->OnSuccessResponse_33(); } - - static void OnFailureCallback_34(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_34(status); - } - - static void OnSuccessCallback_34(void * context) { (static_cast(context))->OnSuccessResponse_34(); } - - static void OnFailureCallback_35(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_35(status); - } - - static void OnSuccessCallback_35(void * context) { (static_cast(context))->OnSuccessResponse_35(); } - - static void OnFailureCallback_36(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_36(status); - } - - static void OnSuccessCallback_36(void * context) { (static_cast(context))->OnSuccessResponse_36(); } - - static void OnFailureCallback_37(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_37(status); - } - - static void OnSuccessCallback_37(void * context) { (static_cast(context))->OnSuccessResponse_37(); } - - static void OnFailureCallback_38(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_38(status); - } - - static void OnSuccessCallback_38(void * context) { (static_cast(context))->OnSuccessResponse_38(); } - - static void OnFailureCallback_39(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_39(status); - } - - static void OnSuccessCallback_39(void * context, uint8_t controlSequenceOfOperation) - { - (static_cast(context))->OnSuccessResponse_39(controlSequenceOfOperation); - } - - static void OnFailureCallback_40(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_40(status); - } - - static void OnSuccessCallback_40(void * context) { (static_cast(context))->OnSuccessResponse_40(); } - - static void OnFailureCallback_41(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_41(status); - } - - static void OnSuccessCallback_41(void * context, uint8_t controlSequenceOfOperation) - { - (static_cast(context))->OnSuccessResponse_41(controlSequenceOfOperation); - } - - static void OnFailureCallback_42(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_42(status); - } - - static void OnSuccessCallback_42(void * context) { (static_cast(context))->OnSuccessResponse_42(); } - - static void OnFailureCallback_43(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_43(status); - } - - static void OnSuccessCallback_43(void * context) { (static_cast(context))->OnSuccessResponse_43(); } - - static void OnFailureCallback_44(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_44(status); - } - - static void OnSuccessCallback_44(void * context) { (static_cast(context))->OnSuccessResponse_44(); } - - static void OnFailureCallback_45(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_45(status); - } - - static void OnSuccessCallback_45(void * context) { (static_cast(context))->OnSuccessResponse_45(); } - - static void OnFailureCallback_46(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_46(status); - } - - static void OnSuccessCallback_46(void * context) { (static_cast(context))->OnSuccessResponse_46(); } - - static void OnFailureCallback_47(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_47(status); - } - - static void OnSuccessCallback_47(void * context) { (static_cast(context))->OnSuccessResponse_47(); } - - static void OnFailureCallback_48(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_48(status); - } - - static void OnSuccessCallback_48(void * context) { (static_cast(context))->OnSuccessResponse_48(); } - - static void OnFailureCallback_49(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_49(status); - } - - static void OnSuccessCallback_49(void * context) { (static_cast(context))->OnSuccessResponse_49(); } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadsOccupiedCoolingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(int16_t occupiedCoolingSetpoint) - { - VerifyOrReturn(CheckValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 2600)); - - NextTest(); - } - - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForOccupiedCoolingSetpointAttribute_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = 2000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedCoolingSetpointArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2() { NextTest(); } - - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedCoolingSetpointAttribute_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(int16_t occupiedCoolingSetpoint) - { - VerifyOrReturn(CheckValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 2000)); - - NextTest(); - } - - CHIP_ERROR TestWritesTheLimitOfMinCoolSetpointLimitToOccupiedCoolingSetpointAttribute_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = 1600; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedCoolingSetpointArgument, this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToOccupiedCoolingSetpointAttribute_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = 2600; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedCoolingSetpointArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestReadsOccupiedHeatingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(int16_t occupiedHeatingSetpoint) - { - VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 2000)); - - NextTest(); - } - - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForOccupiedHeatingSetpointAttribute_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = 2100; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedHeatingSetpointArgument, this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7() { NextTest(); } - - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedHeatingSetpointAttribute_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8(int16_t occupiedHeatingSetpoint) - { - VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 2100)); - - NextTest(); - } - - CHIP_ERROR TestWritesTheLimitOfMinHeatSetpointLimitToOccupiedHeatingSetpointAttribute_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = 700; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedHeatingSetpointArgument, this, OnSuccessCallback_9, OnFailureCallback_9)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9() { NextTest(); } - - CHIP_ERROR TestWritesTheLimitOfMaxHeatSetpointLimitToOccupiedHeatingSetpointAttribute_10() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = 3000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedHeatingSetpointArgument, this, OnSuccessCallback_10, OnFailureCallback_10)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10() { NextTest(); } - - CHIP_ERROR TestReadsMinHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_11() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_11, OnFailureCallback_11)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_11(int16_t minHeatSetpointLimit) - { - VerifyOrReturn(CheckValue("minHeatSetpointLimit", minHeatSetpointLimit, 700)); - - NextTest(); - } - - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMinHeatSetpointLimitAttribute_12() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t minHeatSetpointLimitArgument; - minHeatSetpointLimitArgument = 2000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minHeatSetpointLimitArgument, this, OnSuccessCallback_12, OnFailureCallback_12)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_12(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_12() { NextTest(); } - - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinHeatSetpointLimitAttribute_13() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_13, OnFailureCallback_13)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_13(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_13(int16_t minHeatSetpointLimit) - { - VerifyOrReturn(CheckValue("minHeatSetpointLimit", minHeatSetpointLimit, 2000)); - - NextTest(); - } - - CHIP_ERROR TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_14() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t minHeatSetpointLimitArgument; - minHeatSetpointLimitArgument = 700; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minHeatSetpointLimitArgument, this, OnSuccessCallback_14, OnFailureCallback_14)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_14(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_14() { NextTest(); } - - CHIP_ERROR TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_15() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t minHeatSetpointLimitArgument; - minHeatSetpointLimitArgument = 3000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minHeatSetpointLimitArgument, this, OnSuccessCallback_15, OnFailureCallback_15)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_15(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_15() { NextTest(); } - - CHIP_ERROR TestReadsMaxHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_16() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_16, OnFailureCallback_16)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_16(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_16(int16_t maxHeatSetpointLimit) - { - VerifyOrReturn(CheckValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 3000)); - - NextTest(); - } - - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMaxHeatSetpointLimitAttribute_17() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t maxHeatSetpointLimitArgument; - maxHeatSetpointLimitArgument = 2000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - maxHeatSetpointLimitArgument, this, OnSuccessCallback_17, OnFailureCallback_17)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_17(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_17() { NextTest(); } - - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxHeatSetpointLimitAttribute_18() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_18, OnFailureCallback_18)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_18(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_18(int16_t maxHeatSetpointLimit) - { - VerifyOrReturn(CheckValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 2000)); - - NextTest(); - } - - CHIP_ERROR TestWritesTheLimitOfAbsMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_19() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t maxHeatSetpointLimitArgument; - maxHeatSetpointLimitArgument = 700; - - ReturnErrorOnFailure(cluster.WriteAttribute( - maxHeatSetpointLimitArgument, this, OnSuccessCallback_19, OnFailureCallback_19)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_19(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_19() { NextTest(); } - - CHIP_ERROR TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_20() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t maxHeatSetpointLimitArgument; - maxHeatSetpointLimitArgument = 3000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - maxHeatSetpointLimitArgument, this, OnSuccessCallback_20, OnFailureCallback_20)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_20(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_20() { NextTest(); } - - CHIP_ERROR TestReadsMinCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_21() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_21, OnFailureCallback_21)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_21(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_21(int16_t minCoolSetpointLimit) - { - VerifyOrReturn(CheckValue("minCoolSetpointLimit", minCoolSetpointLimit, 1600)); - - NextTest(); - } - - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMinCoolSetpointLimitAttribute_22() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t minCoolSetpointLimitArgument; - minCoolSetpointLimitArgument = 2000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minCoolSetpointLimitArgument, this, OnSuccessCallback_22, OnFailureCallback_22)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_22(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_22() { NextTest(); } - - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinCoolSetpointLimitAttribute_23() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_23, OnFailureCallback_23)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_23(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_23(int16_t minCoolSetpointLimit) - { - VerifyOrReturn(CheckValue("minCoolSetpointLimit", minCoolSetpointLimit, 2000)); - - NextTest(); - } - - CHIP_ERROR TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_24() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t minCoolSetpointLimitArgument; - minCoolSetpointLimitArgument = 1600; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minCoolSetpointLimitArgument, this, OnSuccessCallback_24, OnFailureCallback_24)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_24(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_24() { NextTest(); } - - CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_25() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t minCoolSetpointLimitArgument; - minCoolSetpointLimitArgument = 3200; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minCoolSetpointLimitArgument, this, OnSuccessCallback_25, OnFailureCallback_25)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_25(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_25() { NextTest(); } - - CHIP_ERROR TestReadsMaxCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_26() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_26, OnFailureCallback_26)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_26(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_26(int16_t maxCoolSetpointLimit) - { - VerifyOrReturn(CheckValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 3200)); - - NextTest(); - } - - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMaxCoolSetpointLimitAttribute_27() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t maxCoolSetpointLimitArgument; - maxCoolSetpointLimitArgument = 2000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - maxCoolSetpointLimitArgument, this, OnSuccessCallback_27, OnFailureCallback_27)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_27(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_27() { NextTest(); } - - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxCoolSetpointLimitAttribute_28() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_28, OnFailureCallback_28)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_28(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_28(int16_t maxCoolSetpointLimit) - { - VerifyOrReturn(CheckValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 2000)); - - NextTest(); - } - - CHIP_ERROR TestWritesTheLimitOfAbsMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_29() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t maxCoolSetpointLimitArgument; - maxCoolSetpointLimitArgument = 1600; - - ReturnErrorOnFailure(cluster.WriteAttribute( - maxCoolSetpointLimitArgument, this, OnSuccessCallback_29, OnFailureCallback_29)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_29(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_29() { NextTest(); } - - CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_30() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t maxCoolSetpointLimitArgument; - maxCoolSetpointLimitArgument = 3200; - - ReturnErrorOnFailure(cluster.WriteAttribute( - maxCoolSetpointLimitArgument, this, OnSuccessCallback_30, OnFailureCallback_30)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_30(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_30() { NextTest(); } - - CHIP_ERROR TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_31() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t minHeatSetpointLimitArgument; - minHeatSetpointLimitArgument = 700; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minHeatSetpointLimitArgument, this, OnSuccessCallback_31, OnFailureCallback_31)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_31(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_31() { NextTest(); } - - CHIP_ERROR TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_32() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t minHeatSetpointLimitArgument; - minHeatSetpointLimitArgument = 3000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minHeatSetpointLimitArgument, this, OnSuccessCallback_32, OnFailureCallback_32)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_32(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_32() { NextTest(); } - - CHIP_ERROR TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_33() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t maxHeatSetpointLimitArgument; - maxHeatSetpointLimitArgument = 700; - - ReturnErrorOnFailure(cluster.WriteAttribute( - maxHeatSetpointLimitArgument, this, OnSuccessCallback_33, OnFailureCallback_33)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_33(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_33() { NextTest(); } - - CHIP_ERROR TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_34() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t maxHeatSetpointLimitArgument; - maxHeatSetpointLimitArgument = 3000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - maxHeatSetpointLimitArgument, this, OnSuccessCallback_34, OnFailureCallback_34)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_34(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_34() { NextTest(); } - - CHIP_ERROR TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_35() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t minCoolSetpointLimitArgument; - minCoolSetpointLimitArgument = 1600; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minCoolSetpointLimitArgument, this, OnSuccessCallback_35, OnFailureCallback_35)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_35(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_35() { NextTest(); } - - CHIP_ERROR TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_36() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t minCoolSetpointLimitArgument; - minCoolSetpointLimitArgument = 3200; - - ReturnErrorOnFailure(cluster.WriteAttribute( - minCoolSetpointLimitArgument, this, OnSuccessCallback_36, OnFailureCallback_36)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_36(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_36() { NextTest(); } - - CHIP_ERROR TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_37() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t maxCoolSetpointLimitArgument; - maxCoolSetpointLimitArgument = 1600; - - ReturnErrorOnFailure(cluster.WriteAttribute( - maxCoolSetpointLimitArgument, this, OnSuccessCallback_37, OnFailureCallback_37)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_37(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_37() { NextTest(); } - - CHIP_ERROR TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_38() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t maxCoolSetpointLimitArgument; - maxCoolSetpointLimitArgument = 3200; - - ReturnErrorOnFailure(cluster.WriteAttribute( - maxCoolSetpointLimitArgument, this, OnSuccessCallback_38, OnFailureCallback_38)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_38(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_38() { NextTest(); } - - CHIP_ERROR TestReadsControlSequenceOfOperationFromServerDutAndVerifiesThatTheValueIsValid_39() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_39, OnFailureCallback_39)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_39(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_39(uint8_t controlSequenceOfOperation) - { - VerifyOrReturn(CheckValue("controlSequenceOfOperation", controlSequenceOfOperation, 4)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeCommandForControlSequenceOfOperationWithANewValidValue_40() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t controlSequenceOfOperationArgument; - controlSequenceOfOperationArgument = 2; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - controlSequenceOfOperationArgument, this, OnSuccessCallback_40, OnFailureCallback_40)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_40(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_40() { NextTest(); } - - CHIP_ERROR TestReadItBackAgainToConfirmTheSuccessfulWrite_41() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_41, OnFailureCallback_41)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_41(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_41(uint8_t controlSequenceOfOperation) - { - VerifyOrReturn(CheckValue("controlSequenceOfOperation", controlSequenceOfOperation, 2)); - - NextTest(); - } - - CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_42() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = 2000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedHeatingSetpointArgument, this, OnSuccessCallback_42, OnFailureCallback_42)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_42(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_42() { NextTest(); } - - CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_43() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = 2000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedHeatingSetpointArgument, this, OnSuccessCallback_43, OnFailureCallback_43)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_43(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_43() { NextTest(); } - - CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_44() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = 2600; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedCoolingSetpointArgument, this, OnSuccessCallback_44, OnFailureCallback_44)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_44(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_44() { NextTest(); } - - CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_45() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = 2600; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedCoolingSetpointArgument, this, OnSuccessCallback_45, OnFailureCallback_45)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_45(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_45() { NextTest(); } - - CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_46() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = 2600; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedCoolingSetpointArgument, this, OnSuccessCallback_46, OnFailureCallback_46)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_46(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_46() { NextTest(); } - - CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_47() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = 2000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedHeatingSetpointArgument, this, OnSuccessCallback_47, OnFailureCallback_47)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_47(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_47() { NextTest(); } - - CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_48() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = 2600; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedCoolingSetpointArgument, this, OnSuccessCallback_48, OnFailureCallback_48)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_48(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_48() { NextTest(); } - - CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_49() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t occupiedHeatingSetpointArgument; - occupiedHeatingSetpointArgument = 2000; - - ReturnErrorOnFailure(cluster.WriteAttribute( - occupiedHeatingSetpointArgument, this, OnSuccessCallback_49, OnFailureCallback_49)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_49(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_49() { NextTest(); } -}; - -class Test_TC_TSUIC_1_1 : public TestCommand -{ -public: - Test_TC_TSUIC_1_1() : TestCommand("Test_TC_TSUIC_1_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSUIC_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSUIC_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 constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); - break; - case 2: - ChipLogProgress(chipTool, - " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint16_t clusterRevision) - { - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 2U; - - ReturnErrorOnFailure( - cluster - .WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_2() { ThrowSuccessResponse(); } -}; - -class Test_TC_TSUIC_2_1 : public TestCommand -{ -public: - Test_TC_TSUIC_2_1() : TestCommand("Test_TC_TSUIC_2_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSUIC_2_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSUIC_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 : read the mandatory attribute: TemperatureDisplayMode\n"); - err = TestReadTheMandatoryAttributeTemperatureDisplayMode_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: TemperatureDisplayMode\n"); - err = TestReadTheMandatoryAttributeTemperatureDisplayMode_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : write to the mandatory attribute: TemperatureDisplayMode\n"); - err = TestWriteToTheMandatoryAttributeTemperatureDisplayMode_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : read the mandatory attribute: TemperatureDisplayMode\n"); - err = TestReadTheMandatoryAttributeTemperatureDisplayMode_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : read the mandatory attribute: TemperatureDisplayMode\n"); - err = TestReadTheMandatoryAttributeTemperatureDisplayMode_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : read the mandatory attribute: KeypadLockout\n"); - err = TestReadTheMandatoryAttributeKeypadLockout_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : read the mandatory attribute: KeypadLockout\n"); - err = TestReadTheMandatoryAttributeKeypadLockout_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : write to the mandatory attribute: KeypadLockout\n"); - err = TestWriteToTheMandatoryAttributeKeypadLockout_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : read the mandatory attribute: KeypadLockout\n"); - err = TestReadTheMandatoryAttributeKeypadLockout_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : read the mandatory attribute: KeypadLockout\n"); - err = TestReadTheMandatoryAttributeKeypadLockout_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : read the optional attribute: ScheduleProgrammingVisibility\n"); - err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : read the optional attribute: ScheduleProgrammingVisibility\n"); - err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : write to the mandatory attribute: ScheduleProgrammingVisibility\n"); - err = TestWriteToTheMandatoryAttributeScheduleProgrammingVisibility_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : read the optional attribute: ScheduleProgrammingVisibility\n"); - err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : read the optional attribute: ScheduleProgrammingVisibility\n"); - err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_15(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 16; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint8_t temperatureDisplayMode) - { - (static_cast(context))->OnSuccessResponse_1(temperatureDisplayMode); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint8_t temperatureDisplayMode) - { - (static_cast(context))->OnSuccessResponse_2(temperatureDisplayMode); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint8_t temperatureDisplayMode) - { - (static_cast(context))->OnSuccessResponse_4(temperatureDisplayMode); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, uint8_t temperatureDisplayMode) - { - (static_cast(context))->OnSuccessResponse_5(temperatureDisplayMode); - } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, uint8_t keypadLockout) - { - (static_cast(context))->OnSuccessResponse_6(keypadLockout); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, uint8_t keypadLockout) - { - (static_cast(context))->OnSuccessResponse_7(keypadLockout); - } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } - - static void OnFailureCallback_9(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context, uint8_t keypadLockout) - { - (static_cast(context))->OnSuccessResponse_9(keypadLockout); - } - - static void OnFailureCallback_10(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_10(status); - } - - static void OnSuccessCallback_10(void * context, uint8_t keypadLockout) - { - (static_cast(context))->OnSuccessResponse_10(keypadLockout); - } - - static void OnFailureCallback_11(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_11(status); - } - - static void OnSuccessCallback_11(void * context, uint8_t scheduleProgrammingVisibility) - { - (static_cast(context))->OnSuccessResponse_11(scheduleProgrammingVisibility); - } - - static void OnFailureCallback_12(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_12(status); - } - - static void OnSuccessCallback_12(void * context, uint8_t scheduleProgrammingVisibility) - { - (static_cast(context))->OnSuccessResponse_12(scheduleProgrammingVisibility); - } - - static void OnFailureCallback_13(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_13(status); - } - - static void OnSuccessCallback_13(void * context) { (static_cast(context))->OnSuccessResponse_13(); } - - static void OnFailureCallback_14(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_14(status); - } - - static void OnSuccessCallback_14(void * context, uint8_t scheduleProgrammingVisibility) - { - (static_cast(context))->OnSuccessResponse_14(scheduleProgrammingVisibility); - } - - static void OnFailureCallback_15(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_15(status); - } - - static void OnSuccessCallback_15(void * context, uint8_t scheduleProgrammingVisibility) - { - (static_cast(context))->OnSuccessResponse_15(scheduleProgrammingVisibility); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo>( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint8_t temperatureDisplayMode) - { - VerifyOrReturn(CheckValue("temperatureDisplayMode", temperatureDisplayMode, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo>( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint8_t temperatureDisplayMode) - { - VerifyOrReturn(CheckConstraintType("temperatureDisplayMode", "", "enum8")); - - NextTest(); - } - - CHIP_ERROR TestWriteToTheMandatoryAttributeTemperatureDisplayMode_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t temperatureDisplayModeArgument; - temperatureDisplayModeArgument = 0; - - ReturnErrorOnFailure( - cluster.WriteAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo>( - temperatureDisplayModeArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo>( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint8_t temperatureDisplayMode) - { - VerifyOrReturn(CheckValue("temperatureDisplayMode", temperatureDisplayMode, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo>( - this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(uint8_t temperatureDisplayMode) - { - VerifyOrReturn(CheckConstraintType("temperatureDisplayMode", "", "enum8")); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(uint8_t keypadLockout) - { - VerifyOrReturn(CheckValue("keypadLockout", keypadLockout, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(uint8_t keypadLockout) - { - VerifyOrReturn(CheckConstraintType("keypadLockout", "", "enum8")); - - NextTest(); - } - - CHIP_ERROR TestWriteToTheMandatoryAttributeKeypadLockout_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t keypadLockoutArgument; - keypadLockoutArgument = 0; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - keypadLockoutArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8() { NextTest(); } - - CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9(uint8_t keypadLockout) - { - VerifyOrReturn(CheckValue("keypadLockout", keypadLockout, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_10() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_10, OnFailureCallback_10)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10(uint8_t keypadLockout) - { - VerifyOrReturn(CheckConstraintType("keypadLockout", "", "enum8")); - - NextTest(); - } - - CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_11() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( - this, OnSuccessCallback_11, OnFailureCallback_11)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_11(uint8_t scheduleProgrammingVisibility) - { - VerifyOrReturn(CheckValue("scheduleProgrammingVisibility", scheduleProgrammingVisibility, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_12() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( - this, OnSuccessCallback_12, OnFailureCallback_12)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_12(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_12(uint8_t scheduleProgrammingVisibility) - { - VerifyOrReturn(CheckConstraintType("scheduleProgrammingVisibility", "", "enum8")); - - NextTest(); - } - - CHIP_ERROR TestWriteToTheMandatoryAttributeScheduleProgrammingVisibility_13() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t scheduleProgrammingVisibilityArgument; - scheduleProgrammingVisibilityArgument = 0; - - ReturnErrorOnFailure( - cluster.WriteAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( - scheduleProgrammingVisibilityArgument, this, OnSuccessCallback_13, OnFailureCallback_13)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_13(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_13() { NextTest(); } - - CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_14() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( - this, OnSuccessCallback_14, OnFailureCallback_14)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_14(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_14(uint8_t scheduleProgrammingVisibility) - { - VerifyOrReturn(CheckValue("scheduleProgrammingVisibility", scheduleProgrammingVisibility, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_15() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( - this, OnSuccessCallback_15, OnFailureCallback_15)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_15(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_15(uint8_t scheduleProgrammingVisibility) - { - VerifyOrReturn(CheckConstraintType("scheduleProgrammingVisibility", "", "enum8")); - - NextTest(); - } -}; - -class Test_TC_TSUIC_2_2 : public TestCommand -{ -public: - Test_TC_TSUIC_2_2() : TestCommand("Test_TC_TSUIC_2_2"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSUIC_2_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSUIC_2_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 : Writes a value of 0 to TemperatureDisplayMode attribute of DUT\n"); - err = ShouldSkip("A_TEMPERATURE_DISPLAY_MODE") ? CHIP_NO_ERROR - : TestWritesAValueOf0ToTemperatureDisplayModeAttributeOfDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Writes a value of 1 to TemperatureDisplayMode attribute of DUT\n"); - err = ShouldSkip("A_TEMPERATURE_DISPLAY_MODE") ? CHIP_NO_ERROR - : TestWritesAValueOf1ToTemperatureDisplayModeAttributeOfDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Writes a value of 0 to KeypadLockout attribute of DUT\n"); - err = ShouldSkip("A_KEYPAD_LOCKOUT") ? CHIP_NO_ERROR : TestWritesAValueOf0ToKeypadLockoutAttributeOfDut_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Writes a value of 1 to KeypadLockout attribute of DUT\n"); - err = ShouldSkip("A_KEYPAD_LOCKOUT") ? CHIP_NO_ERROR : TestWritesAValueOf1ToKeypadLockoutAttributeOfDut_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Writes a value of 2 to KeypadLockout attribute of DUT\n"); - err = ShouldSkip("A_KEYPAD_LOCKOUT") ? CHIP_NO_ERROR : TestWritesAValueOf2ToKeypadLockoutAttributeOfDut_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Writes a value of 3 to KeypadLockout attribute of DUT\n"); - err = ShouldSkip("A_KEYPAD_LOCKOUT") ? CHIP_NO_ERROR : TestWritesAValueOf3ToKeypadLockoutAttributeOfDut_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Writes a value of 4 to KeypadLockout attribute of DUT\n"); - err = ShouldSkip("A_KEYPAD_LOCKOUT") ? CHIP_NO_ERROR : TestWritesAValueOf4ToKeypadLockoutAttributeOfDut_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Writes a value of 5 to KeypadLockout attribute of DUT\n"); - err = ShouldSkip("A_KEYPAD_LOCKOUT") ? CHIP_NO_ERROR : TestWritesAValueOf5ToKeypadLockoutAttributeOfDut_8(); - break; - case 9: - ChipLogProgress(chipTool, - " ***** Test Step 9 : Writes a value of 0 to ScheduleProgrammingVisibility attribute of DUT\n"); - err = ShouldSkip("A_SCHEDULE_PROGRAMMING_VISIBILITY") - ? CHIP_NO_ERROR - : TestWritesAValueOf0ToScheduleProgrammingVisibilityAttributeOfDut_9(); - break; - case 10: - ChipLogProgress(chipTool, - " ***** Test Step 10 : Writes a value of 1 to ScheduleProgrammingVisibility attribute of DUT\n"); - err = ShouldSkip("A_SCHEDULE_PROGRAMMING_VISIBILITY") - ? CHIP_NO_ERROR - : TestWritesAValueOf1ToScheduleProgrammingVisibilityAttributeOfDut_10(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 11; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } - - static void OnFailureCallback_9(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context) { (static_cast(context))->OnSuccessResponse_9(); } - - static void OnFailureCallback_10(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_10(status); - } - - static void OnSuccessCallback_10(void * context) { (static_cast(context))->OnSuccessResponse_10(); } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestWritesAValueOf0ToTemperatureDisplayModeAttributeOfDut_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t temperatureDisplayModeArgument; - temperatureDisplayModeArgument = 0; - - ReturnErrorOnFailure( - cluster.WriteAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo>( - temperatureDisplayModeArgument, this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestWritesAValueOf1ToTemperatureDisplayModeAttributeOfDut_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t temperatureDisplayModeArgument; - temperatureDisplayModeArgument = 1; - - ReturnErrorOnFailure( - cluster.WriteAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo>( - temperatureDisplayModeArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2() { NextTest(); } - - CHIP_ERROR TestWritesAValueOf0ToKeypadLockoutAttributeOfDut_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t keypadLockoutArgument; - keypadLockoutArgument = 0; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - keypadLockoutArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestWritesAValueOf1ToKeypadLockoutAttributeOfDut_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t keypadLockoutArgument; - keypadLockoutArgument = 1; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - keypadLockoutArgument, this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestWritesAValueOf2ToKeypadLockoutAttributeOfDut_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t keypadLockoutArgument; - keypadLockoutArgument = 2; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - keypadLockoutArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestWritesAValueOf3ToKeypadLockoutAttributeOfDut_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t keypadLockoutArgument; - keypadLockoutArgument = 3; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - keypadLockoutArgument, this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6() { NextTest(); } - - CHIP_ERROR TestWritesAValueOf4ToKeypadLockoutAttributeOfDut_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t keypadLockoutArgument; - keypadLockoutArgument = 4; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - keypadLockoutArgument, this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7() { NextTest(); } - - CHIP_ERROR TestWritesAValueOf5ToKeypadLockoutAttributeOfDut_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t keypadLockoutArgument; - keypadLockoutArgument = 5; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - keypadLockoutArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8() { NextTest(); } - - CHIP_ERROR TestWritesAValueOf0ToScheduleProgrammingVisibilityAttributeOfDut_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t scheduleProgrammingVisibilityArgument; - scheduleProgrammingVisibilityArgument = 0; - - ReturnErrorOnFailure( - cluster.WriteAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( - scheduleProgrammingVisibilityArgument, this, OnSuccessCallback_9, OnFailureCallback_9)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9() { NextTest(); } - - CHIP_ERROR TestWritesAValueOf1ToScheduleProgrammingVisibilityAttributeOfDut_10() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t scheduleProgrammingVisibilityArgument; - scheduleProgrammingVisibilityArgument = 1; - - ReturnErrorOnFailure( - cluster.WriteAttribute< - chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( - scheduleProgrammingVisibilityArgument, this, OnSuccessCallback_10, OnFailureCallback_10)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10() { NextTest(); } -}; - -class Test_TC_DIAGTH_1_1 : public TestCommand -{ -public: - Test_TC_DIAGTH_1_1() : TestCommand("Test_TC_DIAGTH_1_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DIAGTH_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DIAGTH_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 : 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; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_2(clusterRevision); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_4(clusterRevision); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint16_t clusterRevision) - { - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - - NextTest(); - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 1U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_3() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); - - NextTest(); - } -}; - -class Test_TC_WNCV_1_1 : public TestCommand -{ -public: - Test_TC_WNCV_1_1() : TestCommand("Test_TC_WNCV_1_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_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 : 2: read the global attribute: ClusterRevision\n"); - err = Test2ReadTheGlobalAttributeClusterRevision_1(); - break; - case 2: - ChipLogProgress(chipTool, - " ***** Test Step 2 : 3a: write a value into the RO mandatory global attribute: ClusterRevision\n"); - err = Test3aWriteAValueIntoTheRoMandatoryGlobalAttributeClusterRevision_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : 3b: reads back global attribute: ClusterRevision\n"); - err = Test3bReadsBackGlobalAttributeClusterRevision_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : 2: read the global attribute: FeatureMap\n"); - err = Test2ReadTheGlobalAttributeFeatureMap_4(); - break; - case 5: - ChipLogProgress(chipTool, - " ***** Test Step 5 : 3a: write the default value to optional global attribute: FeatureMap\n"); - err = Test3aWriteTheDefaultValueToOptionalGlobalAttributeFeatureMap_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : 3b: reads back global attribute: FeatureMap\n"); - err = Test3bReadsBackGlobalAttributeFeatureMap_6(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_3(clusterRevision); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint32_t featureMap) - { - (static_cast(context))->OnSuccessResponse_4(featureMap); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, uint32_t featureMap) - { - (static_cast(context))->OnSuccessResponse_6(featureMap); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR Test2ReadTheGlobalAttributeClusterRevision_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint16_t clusterRevision) - { - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - VerifyOrReturn(CheckConstraintMinValue("clusterRevision", clusterRevision, 5U)); - VerifyOrReturn(CheckConstraintMaxValue("clusterRevision", clusterRevision, 200U)); - - NextTest(); - } - - CHIP_ERROR Test3aWriteAValueIntoTheRoMandatoryGlobalAttributeClusterRevision_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 201U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_2() { ThrowSuccessResponse(); } - - CHIP_ERROR Test3bReadsBackGlobalAttributeClusterRevision_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(uint16_t clusterRevision) - { - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - VerifyOrReturn(CheckConstraintNotValue("clusterRevision", clusterRevision, 201U)); - - NextTest(); - } - - CHIP_ERROR Test2ReadTheGlobalAttributeFeatureMap_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint32_t featureMap) - { - VerifyOrReturn(CheckConstraintType("featureMap", "", "uint32")); - VerifyOrReturn(CheckConstraintMaxValue("featureMap", featureMap, 32768UL)); - - NextTest(); - } - - CHIP_ERROR Test3aWriteTheDefaultValueToOptionalGlobalAttributeFeatureMap_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint32_t featureMapArgument; - featureMapArgument = 32769UL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - featureMapArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_5() { ThrowSuccessResponse(); } - - CHIP_ERROR Test3bReadsBackGlobalAttributeFeatureMap_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(uint32_t featureMap) - { - VerifyOrReturn(CheckConstraintType("featureMap", "", "uint32")); - VerifyOrReturn(CheckConstraintNotValue("featureMap", featureMap, 32769UL)); - - NextTest(); - } -}; - -class Test_TC_WNCV_2_1 : public TestCommand -{ -public: - Test_TC_WNCV_2_1() : TestCommand("Test_TC_WNCV_2_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_2_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_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 : 2: read the RO mandatory attribute default: Type\n"); - err = Test2ReadTheRoMandatoryAttributeDefaultType_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : 3a: write a value into the RO mandatory attribute: Type\n"); - err = Test3aWriteAValueIntoTheRoMandatoryAttributeType_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : 3b: reads back the RO mandatory attribute: Type\n"); - err = Test3bReadsBackTheRoMandatoryAttributeType_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : 2: read the RO mandatory attribute default: ConfigStatus\n"); - err = Test2ReadTheRoMandatoryAttributeDefaultConfigStatus_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : 3a: write a value into the RO mandatory attribute: ConfigStatus\n"); - err = Test3aWriteAValueIntoTheRoMandatoryAttributeConfigStatus_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : 3b: reads back the RO mandatory attribute: ConfigStatus\n"); - err = Test3bReadsBackTheRoMandatoryAttributeConfigStatus_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : 2: read the RO mandatory attribute default: OperationalStatus\n"); - err = Test2ReadTheRoMandatoryAttributeDefaultOperationalStatus_7(); - break; - case 8: - ChipLogProgress(chipTool, - " ***** Test Step 8 : 3a: write a value into the RO mandatory attribute: OperationalStatus\n"); - err = Test3aWriteAValueIntoTheRoMandatoryAttributeOperationalStatus_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : 3b: reads back the RO mandatory attribute: OperationalStatus\n"); - err = Test3bReadsBackTheRoMandatoryAttributeOperationalStatus_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : 2: read the RO mandatory attribute default: EndProductType\n"); - err = Test2ReadTheRoMandatoryAttributeDefaultEndProductType_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : 3a: write a value into the RO mandatory attribute: EndProductType\n"); - err = Test3aWriteAValueIntoTheRoMandatoryAttributeEndProductType_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : 3b: reads back the RO mandatory attribute: EndProductType\n"); - err = Test3bReadsBackTheRoMandatoryAttributeEndProductType_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : 2: read the RW mandatory attribute default: Mode\n"); - err = Test2ReadTheRwMandatoryAttributeDefaultMode_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : 3a: write a value into the RW mandatory attribute:: Mode\n"); - err = Test3aWriteAValueIntoTheRwMandatoryAttributeMode_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : 3b: reads back the RW mandatory attribute: Mode\n"); - err = Test3bReadsBackTheRwMandatoryAttributeMode_15(); - break; - case 16: - ChipLogProgress(chipTool, - " ***** Test Step 16 : 2: read the RO optional attribute default: TargetPositionLiftPercent100ths\n"); - err = Test2ReadTheRoOptionalAttributeDefaultTargetPositionLiftPercent100ths_16(); - break; - case 17: - ChipLogProgress( - chipTool, - " ***** Test Step 17 : 3a: write a value into the RO optional attribute: TargetPositionLiftPercent100ths\n"); - err = Test3aWriteAValueIntoTheRoOptionalAttributeTargetPositionLiftPercent100ths_17(); - break; - case 18: - ChipLogProgress(chipTool, - " ***** Test Step 18 : 3b: reads back the RO optional attribute: TargetPositionLiftPercent100ths\n"); - err = Test3bReadsBackTheRoOptionalAttributeTargetPositionLiftPercent100ths_18(); - break; - case 19: - ChipLogProgress(chipTool, - " ***** Test Step 19 : 2: read the RO optional attribute default: TargetPositionTiltPercent100ths\n"); - err = Test2ReadTheRoOptionalAttributeDefaultTargetPositionTiltPercent100ths_19(); - break; - case 20: - ChipLogProgress( - chipTool, - " ***** Test Step 20 : 3a: write a value into the RO optional attribute: TargetPositionTiltPercent100ths\n"); - err = Test3aWriteAValueIntoTheRoOptionalAttributeTargetPositionTiltPercent100ths_20(); - break; - case 21: - ChipLogProgress(chipTool, - " ***** Test Step 21 : 3b: reads back the RO optional attribute: TargetPositionTiltPercent100ths\n"); - err = Test3bReadsBackTheRoOptionalAttributeTargetPositionTiltPercent100ths_21(); - break; - case 22: - ChipLogProgress(chipTool, - " ***** Test Step 22 : 2: read the RO optional attribute default: CurrentPositionLiftPercent100ths\n"); - err = Test2ReadTheRoOptionalAttributeDefaultCurrentPositionLiftPercent100ths_22(); - break; - case 23: - ChipLogProgress( - chipTool, - " ***** Test Step 23 : 3a: write a value into the RO optional attribute: CurrentPositionLiftPercent100ths\n"); - err = Test3aWriteAValueIntoTheRoOptionalAttributeCurrentPositionLiftPercent100ths_23(); - break; - case 24: - ChipLogProgress(chipTool, - " ***** Test Step 24 : 3b: reads back the RO optional attribute: CurrentPositionLiftPercent100ths\n"); - err = Test3bReadsBackTheRoOptionalAttributeCurrentPositionLiftPercent100ths_24(); - break; - case 25: - ChipLogProgress(chipTool, - " ***** Test Step 25 : 2: read the RO optional attribute default: CurrentPositionTiltPercent100ths\n"); - err = Test2ReadTheRoOptionalAttributeDefaultCurrentPositionTiltPercent100ths_25(); - break; - case 26: - ChipLogProgress( - chipTool, - " ***** Test Step 26 : 3a: write a value into the RO optional attribute: CurrentPositionTiltPercent100ths\n"); - err = Test3aWriteAValueIntoTheRoOptionalAttributeCurrentPositionTiltPercent100ths_26(); - break; - case 27: - ChipLogProgress(chipTool, - " ***** Test Step 27 : 3b: reads back the RO optional attribute: CurrentPositionTiltPercent100ths\n"); - err = Test3bReadsBackTheRoOptionalAttributeCurrentPositionTiltPercent100ths_27(); - break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : 2: read the RO optional attribute default: InstalledOpenLimitLift\n"); - err = Test2ReadTheRoOptionalAttributeDefaultInstalledOpenLimitLift_28(); - break; - case 29: - ChipLogProgress(chipTool, - " ***** Test Step 29 : 3a: write a value into the RO optional attribute: InstalledOpenLimitLift\n"); - err = Test3aWriteAValueIntoTheRoOptionalAttributeInstalledOpenLimitLift_29(); - break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : 3b: reads back the RO optional attribute: InstalledOpenLimitLift\n"); - err = Test3bReadsBackTheRoOptionalAttributeInstalledOpenLimitLift_30(); - break; - case 31: - ChipLogProgress(chipTool, - " ***** Test Step 31 : 2: read the RO optional attribute default: InstalledClosedLimitLift\n"); - err = Test2ReadTheRoOptionalAttributeDefaultInstalledClosedLimitLift_31(); - break; - case 32: - ChipLogProgress(chipTool, - " ***** Test Step 32 : 3a: write a value into the RO optional attribute: InstalledClosedLimitLift\n"); - err = Test3aWriteAValueIntoTheRoOptionalAttributeInstalledClosedLimitLift_32(); - break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : 3b: reads back the RO optional attribute: InstalledClosedLimitLift\n"); - err = Test3bReadsBackTheRoOptionalAttributeInstalledClosedLimitLift_33(); - break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : 2: read the RO optional attribute default: InstalledOpenLimitTilt\n"); - err = Test2ReadTheRoOptionalAttributeDefaultInstalledOpenLimitTilt_34(); - break; - case 35: - ChipLogProgress(chipTool, - " ***** Test Step 35 : 3a: write a value into the RO optional attribute: InstalledOpenLimitTilt\n"); - err = Test3aWriteAValueIntoTheRoOptionalAttributeInstalledOpenLimitTilt_35(); - break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : 3b: reads back the RO optional attribute: InstalledOpenLimitTilt\n"); - err = Test3bReadsBackTheRoOptionalAttributeInstalledOpenLimitTilt_36(); - break; - case 37: - ChipLogProgress(chipTool, - " ***** Test Step 37 : 2: read the RO optional attribute default: InstalledClosedLimitTilt\n"); - err = Test2ReadTheRoOptionalAttributeDefaultInstalledClosedLimitTilt_37(); - break; - case 38: - ChipLogProgress(chipTool, - " ***** Test Step 38 : 3a: write a value into the RO optional attribute: InstalledClosedLimitTilt\n"); - err = Test3aWriteAValueIntoTheRoOptionalAttributeInstalledClosedLimitTilt_38(); - break; - case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : 3b: reads back the RO optional attribute: InstalledClosedLimitTilt\n"); - err = Test3bReadsBackTheRoOptionalAttributeInstalledClosedLimitTilt_39(); - break; - case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : 4: read the RO mandatory attribute default: SafetyStatus\n"); - err = Test4ReadTheRoMandatoryAttributeDefaultSafetyStatus_40(); - break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : 5a: write a value into the RO mandatory attribute: SafetyStatus\n"); - err = Test5aWriteAValueIntoTheRoMandatoryAttributeSafetyStatus_41(); - break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : 5b: reads back the RO mandatory attribute: SafetyStatus\n"); - err = Test5bReadsBackTheRoMandatoryAttributeSafetyStatus_42(); - break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : 4: read the RO optional attribute default: CurrentPositionLift\n"); - err = Test4ReadTheRoOptionalAttributeDefaultCurrentPositionLift_43(); - break; - case 44: - ChipLogProgress(chipTool, - " ***** Test Step 44 : 5a: write a value into the RO optional attribute: CurrentPositionLift\n"); - err = Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionLift_44(); - break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : 5b: reads back the RO optional attribute: CurrentPositionLift\n"); - err = Test5bReadsBackTheRoOptionalAttributeCurrentPositionLift_45(); - break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : 4: read the RO optional attribute default: CurrentPositionTilt\n"); - err = Test4ReadTheRoOptionalAttributeDefaultCurrentPositionTilt_46(); - break; - case 47: - ChipLogProgress(chipTool, - " ***** Test Step 47 : 5a: write a value into the RO optional attribute: CurrentPositionTilt\n"); - err = Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionTilt_47(); - break; - case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : 5b: reads back the RO optional attribute: CurrentPositionTilt\n"); - err = Test5bReadsBackTheRoOptionalAttributeCurrentPositionTilt_48(); - break; - case 49: - ChipLogProgress(chipTool, - " ***** Test Step 49 : 4: read the RO optional attribute default: CurrentPositionLiftPercentage\n"); - err = Test4ReadTheRoOptionalAttributeDefaultCurrentPositionLiftPercentage_49(); - break; - case 50: - ChipLogProgress( - chipTool, - " ***** Test Step 50 : 5a: write a value into the RO optional attribute: CurrentPositionLiftPercentage\n"); - err = Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionLiftPercentage_50(); - break; - case 51: - ChipLogProgress(chipTool, - " ***** Test Step 51 : 5b: reads back the RO optional attribute: CurrentPositionLiftPercentage\n"); - err = Test5bReadsBackTheRoOptionalAttributeCurrentPositionLiftPercentage_51(); - break; - case 52: - ChipLogProgress(chipTool, - " ***** Test Step 52 : 4: read the RO optional attribute default: CurrentPositionTiltPercentage\n"); - err = Test4ReadTheRoOptionalAttributeDefaultCurrentPositionTiltPercentage_52(); - break; - case 53: - ChipLogProgress( - chipTool, - " ***** Test Step 53 : 5a: write a value into the RO optional attribute: CurrentPositionTiltPercentage\n"); - err = Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionTiltPercentage_53(); - break; - case 54: - ChipLogProgress(chipTool, - " ***** Test Step 54 : 5b: reads back the RO optional attribute: CurrentPositionTiltPercentage\n"); - err = Test5bReadsBackTheRoOptionalAttributeCurrentPositionTiltPercentage_54(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 55; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint8_t type) - { - (static_cast(context))->OnSuccessResponse_1(type); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, uint8_t type) - { - (static_cast(context))->OnSuccessResponse_3(type); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint8_t configStatus) - { - (static_cast(context))->OnSuccessResponse_4(configStatus); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, uint8_t configStatus) - { - (static_cast(context))->OnSuccessResponse_6(configStatus); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, uint8_t operationalStatus) - { - (static_cast(context))->OnSuccessResponse_7(operationalStatus); - } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } - - static void OnFailureCallback_9(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context, uint8_t operationalStatus) - { - (static_cast(context))->OnSuccessResponse_9(operationalStatus); - } - - static void OnFailureCallback_10(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_10(status); - } - - static void OnSuccessCallback_10(void * context, uint8_t endProductType) - { - (static_cast(context))->OnSuccessResponse_10(endProductType); - } - - static void OnFailureCallback_11(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_11(status); - } - - static void OnSuccessCallback_11(void * context) { (static_cast(context))->OnSuccessResponse_11(); } - - static void OnFailureCallback_12(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_12(status); - } - - static void OnSuccessCallback_12(void * context, uint8_t endProductType) - { - (static_cast(context))->OnSuccessResponse_12(endProductType); - } - - static void OnFailureCallback_13(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_13(status); - } - - static void OnSuccessCallback_13(void * context, uint8_t mode) - { - (static_cast(context))->OnSuccessResponse_13(mode); - } - - static void OnFailureCallback_14(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_14(status); - } - - static void OnSuccessCallback_14(void * context) { (static_cast(context))->OnSuccessResponse_14(); } - - static void OnFailureCallback_15(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_15(status); - } - - static void OnSuccessCallback_15(void * context, uint8_t mode) - { - (static_cast(context))->OnSuccessResponse_15(mode); - } - - static void OnFailureCallback_16(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_16(status); - } - - static void OnSuccessCallback_16(void * context, uint16_t targetPositionLiftPercent100ths) - { - (static_cast(context))->OnSuccessResponse_16(targetPositionLiftPercent100ths); - } - - static void OnFailureCallback_17(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_17(status); - } - - static void OnSuccessCallback_17(void * context) { (static_cast(context))->OnSuccessResponse_17(); } - - static void OnFailureCallback_18(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_18(status); - } - - static void OnSuccessCallback_18(void * context, uint16_t targetPositionLiftPercent100ths) - { - (static_cast(context))->OnSuccessResponse_18(targetPositionLiftPercent100ths); - } - - static void OnFailureCallback_19(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_19(status); - } - - static void OnSuccessCallback_19(void * context, uint16_t targetPositionTiltPercent100ths) - { - (static_cast(context))->OnSuccessResponse_19(targetPositionTiltPercent100ths); - } - - static void OnFailureCallback_20(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_20(status); - } - - static void OnSuccessCallback_20(void * context) { (static_cast(context))->OnSuccessResponse_20(); } - - static void OnFailureCallback_21(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_21(status); - } - - static void OnSuccessCallback_21(void * context, uint16_t targetPositionTiltPercent100ths) - { - (static_cast(context))->OnSuccessResponse_21(targetPositionTiltPercent100ths); - } - - static void OnFailureCallback_22(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_22(status); - } - - static void OnSuccessCallback_22(void * context, uint16_t currentPositionLiftPercent100ths) - { - (static_cast(context))->OnSuccessResponse_22(currentPositionLiftPercent100ths); - } - - static void OnFailureCallback_23(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_23(status); - } - - static void OnSuccessCallback_23(void * context) { (static_cast(context))->OnSuccessResponse_23(); } - - static void OnFailureCallback_24(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_24(status); - } - - static void OnSuccessCallback_24(void * context, uint16_t currentPositionLiftPercent100ths) - { - (static_cast(context))->OnSuccessResponse_24(currentPositionLiftPercent100ths); - } - - static void OnFailureCallback_25(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_25(status); - } - - static void OnSuccessCallback_25(void * context, uint16_t currentPositionTiltPercent100ths) - { - (static_cast(context))->OnSuccessResponse_25(currentPositionTiltPercent100ths); - } - - static void OnFailureCallback_26(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_26(status); - } - - static void OnSuccessCallback_26(void * context) { (static_cast(context))->OnSuccessResponse_26(); } - - static void OnFailureCallback_27(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_27(status); - } - - static void OnSuccessCallback_27(void * context, uint16_t currentPositionTiltPercent100ths) - { - (static_cast(context))->OnSuccessResponse_27(currentPositionTiltPercent100ths); - } - - static void OnFailureCallback_28(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_28(status); - } - - static void OnSuccessCallback_28(void * context, uint16_t installedOpenLimitLift) - { - (static_cast(context))->OnSuccessResponse_28(installedOpenLimitLift); - } - - static void OnFailureCallback_29(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_29(status); - } - - static void OnSuccessCallback_29(void * context) { (static_cast(context))->OnSuccessResponse_29(); } - - static void OnFailureCallback_30(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_30(status); - } - - static void OnSuccessCallback_30(void * context, uint16_t installedOpenLimitLift) - { - (static_cast(context))->OnSuccessResponse_30(installedOpenLimitLift); - } - - static void OnFailureCallback_31(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_31(status); - } - - static void OnSuccessCallback_31(void * context, uint16_t installedClosedLimitLift) - { - (static_cast(context))->OnSuccessResponse_31(installedClosedLimitLift); - } - - static void OnFailureCallback_32(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_32(status); - } - - static void OnSuccessCallback_32(void * context) { (static_cast(context))->OnSuccessResponse_32(); } - - static void OnFailureCallback_33(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_33(status); - } - - static void OnSuccessCallback_33(void * context, uint16_t installedClosedLimitLift) - { - (static_cast(context))->OnSuccessResponse_33(installedClosedLimitLift); - } - - static void OnFailureCallback_34(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_34(status); - } - - static void OnSuccessCallback_34(void * context, uint16_t installedOpenLimitTilt) - { - (static_cast(context))->OnSuccessResponse_34(installedOpenLimitTilt); - } - - static void OnFailureCallback_35(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_35(status); - } - - static void OnSuccessCallback_35(void * context) { (static_cast(context))->OnSuccessResponse_35(); } - - static void OnFailureCallback_36(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_36(status); - } - - static void OnSuccessCallback_36(void * context, uint16_t installedOpenLimitTilt) - { - (static_cast(context))->OnSuccessResponse_36(installedOpenLimitTilt); - } - - static void OnFailureCallback_37(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_37(status); - } - - static void OnSuccessCallback_37(void * context, uint16_t installedClosedLimitTilt) - { - (static_cast(context))->OnSuccessResponse_37(installedClosedLimitTilt); - } - - static void OnFailureCallback_38(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_38(status); - } - - static void OnSuccessCallback_38(void * context) { (static_cast(context))->OnSuccessResponse_38(); } - - static void OnFailureCallback_39(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_39(status); - } - - static void OnSuccessCallback_39(void * context, uint16_t installedClosedLimitTilt) - { - (static_cast(context))->OnSuccessResponse_39(installedClosedLimitTilt); - } - - static void OnFailureCallback_40(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_40(status); - } - - static void OnSuccessCallback_40(void * context, uint16_t safetyStatus) - { - (static_cast(context))->OnSuccessResponse_40(safetyStatus); - } - - static void OnFailureCallback_41(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_41(status); - } - - static void OnSuccessCallback_41(void * context) { (static_cast(context))->OnSuccessResponse_41(); } - - static void OnFailureCallback_42(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_42(status); - } - - static void OnSuccessCallback_42(void * context, uint16_t safetyStatus) - { - (static_cast(context))->OnSuccessResponse_42(safetyStatus); - } - - static void OnFailureCallback_43(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_43(status); - } - - static void OnSuccessCallback_43(void * context, uint16_t currentPositionLift) - { - (static_cast(context))->OnSuccessResponse_43(currentPositionLift); - } - - static void OnFailureCallback_44(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_44(status); - } - - static void OnSuccessCallback_44(void * context) { (static_cast(context))->OnSuccessResponse_44(); } - - static void OnFailureCallback_45(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_45(status); - } - - static void OnSuccessCallback_45(void * context, uint16_t currentPositionLift) - { - (static_cast(context))->OnSuccessResponse_45(currentPositionLift); - } - - static void OnFailureCallback_46(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_46(status); - } - - static void OnSuccessCallback_46(void * context, uint16_t currentPositionTilt) - { - (static_cast(context))->OnSuccessResponse_46(currentPositionTilt); - } - - static void OnFailureCallback_47(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_47(status); - } - - static void OnSuccessCallback_47(void * context) { (static_cast(context))->OnSuccessResponse_47(); } - - static void OnFailureCallback_48(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_48(status); - } - - static void OnSuccessCallback_48(void * context, uint16_t currentPositionTilt) - { - (static_cast(context))->OnSuccessResponse_48(currentPositionTilt); - } - - static void OnFailureCallback_49(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_49(status); - } - - static void OnSuccessCallback_49(void * context, uint8_t currentPositionLiftPercentage) - { - (static_cast(context))->OnSuccessResponse_49(currentPositionLiftPercentage); - } - - static void OnFailureCallback_50(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_50(status); - } - - static void OnSuccessCallback_50(void * context) { (static_cast(context))->OnSuccessResponse_50(); } - - static void OnFailureCallback_51(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_51(status); - } - - static void OnSuccessCallback_51(void * context, uint8_t currentPositionLiftPercentage) - { - (static_cast(context))->OnSuccessResponse_51(currentPositionLiftPercentage); - } - - static void OnFailureCallback_52(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_52(status); - } - - static void OnSuccessCallback_52(void * context, uint8_t currentPositionTiltPercentage) - { - (static_cast(context))->OnSuccessResponse_52(currentPositionTiltPercentage); - } - - static void OnFailureCallback_53(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_53(status); - } - - static void OnSuccessCallback_53(void * context) { (static_cast(context))->OnSuccessResponse_53(); } - - static void OnFailureCallback_54(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_54(status); - } - - static void OnSuccessCallback_54(void * context, uint8_t currentPositionTiltPercentage) - { - (static_cast(context))->OnSuccessResponse_54(currentPositionTiltPercentage); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR Test2ReadTheRoMandatoryAttributeDefaultType_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint8_t type) - { - VerifyOrReturn(CheckConstraintType("type", "", "enum8")); - VerifyOrReturn(CheckConstraintMaxValue("type", type, 9)); - - NextTest(); - } - - CHIP_ERROR Test3aWriteAValueIntoTheRoMandatoryAttributeType_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t typeArgument; - typeArgument = 250; - - ReturnErrorOnFailure(cluster.WriteAttribute( - typeArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_2() { ThrowSuccessResponse(); } - - CHIP_ERROR Test3bReadsBackTheRoMandatoryAttributeType_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(uint8_t type) - { - VerifyOrReturn(CheckConstraintType("type", "", "enum8")); - VerifyOrReturn(CheckConstraintNotValue("type", type, 250)); - - NextTest(); - } - - CHIP_ERROR Test2ReadTheRoMandatoryAttributeDefaultConfigStatus_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint8_t configStatus) - { - VerifyOrReturn(CheckConstraintType("configStatus", "", "map8")); - VerifyOrReturn(CheckConstraintMaxValue("configStatus", configStatus, 63)); - - NextTest(); - } - - CHIP_ERROR Test3aWriteAValueIntoTheRoMandatoryAttributeConfigStatus_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t configStatusArgument; - configStatusArgument = 128; - - ReturnErrorOnFailure(cluster.WriteAttribute( - configStatusArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_5() { ThrowSuccessResponse(); } - - CHIP_ERROR Test3bReadsBackTheRoMandatoryAttributeConfigStatus_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(uint8_t configStatus) - { - VerifyOrReturn(CheckConstraintType("configStatus", "", "map8")); - VerifyOrReturn(CheckConstraintNotValue("configStatus", configStatus, 128)); - - NextTest(); - } - - CHIP_ERROR Test2ReadTheRoMandatoryAttributeDefaultOperationalStatus_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(uint8_t operationalStatus) - { - VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); - VerifyOrReturn(CheckConstraintMaxValue("operationalStatus", operationalStatus, 63)); - - NextTest(); - } - - CHIP_ERROR Test3aWriteAValueIntoTheRoMandatoryAttributeOperationalStatus_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t operationalStatusArgument; - operationalStatusArgument = 128; - - ReturnErrorOnFailure(cluster.WriteAttribute( - operationalStatusArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_8() { ThrowSuccessResponse(); } - - CHIP_ERROR Test3bReadsBackTheRoMandatoryAttributeOperationalStatus_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9(uint8_t operationalStatus) - { - VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); - VerifyOrReturn(CheckConstraintNotValue("operationalStatus", operationalStatus, 128)); - - NextTest(); - } - - CHIP_ERROR Test2ReadTheRoMandatoryAttributeDefaultEndProductType_10() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_10, OnFailureCallback_10)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10(uint8_t endProductType) - { - VerifyOrReturn(CheckConstraintType("endProductType", "", "enum8")); - VerifyOrReturn(CheckConstraintMaxValue("endProductType", endProductType, 23)); - - NextTest(); - } - - CHIP_ERROR Test3aWriteAValueIntoTheRoMandatoryAttributeEndProductType_11() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t endProductTypeArgument; - endProductTypeArgument = 250; - - ReturnErrorOnFailure(cluster.WriteAttribute( - endProductTypeArgument, this, OnSuccessCallback_11, OnFailureCallback_11)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_11() { ThrowSuccessResponse(); } - - CHIP_ERROR Test3bReadsBackTheRoMandatoryAttributeEndProductType_12() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_12, OnFailureCallback_12)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_12(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_12(uint8_t endProductType) - { - VerifyOrReturn(CheckConstraintType("endProductType", "", "enum8")); - VerifyOrReturn(CheckConstraintNotValue("endProductType", endProductType, 250)); - - NextTest(); - } - - CHIP_ERROR Test2ReadTheRwMandatoryAttributeDefaultMode_13() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_13, OnFailureCallback_13)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_13(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_13(uint8_t mode) - { - VerifyOrReturn(CheckConstraintType("mode", "", "map8")); - VerifyOrReturn(CheckConstraintMaxValue("mode", mode, 15)); - - NextTest(); - } - - CHIP_ERROR Test3aWriteAValueIntoTheRwMandatoryAttributeMode_14() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t modeArgument; - modeArgument = 8; - - ReturnErrorOnFailure(cluster.WriteAttribute( - modeArgument, this, OnSuccessCallback_14, OnFailureCallback_14)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_14(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_14() { NextTest(); } - - CHIP_ERROR Test3bReadsBackTheRwMandatoryAttributeMode_15() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_15, OnFailureCallback_15)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_15(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_15(uint8_t mode) - { - VerifyOrReturn(CheckValue("mode", mode, 8)); - - NextTest(); - } - - CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultTargetPositionLiftPercent100ths_16() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_16, OnFailureCallback_16)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_16(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_16(uint16_t targetPositionLiftPercent100ths) - { - VerifyOrReturn(CheckConstraintType("targetPositionLiftPercent100ths", "", "uint16")); - VerifyOrReturn( - CheckConstraintMaxValue("targetPositionLiftPercent100ths", targetPositionLiftPercent100ths, 10000U)); - - NextTest(); - } - - CHIP_ERROR Test3aWriteAValueIntoTheRoOptionalAttributeTargetPositionLiftPercent100ths_17() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t targetPositionLiftPercent100thsArgument; - targetPositionLiftPercent100thsArgument = 20000U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - targetPositionLiftPercent100thsArgument, this, OnSuccessCallback_17, OnFailureCallback_17)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_17(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_17() { ThrowSuccessResponse(); } - - CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeTargetPositionLiftPercent100ths_18() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_18, OnFailureCallback_18)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_18(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_18(uint16_t targetPositionLiftPercent100ths) - { - VerifyOrReturn(CheckConstraintType("targetPositionLiftPercent100ths", "", "uint16")); - VerifyOrReturn(CheckConstraintNotValue("targetPositionLiftPercent100ths", targetPositionLiftPercent100ths, 20000U)); - - NextTest(); - } - - CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultTargetPositionTiltPercent100ths_19() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_19, OnFailureCallback_19)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_19(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_19(uint16_t targetPositionTiltPercent100ths) - { - VerifyOrReturn(CheckConstraintType("targetPositionTiltPercent100ths", "", "uint16")); - VerifyOrReturn( - CheckConstraintMaxValue("targetPositionTiltPercent100ths", targetPositionTiltPercent100ths, 10000U)); - - NextTest(); - } - - CHIP_ERROR Test3aWriteAValueIntoTheRoOptionalAttributeTargetPositionTiltPercent100ths_20() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t targetPositionTiltPercent100thsArgument; - targetPositionTiltPercent100thsArgument = 20000U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - targetPositionTiltPercent100thsArgument, this, OnSuccessCallback_20, OnFailureCallback_20)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_20(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_20() { ThrowSuccessResponse(); } - - CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeTargetPositionTiltPercent100ths_21() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_21, OnFailureCallback_21)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_21(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_21(uint16_t targetPositionTiltPercent100ths) - { - VerifyOrReturn(CheckConstraintType("targetPositionTiltPercent100ths", "", "uint16")); - VerifyOrReturn(CheckConstraintNotValue("targetPositionTiltPercent100ths", targetPositionTiltPercent100ths, 20000U)); - - NextTest(); - } - - CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultCurrentPositionLiftPercent100ths_22() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_22, OnFailureCallback_22)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_22(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_22(uint16_t currentPositionLiftPercent100ths) - { - VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "uint16")); - VerifyOrReturn( - CheckConstraintMaxValue("currentPositionLiftPercent100ths", currentPositionLiftPercent100ths, 10000U)); - - NextTest(); - } - - CHIP_ERROR Test3aWriteAValueIntoTheRoOptionalAttributeCurrentPositionLiftPercent100ths_23() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t currentPositionLiftPercent100thsArgument; - currentPositionLiftPercent100thsArgument = 20000U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - currentPositionLiftPercent100thsArgument, this, OnSuccessCallback_23, OnFailureCallback_23)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_23(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_23() { ThrowSuccessResponse(); } - - CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeCurrentPositionLiftPercent100ths_24() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_24, OnFailureCallback_24)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_24(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_24(uint16_t currentPositionLiftPercent100ths) - { - VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "uint16")); - VerifyOrReturn(CheckConstraintNotValue("currentPositionLiftPercent100ths", currentPositionLiftPercent100ths, 20000U)); - - NextTest(); - } - - CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultCurrentPositionTiltPercent100ths_25() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_25, OnFailureCallback_25)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_25(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_25(uint16_t currentPositionTiltPercent100ths) - { - VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "uint16")); - VerifyOrReturn( - CheckConstraintMaxValue("currentPositionTiltPercent100ths", currentPositionTiltPercent100ths, 10000U)); - - NextTest(); - } - - CHIP_ERROR Test3aWriteAValueIntoTheRoOptionalAttributeCurrentPositionTiltPercent100ths_26() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t currentPositionTiltPercent100thsArgument; - currentPositionTiltPercent100thsArgument = 20000U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - currentPositionTiltPercent100thsArgument, this, OnSuccessCallback_26, OnFailureCallback_26)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_26(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_26() { ThrowSuccessResponse(); } - - CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeCurrentPositionTiltPercent100ths_27() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_27, OnFailureCallback_27)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_27(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_27(uint16_t currentPositionTiltPercent100ths) - { - VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "uint16")); - VerifyOrReturn(CheckConstraintNotValue("currentPositionTiltPercent100ths", currentPositionTiltPercent100ths, 20000U)); - - NextTest(); - } - - CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultInstalledOpenLimitLift_28() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_28, OnFailureCallback_28)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_28(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_28(uint16_t installedOpenLimitLift) - { - VerifyOrReturn(CheckConstraintType("installedOpenLimitLift", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitLift", installedOpenLimitLift, 65535U)); - - NextTest(); - } - - CHIP_ERROR Test3aWriteAValueIntoTheRoOptionalAttributeInstalledOpenLimitLift_29() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t installedOpenLimitLiftArgument; - installedOpenLimitLiftArgument = 255U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - installedOpenLimitLiftArgument, this, OnSuccessCallback_29, OnFailureCallback_29)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_29(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_29() { ThrowSuccessResponse(); } - - CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeInstalledOpenLimitLift_30() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_30, OnFailureCallback_30)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_30(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_30(uint16_t installedOpenLimitLift) - { - VerifyOrReturn(CheckConstraintType("installedOpenLimitLift", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitLift", installedOpenLimitLift, 65535U)); - - NextTest(); - } - - CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultInstalledClosedLimitLift_31() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_31, OnFailureCallback_31)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_31(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_31(uint16_t installedClosedLimitLift) - { - VerifyOrReturn(CheckConstraintType("installedClosedLimitLift", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitLift", installedClosedLimitLift, 65535U)); - - NextTest(); - } - - CHIP_ERROR Test3aWriteAValueIntoTheRoOptionalAttributeInstalledClosedLimitLift_32() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t installedClosedLimitLiftArgument; - installedClosedLimitLiftArgument = 255U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - installedClosedLimitLiftArgument, this, OnSuccessCallback_32, OnFailureCallback_32)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_32(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_32() { ThrowSuccessResponse(); } - - CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeInstalledClosedLimitLift_33() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_33, OnFailureCallback_33)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_33(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_33(uint16_t installedClosedLimitLift) - { - VerifyOrReturn(CheckConstraintType("installedClosedLimitLift", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitLift", installedClosedLimitLift, 65535U)); - - NextTest(); - } - - CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultInstalledOpenLimitTilt_34() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_34, OnFailureCallback_34)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_34(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_34(uint16_t installedOpenLimitTilt) - { - VerifyOrReturn(CheckConstraintType("installedOpenLimitTilt", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitTilt", installedOpenLimitTilt, 65535U)); - - NextTest(); - } - - CHIP_ERROR Test3aWriteAValueIntoTheRoOptionalAttributeInstalledOpenLimitTilt_35() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t installedOpenLimitTiltArgument; - installedOpenLimitTiltArgument = 255U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - installedOpenLimitTiltArgument, this, OnSuccessCallback_35, OnFailureCallback_35)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_35(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_35() { ThrowSuccessResponse(); } - - CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeInstalledOpenLimitTilt_36() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_36, OnFailureCallback_36)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_36(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_36(uint16_t installedOpenLimitTilt) - { - VerifyOrReturn(CheckConstraintType("installedOpenLimitTilt", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitTilt", installedOpenLimitTilt, 65535U)); - - NextTest(); - } - - CHIP_ERROR Test2ReadTheRoOptionalAttributeDefaultInstalledClosedLimitTilt_37() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_37, OnFailureCallback_37)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_37(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_37(uint16_t installedClosedLimitTilt) - { - VerifyOrReturn(CheckConstraintType("installedClosedLimitTilt", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitTilt", installedClosedLimitTilt, 65535U)); - - NextTest(); - } - - CHIP_ERROR Test3aWriteAValueIntoTheRoOptionalAttributeInstalledClosedLimitTilt_38() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t installedClosedLimitTiltArgument; - installedClosedLimitTiltArgument = 255U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - installedClosedLimitTiltArgument, this, OnSuccessCallback_38, OnFailureCallback_38)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_38(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_38() { ThrowSuccessResponse(); } - - CHIP_ERROR Test3bReadsBackTheRoOptionalAttributeInstalledClosedLimitTilt_39() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_39, OnFailureCallback_39)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_39(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_39(uint16_t installedClosedLimitTilt) - { - VerifyOrReturn(CheckConstraintType("installedClosedLimitTilt", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitTilt", installedClosedLimitTilt, 65535U)); - - NextTest(); - } - - CHIP_ERROR Test4ReadTheRoMandatoryAttributeDefaultSafetyStatus_40() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_40, OnFailureCallback_40)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_40(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_40(uint16_t safetyStatus) - { - VerifyOrReturn(CheckConstraintType("safetyStatus", "", "map16")); - VerifyOrReturn(CheckConstraintMaxValue("safetyStatus", safetyStatus, 2047U)); - - NextTest(); - } - - CHIP_ERROR Test5aWriteAValueIntoTheRoMandatoryAttributeSafetyStatus_41() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t safetyStatusArgument; - safetyStatusArgument = 4096U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - safetyStatusArgument, this, OnSuccessCallback_41, OnFailureCallback_41)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_41(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_41() { ThrowSuccessResponse(); } - - CHIP_ERROR Test5bReadsBackTheRoMandatoryAttributeSafetyStatus_42() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_42, OnFailureCallback_42)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_42(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_42(uint16_t safetyStatus) - { - VerifyOrReturn(CheckConstraintType("safetyStatus", "", "map16")); - VerifyOrReturn(CheckConstraintNotValue("safetyStatus", safetyStatus, 4096U)); - - NextTest(); - } - - CHIP_ERROR Test4ReadTheRoOptionalAttributeDefaultCurrentPositionLift_43() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_43, OnFailureCallback_43)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_43(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_43(uint16_t currentPositionLift) - { - VerifyOrReturn(CheckConstraintType("currentPositionLift", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("currentPositionLift", currentPositionLift, 65535U)); - - NextTest(); - } - - CHIP_ERROR Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionLift_44() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t currentPositionLiftArgument; - currentPositionLiftArgument = 255U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - currentPositionLiftArgument, this, OnSuccessCallback_44, OnFailureCallback_44)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_44(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_44() { ThrowSuccessResponse(); } - - CHIP_ERROR Test5bReadsBackTheRoOptionalAttributeCurrentPositionLift_45() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_45, OnFailureCallback_45)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_45(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_45(uint16_t currentPositionLift) - { - VerifyOrReturn(CheckConstraintType("currentPositionLift", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("currentPositionLift", currentPositionLift, 65535U)); - - NextTest(); - } - - CHIP_ERROR Test4ReadTheRoOptionalAttributeDefaultCurrentPositionTilt_46() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_46, OnFailureCallback_46)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_46(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_46(uint16_t currentPositionTilt) - { - VerifyOrReturn(CheckConstraintType("currentPositionTilt", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("currentPositionTilt", currentPositionTilt, 65535U)); - - NextTest(); - } - - CHIP_ERROR Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionTilt_47() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t currentPositionTiltArgument; - currentPositionTiltArgument = 255U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - currentPositionTiltArgument, this, OnSuccessCallback_47, OnFailureCallback_47)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_47(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_47() { ThrowSuccessResponse(); } - - CHIP_ERROR Test5bReadsBackTheRoOptionalAttributeCurrentPositionTilt_48() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_48, OnFailureCallback_48)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_48(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_48(uint16_t currentPositionTilt) - { - VerifyOrReturn(CheckConstraintType("currentPositionTilt", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("currentPositionTilt", currentPositionTilt, 65535U)); - - NextTest(); - } - - CHIP_ERROR Test4ReadTheRoOptionalAttributeDefaultCurrentPositionLiftPercentage_49() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_49, OnFailureCallback_49)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_49(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_49(uint8_t currentPositionLiftPercentage) - { - VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "uint8")); - VerifyOrReturn(CheckConstraintMaxValue("currentPositionLiftPercentage", currentPositionLiftPercentage, 100)); - - NextTest(); - } - - CHIP_ERROR Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionLiftPercentage_50() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t currentPositionLiftPercentageArgument; - currentPositionLiftPercentageArgument = 200; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - currentPositionLiftPercentageArgument, this, OnSuccessCallback_50, OnFailureCallback_50)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_50(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_50() { ThrowSuccessResponse(); } - - CHIP_ERROR Test5bReadsBackTheRoOptionalAttributeCurrentPositionLiftPercentage_51() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_51, OnFailureCallback_51)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_51(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_51(uint8_t currentPositionLiftPercentage) - { - VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "uint8")); - VerifyOrReturn(CheckConstraintNotValue("currentPositionLiftPercentage", currentPositionLiftPercentage, 200)); - - NextTest(); - } - - CHIP_ERROR Test4ReadTheRoOptionalAttributeDefaultCurrentPositionTiltPercentage_52() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_52, OnFailureCallback_52)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_52(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_52(uint8_t currentPositionTiltPercentage) - { - VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "uint8")); - VerifyOrReturn(CheckConstraintMaxValue("currentPositionTiltPercentage", currentPositionTiltPercentage, 100)); - - NextTest(); - } - - CHIP_ERROR Test5aWriteAValueIntoTheRoOptionalAttributeCurrentPositionTiltPercentage_53() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t currentPositionTiltPercentageArgument; - currentPositionTiltPercentageArgument = 200; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - currentPositionTiltPercentageArgument, this, OnSuccessCallback_53, OnFailureCallback_53)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_53(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - } - - void OnSuccessResponse_53() { ThrowSuccessResponse(); } - - CHIP_ERROR Test5bReadsBackTheRoOptionalAttributeCurrentPositionTiltPercentage_54() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_54, OnFailureCallback_54)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_54(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_54(uint8_t currentPositionTiltPercentage) - { - VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "uint8")); - VerifyOrReturn(CheckConstraintNotValue("currentPositionTiltPercentage", currentPositionTiltPercentage, 200)); - - NextTest(); - } -}; - -class Test_TC_WNCV_2_2 : public TestCommand -{ -public: - Test_TC_WNCV_2_2() : TestCommand("Test_TC_WNCV_2_2"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_2_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_2_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; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } -}; - -class Test_TC_WNCV_2_4 : public TestCommand -{ -public: - Test_TC_WNCV_2_4() : TestCommand("Test_TC_WNCV_2_4"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_2_4\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_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 : Reads Type attribute from DUT\n"); - err = ShouldSkip("A_TYPE") ? CHIP_NO_ERROR : TestReadsTypeAttributeFromDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads Type attribute constraints\n"); - err = ShouldSkip("A_TYPE") ? CHIP_NO_ERROR : TestReadsTypeAttributeConstraints_2(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint8_t type) - { - (static_cast(context))->OnSuccessResponse_1(type); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint8_t type) - { - (static_cast(context))->OnSuccessResponse_2(type); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadsTypeAttributeFromDut_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint8_t type) - { - VerifyOrReturn(CheckValue("type", type, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadsTypeAttributeConstraints_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint8_t type) - { - VerifyOrReturn(CheckConstraintType("type", "", "enum8")); - VerifyOrReturn(CheckConstraintMaxValue("type", type, 9)); - - NextTest(); - } -}; - -class Test_TC_WNCV_2_5 : public TestCommand -{ -public: - Test_TC_WNCV_2_5() : TestCommand("Test_TC_WNCV_2_5"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_2_5\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_2_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 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Reads EndProductType attribute from DUT\n"); - err = ShouldSkip("A_ENDPRODUCTTYPE") ? CHIP_NO_ERROR : TestReadsEndProductTypeAttributeFromDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads EndProductType attribute constraints from DUT\n"); - err = ShouldSkip("A_ENDPRODUCTTYPE") ? CHIP_NO_ERROR : TestReadsEndProductTypeAttributeConstraintsFromDut_2(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint8_t endProductType) - { - (static_cast(context))->OnSuccessResponse_1(endProductType); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint8_t endProductType) - { - (static_cast(context))->OnSuccessResponse_2(endProductType); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadsEndProductTypeAttributeFromDut_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint8_t endProductType) - { - VerifyOrReturn(CheckValue("endProductType", endProductType, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadsEndProductTypeAttributeConstraintsFromDut_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint8_t endProductType) - { - VerifyOrReturn(CheckConstraintType("endProductType", "", "enum8")); - VerifyOrReturn(CheckConstraintMaxValue("endProductType", endProductType, 23)); - - NextTest(); - } -}; - -class Test_TC_WNCV_3_1 : public TestCommand -{ -public: - Test_TC_WNCV_3_1() : TestCommand("Test_TC_WNCV_3_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_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 : 1a: TH adjusts the the DUT to a non-open position\n"); - err = Test1aThAdjustsTheTheDutToANonOpenPosition_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : 2a: TH sends UpOrOpen command to DUT\n"); - err = Test2aThSendsUpOrOpenCommandToDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : 3a: TH reads OperationalStatus attribute from DUT\n"); - err = Test3aThReadsOperationalStatusAttributeFromDut_3(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, uint8_t operationalStatus) - { - (static_cast(context))->OnSuccessResponse_3(operationalStatus); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR Test1aThAdjustsTheTheDutToANonOpenPosition_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::WindowCovering::Commands::DownOrClose::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR Test2aThSendsUpOrOpenCommandToDut_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::WindowCovering::Commands::UpOrOpen::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_2(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_2(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2() { NextTest(); } - - CHIP_ERROR Test3aThReadsOperationalStatusAttributeFromDut_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(uint8_t operationalStatus) - { - VerifyOrReturn(CheckValue("operationalStatus", operationalStatus, 0)); - - NextTest(); - } -}; - -class Test_TC_WNCV_3_2 : public TestCommand -{ -public: - Test_TC_WNCV_3_2() : TestCommand("Test_TC_WNCV_3_2"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_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 : 1a: TH adjusts the the DUT to a non-closed position\n"); - err = Test1aThAdjustsTheTheDutToANonClosedPosition_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : 2a: TH sends DownOrClose command to DUT\n"); - err = Test2aThSendsDownOrCloseCommandToDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : 3a: TH reads OperationalStatus attribute from DUT\n"); - err = Test3aThReadsOperationalStatusAttributeFromDut_3(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, uint8_t operationalStatus) - { - (static_cast(context))->OnSuccessResponse_3(operationalStatus); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR Test1aThAdjustsTheTheDutToANonClosedPosition_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::WindowCovering::Commands::UpOrOpen::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR Test2aThSendsDownOrCloseCommandToDut_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::WindowCovering::Commands::DownOrClose::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_2(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_2(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2() { NextTest(); } - - CHIP_ERROR Test3aThReadsOperationalStatusAttributeFromDut_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(uint8_t operationalStatus) - { - VerifyOrReturn(CheckValue("operationalStatus", operationalStatus, 0)); - - NextTest(); - } -}; - -class Test_TC_WNCV_3_3 : public TestCommand -{ -public: - Test_TC_WNCV_3_3() : TestCommand("Test_TC_WNCV_3_3"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WNCV_3_3\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WNCV_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 : 1a: TH adjusts the the DUT to a non-open position\n"); - err = Test1aThAdjustsTheTheDutToANonOpenPosition_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : 2a: TH sends StopMotion command to DUT\n"); - err = Test2aThSendsStopMotionCommandToDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : 2b: TH reads OperationalStatus attribute from DUT\n"); - err = Test2bThReadsOperationalStatusAttributeFromDut_3(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, uint8_t operationalStatus) - { - (static_cast(context))->OnSuccessResponse_3(operationalStatus); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR Test1aThAdjustsTheTheDutToANonOpenPosition_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::WindowCovering::Commands::UpOrOpen::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR Test2aThSendsStopMotionCommandToDut_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::WindowCovering::Commands::StopMotion::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_2(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_2(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2() { NextTest(); } - - CHIP_ERROR Test2bThReadsOperationalStatusAttributeFromDut_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(uint8_t operationalStatus) - { - VerifyOrReturn(CheckValue("operationalStatus", operationalStatus, 0)); - - NextTest(); - } -}; - -class TV_TargetNavigatorCluster : public TestCommand -{ -public: - TV_TargetNavigatorCluster() : TestCommand("TV_TargetNavigatorCluster"), mTestIndex(0) {} - - /////////// 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 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Target Navigator list\n"); - err = TestReadAttributeTargetNavigatorList_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute current navigator target\n"); - err = TestReadAttributeCurrentNavigatorTarget_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Navigate Target Command\n"); - err = TestNavigateTargetCommand_3(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1( - void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::TargetNavigator::Structs::NavigateTargetTargetInfo::DecodableType> & targetNavigatorList) - { - (static_cast(context))->OnSuccessResponse_1(targetNavigatorList); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint8_t currentNavigatorTarget) - { - (static_cast(context))->OnSuccessResponse_2(currentNavigatorTarget); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadAttributeTargetNavigatorList_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TargetNavigatorClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1( - const chip::app::DataModel::DecodableList< - chip::app::Clusters::TargetNavigator::Structs::NavigateTargetTargetInfo::DecodableType> & targetNavigatorList) - { - auto iter = targetNavigatorList.begin(); - VerifyOrReturn(CheckNextListItemDecodes("targetNavigatorList", iter, 0)); - VerifyOrReturn(CheckValue("targetNavigatorList[0].identifier", iter.GetValue().identifier, 1)); - VerifyOrReturn(CheckValueAsString("targetNavigatorList[0].name", iter.GetValue().name, chip::CharSpan("exampleName", 11))); - VerifyOrReturn(CheckNextListItemDecodes("targetNavigatorList", iter, 1)); - VerifyOrReturn(CheckValue("targetNavigatorList[1].identifier", iter.GetValue().identifier, 2)); - VerifyOrReturn(CheckValueAsString("targetNavigatorList[1].name", iter.GetValue().name, chip::CharSpan("exampleName", 11))); - VerifyOrReturn(CheckNoMoreListItems("targetNavigatorList", iter, 2)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeCurrentNavigatorTarget_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TargetNavigatorClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint8_t currentNavigatorTarget) - { - VerifyOrReturn(CheckValue("currentNavigatorTarget", currentNavigatorTarget, 0)); - - NextTest(); - } - - CHIP_ERROR TestNavigateTargetCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TargetNavigator::Commands::NavigateTarget::Type; - - RequestType request; - request.target = 1; - request.data = chip::Span("1garbage: not in length on purpose", 1); - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(data.status, data.data); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(chip::app::Clusters::TargetNavigator::NavigateTargetStatus status, chip::CharSpan data) - { - VerifyOrReturn(CheckValue("status", status, 0)); - - VerifyOrReturn(CheckValueAsString("data", data, chip::CharSpan("data response", 13))); - - NextTest(); - } -}; - -class TV_AudioOutputCluster : public TestCommand -{ -public: - TV_AudioOutputCluster() : TestCommand("TV_AudioOutputCluster"), mTestIndex(0) {} - - /////////// 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 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Audio Output list\n"); - err = TestReadAttributeAudioOutputList_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute current audio output\n"); - err = TestReadAttributeCurrentAudioOutput_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Select Output Command\n"); - err = TestSelectOutputCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Rename Output Command\n"); - err = TestRenameOutputCommand_4(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1( - void * context, - const chip::app::DataModel::DecodableList & - audioOutputList) - { - (static_cast(context))->OnSuccessResponse_1(audioOutputList); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint8_t currentAudioOutput) - { - (static_cast(context))->OnSuccessResponse_2(currentAudioOutput); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadAttributeAudioOutputList_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 2; - chip::Controller::AudioOutputClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1( - const chip::app::DataModel::DecodableList & - audioOutputList) - { - auto iter = audioOutputList.begin(); - VerifyOrReturn(CheckNextListItemDecodes("audioOutputList", iter, 0)); - VerifyOrReturn(CheckValue("audioOutputList[0].index", iter.GetValue().index, 1)); - VerifyOrReturn(CheckValue("audioOutputList[0].outputType", iter.GetValue().outputType, 0)); - VerifyOrReturn(CheckValueAsString("audioOutputList[0].name", iter.GetValue().name, chip::CharSpan("exampleName", 11))); - VerifyOrReturn(CheckNextListItemDecodes("audioOutputList", iter, 1)); - VerifyOrReturn(CheckValue("audioOutputList[1].index", iter.GetValue().index, 2)); - VerifyOrReturn(CheckValue("audioOutputList[1].outputType", iter.GetValue().outputType, 0)); - VerifyOrReturn(CheckValueAsString("audioOutputList[1].name", iter.GetValue().name, chip::CharSpan("exampleName", 11))); - VerifyOrReturn(CheckNextListItemDecodes("audioOutputList", iter, 2)); - VerifyOrReturn(CheckValue("audioOutputList[2].index", iter.GetValue().index, 3)); - VerifyOrReturn(CheckValue("audioOutputList[2].outputType", iter.GetValue().outputType, 0)); - VerifyOrReturn(CheckValueAsString("audioOutputList[2].name", iter.GetValue().name, chip::CharSpan("exampleName", 11))); - VerifyOrReturn(CheckNoMoreListItems("audioOutputList", iter, 3)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeCurrentAudioOutput_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 2; - chip::Controller::AudioOutputClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint8_t currentAudioOutput) - { - VerifyOrReturn(CheckValue("currentAudioOutput", currentAudioOutput, 0)); - - NextTest(); - } - - CHIP_ERROR TestSelectOutputCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 2; - using RequestType = chip::app::Clusters::AudioOutput::Commands::SelectOutput::Type; - - RequestType request; - request.index = 1; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestRenameOutputCommand_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 2; - using RequestType = chip::app::Clusters::AudioOutput::Commands::RenameOutput::Type; - - RequestType request; - request.index = 1; - request.name = chip::Span("exampleNamegarbage: not in length on purpose", 11); - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } -}; - -class TV_ApplicationLauncherCluster : public TestCommand -{ -public: - TV_ApplicationLauncherCluster() : TestCommand("TV_ApplicationLauncherCluster"), mTestIndex(0) {} - - /////////// 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 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Application Launcher list\n"); - err = TestReadAttributeApplicationLauncherList_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Launch App Command\n"); - err = TestLaunchAppCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Stop App Command\n"); - err = TestStopAppCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Hide App Command\n"); - err = TestHideAppCommand_4(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, const chip::app::DataModel::DecodableList & applicationLauncherList) - { - (static_cast(context))->OnSuccessResponse_1(applicationLauncherList); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadAttributeApplicationLauncherList_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ApplicationLauncherClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(const chip::app::DataModel::DecodableList & applicationLauncherList) - { - auto iter = applicationLauncherList.begin(); - VerifyOrReturn(CheckNextListItemDecodes("applicationLauncherList", iter, 0)); - VerifyOrReturn(CheckValue("applicationLauncherList[0]", iter.GetValue(), 123U)); - VerifyOrReturn(CheckNextListItemDecodes("applicationLauncherList", iter, 1)); - VerifyOrReturn(CheckValue("applicationLauncherList[1]", iter.GetValue(), 456U)); - VerifyOrReturn(CheckNoMoreListItems("applicationLauncherList", iter, 2)); - - NextTest(); - } - - CHIP_ERROR TestLaunchAppCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type; - - RequestType request; - request.data = chip::Span("datagarbage: not in length on purpose", 4); - - request.application.catalogVendorId = 123U; - request.application.applicationId = chip::Span("applicationIdgarbage: not in length on purpose", 13); - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_2(data.status, data.data); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_2(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(chip::app::Clusters::ApplicationLauncher::ApplicationLauncherStatus status, chip::CharSpan data) - { - VerifyOrReturn(CheckValue("status", status, 0)); - - VerifyOrReturn(CheckValueAsString("data", data, chip::CharSpan("data", 4))); - - NextTest(); - } - - CHIP_ERROR TestStopAppCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type; - - RequestType request; - - request.application.catalogVendorId = 123U; - request.application.applicationId = chip::Span("applicationIdgarbage: not in length on purpose", 13); - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(data.status, data.data); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(chip::app::Clusters::ApplicationLauncher::ApplicationLauncherStatus status, chip::CharSpan data) - { - VerifyOrReturn(CheckValue("status", status, 0)); - - VerifyOrReturn(CheckValueAsString("data", data, chip::CharSpan("data", 4))); - - NextTest(); - } - - CHIP_ERROR TestHideAppCommand_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type; - - RequestType request; - - request.application.catalogVendorId = 123U; - request.application.applicationId = chip::Span("applicationIdgarbage: not in length on purpose", 13); - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(data.status, data.data); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(chip::app::Clusters::ApplicationLauncher::ApplicationLauncherStatus status, chip::CharSpan data) - { - VerifyOrReturn(CheckValue("status", status, 0)); - - VerifyOrReturn(CheckValueAsString("data", data, chip::CharSpan("data", 4))); - - NextTest(); - } -}; - -class TV_KeypadInputCluster : public TestCommand -{ -public: - TV_KeypadInputCluster() : TestCommand("TV_KeypadInputCluster"), mTestIndex(0) {} - - /////////// 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 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Send Key Command\n"); - err = TestSendKeyCommand_1(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestSendKeyCommand_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::KeypadInput::Commands::SendKey::Type; - - RequestType request; - request.keyCode = static_cast(3); - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(data.status); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(chip::app::Clusters::KeypadInput::KeypadInputStatus status) - { - VerifyOrReturn(CheckValue("status", status, 0)); - - NextTest(); - } -}; - -class TV_AccountLoginCluster : public TestCommand -{ -public: - TV_AccountLoginCluster() : TestCommand("TV_AccountLoginCluster"), mTestIndex(0) {} - - /////////// 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 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Get Setup PIN Command\n"); - err = TestGetSetupPinCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Login Command\n"); - err = TestLoginCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Logout Command\n"); - err = TestLogoutCommand_3(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestGetSetupPinCommand_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Type; - - RequestType request; - request.tempAccountIdentifier = chip::Span("asdfgarbage: not in length on purpose", 4); - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(data.setupPIN); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(chip::CharSpan setupPIN) { NextTest(); } - - CHIP_ERROR TestLoginCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::AccountLogin::Commands::Login::Type; - - RequestType request; - request.tempAccountIdentifier = chip::Span("asdfgarbage: not in length on purpose", 4); - request.setupPIN = chip::Span("tempPin123garbage: not in length on purpose", 10); - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_2(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_2(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2() { NextTest(); } - - CHIP_ERROR TestLogoutCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::AccountLogin::Commands::Logout::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } -}; - -class TV_WakeOnLanCluster : public TestCommand -{ -public: - TV_WakeOnLanCluster() : TestCommand("TV_WakeOnLanCluster"), mTestIndex(0) {} - - /////////// 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 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read mac address\n"); - err = TestReadMacAddress_1(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, chip::CharSpan wakeOnLanMacAddress) - { - (static_cast(context))->OnSuccessResponse_1(wakeOnLanMacAddress); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadMacAddress_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::WakeOnLanClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(chip::CharSpan wakeOnLanMacAddress) - { - VerifyOrReturn(CheckValueAsString("wakeOnLanMacAddress", wakeOnLanMacAddress, chip::CharSpan("00:00:00:00:00", 14))); - - NextTest(); - } -}; - -class TV_ApplicationBasicCluster : public TestCommand -{ -public: - TV_ApplicationBasicCluster() : TestCommand("TV_ApplicationBasicCluster"), mTestIndex(0) {} - - /////////// 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 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Change Status Command\n"); - err = TestChangeStatusCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute vendor name\n"); - err = TestReadAttributeVendorName_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute vendor id\n"); - err = TestReadAttributeVendorId_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute application name\n"); - err = TestReadAttributeApplicationName_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read attribute product id\n"); - err = TestReadAttributeProductId_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute application status\n"); - err = TestReadAttributeApplicationStatus_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read attribute application version\n"); - err = TestReadAttributeApplicationVersion_7(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, chip::CharSpan vendorName) - { - (static_cast(context))->OnSuccessResponse_2(vendorName); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, uint16_t vendorId) - { - (static_cast(context))->OnSuccessResponse_3(vendorId); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, chip::CharSpan applicationName) - { - (static_cast(context))->OnSuccessResponse_4(applicationName); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, uint16_t productId) - { - (static_cast(context))->OnSuccessResponse_5(productId); - } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, uint8_t applicationStatus) - { - (static_cast(context))->OnSuccessResponse_6(applicationStatus); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, chip::CharSpan applicationVersion) - { - (static_cast(context))->OnSuccessResponse_7(applicationVersion); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestChangeStatusCommand_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::ApplicationBasic::Commands::ChangeStatus::Type; - - RequestType request; - request.status = static_cast(1); - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestReadAttributeVendorName_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - chip::Controller::ApplicationBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(chip::CharSpan vendorName) - { - VerifyOrReturn(CheckValueAsString("vendorName", vendorName, chip::CharSpan("exampleVendorName1", 18))); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeVendorId_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - chip::Controller::ApplicationBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(uint16_t vendorId) - { - VerifyOrReturn(CheckValue("vendorId", vendorId, 1U)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeApplicationName_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - chip::Controller::ApplicationBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(chip::CharSpan applicationName) - { - VerifyOrReturn(CheckValueAsString("applicationName", applicationName, chip::CharSpan("exampleName1", 12))); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeProductId_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - chip::Controller::ApplicationBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(uint16_t productId) - { - VerifyOrReturn(CheckValue("productId", productId, 1U)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeApplicationStatus_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - chip::Controller::ApplicationBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(uint8_t applicationStatus) - { - VerifyOrReturn(CheckValue("applicationStatus", applicationStatus, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeApplicationVersion_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - chip::Controller::ApplicationBasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(chip::CharSpan applicationVersion) - { - VerifyOrReturn(CheckValueAsString("applicationVersion", applicationVersion, chip::CharSpan("exampleVersion", 14))); - - NextTest(); - } -}; - -class TV_MediaPlaybackCluster : public TestCommand -{ -public: - TV_MediaPlaybackCluster() : TestCommand("TV_MediaPlaybackCluster"), mTestIndex(0) {} - - /////////// 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 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute playback state\n"); - err = TestReadAttributePlaybackState_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute start time\n"); - err = TestReadAttributeStartTime_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute duration\n"); - err = TestReadAttributeDuration_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute playback speed\n"); - err = TestReadAttributePlaybackSpeed_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read attribute seek range end\n"); - err = TestReadAttributeSeekRangeEnd_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute seek range start\n"); - err = TestReadAttributeSeekRangeStart_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Media Playback Play Command\n"); - err = TestMediaPlaybackPlayCommand_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Media Playback Pause Command\n"); - err = TestMediaPlaybackPauseCommand_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Media Playback Stop Command\n"); - err = TestMediaPlaybackStopCommand_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Media Playback Start Over Command\n"); - err = TestMediaPlaybackStartOverCommand_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Media Playback Previous Command\n"); - err = TestMediaPlaybackPreviousCommand_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Media Playback Next Command\n"); - err = TestMediaPlaybackNextCommand_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Media Playback Rewind Command\n"); - err = TestMediaPlaybackRewindCommand_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Media Playback Fast Forward Command\n"); - err = TestMediaPlaybackFastForwardCommand_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Media Playback Skip Forward Command\n"); - err = TestMediaPlaybackSkipForwardCommand_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Media Playback Skip Backward Command\n"); - err = TestMediaPlaybackSkipBackwardCommand_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Media Playback Seek Command\n"); - err = TestMediaPlaybackSeekCommand_17(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 18; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint8_t playbackState) - { - (static_cast(context))->OnSuccessResponse_1(playbackState); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint64_t startTime) - { - (static_cast(context))->OnSuccessResponse_2(startTime); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, uint64_t duration) - { - (static_cast(context))->OnSuccessResponse_3(duration); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, float playbackSpeed) - { - (static_cast(context))->OnSuccessResponse_4(playbackSpeed); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, uint64_t seekRangeEnd) - { - (static_cast(context))->OnSuccessResponse_5(seekRangeEnd); - } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, uint64_t seekRangeStart) - { - (static_cast(context))->OnSuccessResponse_6(seekRangeStart); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadAttributePlaybackState_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - chip::Controller::MediaPlaybackClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint8_t playbackState) - { - VerifyOrReturn(CheckValue("playbackState", playbackState, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeStartTime_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - chip::Controller::MediaPlaybackClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint64_t startTime) - { - VerifyOrReturn(CheckValue("startTime", startTime, 255ULL)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeDuration_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - chip::Controller::MediaPlaybackClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(uint64_t duration) - { - VerifyOrReturn(CheckValue("duration", duration, 0ULL)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributePlaybackSpeed_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - chip::Controller::MediaPlaybackClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(float playbackSpeed) - { - VerifyOrReturn(CheckValue("playbackSpeed", playbackSpeed, 0.0f)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeSeekRangeEnd_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - chip::Controller::MediaPlaybackClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(uint64_t seekRangeEnd) - { - VerifyOrReturn(CheckValue("seekRangeEnd", seekRangeEnd, 0ULL)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeSeekRangeStart_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - chip::Controller::MediaPlaybackClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(uint64_t seekRangeStart) - { - VerifyOrReturn(CheckValue("seekRangeStart", seekRangeStart, 0ULL)); - - NextTest(); - } - - CHIP_ERROR TestMediaPlaybackPlayCommand_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaPlay::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_7(data.mediaPlaybackStatus); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_7(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(chip::app::Clusters::MediaPlayback::MediaPlaybackStatus mediaPlaybackStatus) - { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); - - NextTest(); - } - - CHIP_ERROR TestMediaPlaybackPauseCommand_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaPause::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_8(data.mediaPlaybackStatus); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_8(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8(chip::app::Clusters::MediaPlayback::MediaPlaybackStatus mediaPlaybackStatus) - { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); - - NextTest(); - } - - CHIP_ERROR TestMediaPlaybackStopCommand_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaStop::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_9(data.mediaPlaybackStatus); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_9(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9(chip::app::Clusters::MediaPlayback::MediaPlaybackStatus mediaPlaybackStatus) - { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); - - NextTest(); - } - - CHIP_ERROR TestMediaPlaybackStartOverCommand_10() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaStartOver::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_10(data.mediaPlaybackStatus); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_10(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10(chip::app::Clusters::MediaPlayback::MediaPlaybackStatus mediaPlaybackStatus) - { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); - - NextTest(); - } - - CHIP_ERROR TestMediaPlaybackPreviousCommand_11() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaPrevious::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_11(data.mediaPlaybackStatus); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_11(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_11(chip::app::Clusters::MediaPlayback::MediaPlaybackStatus mediaPlaybackStatus) - { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); - - NextTest(); - } - - CHIP_ERROR TestMediaPlaybackNextCommand_12() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaNext::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_12(data.mediaPlaybackStatus); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_12(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_12(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_12(chip::app::Clusters::MediaPlayback::MediaPlaybackStatus mediaPlaybackStatus) - { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); - - NextTest(); - } - - CHIP_ERROR TestMediaPlaybackRewindCommand_13() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaRewind::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_13(data.mediaPlaybackStatus); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_13(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_13(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_13(chip::app::Clusters::MediaPlayback::MediaPlaybackStatus mediaPlaybackStatus) - { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); - - NextTest(); - } - - CHIP_ERROR TestMediaPlaybackFastForwardCommand_14() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaFastForward::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_14(data.mediaPlaybackStatus); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_14(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_14(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_14(chip::app::Clusters::MediaPlayback::MediaPlaybackStatus mediaPlaybackStatus) - { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); - - NextTest(); - } - - CHIP_ERROR TestMediaPlaybackSkipForwardCommand_15() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaSkipForward::Type; - - RequestType request; - request.deltaPositionMilliseconds = 100ULL; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_15(data.mediaPlaybackStatus); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_15(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_15(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_15(chip::app::Clusters::MediaPlayback::MediaPlaybackStatus mediaPlaybackStatus) - { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); - - NextTest(); - } - - CHIP_ERROR TestMediaPlaybackSkipBackwardCommand_16() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaSkipBackward::Type; - - RequestType request; - request.deltaPositionMilliseconds = 100ULL; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_16(data.mediaPlaybackStatus); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_16(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_16(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_16(chip::app::Clusters::MediaPlayback::MediaPlaybackStatus mediaPlaybackStatus) - { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); - - NextTest(); - } - - CHIP_ERROR TestMediaPlaybackSeekCommand_17() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaSeek::Type; - - RequestType request; - request.position = 100ULL; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_17(data.mediaPlaybackStatus); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_17(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_17(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_17(chip::app::Clusters::MediaPlayback::MediaPlaybackStatus mediaPlaybackStatus) - { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); - - NextTest(); - } -}; - -class TV_ChannelCluster : public TestCommand -{ -public: - TV_ChannelCluster() : TestCommand("TV_ChannelCluster"), mTestIndex(0) {} - - /////////// 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 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Channel list\n"); - err = TestReadAttributeChannelList_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Change Channel Command\n"); - err = TestChangeChannelCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Change Channel By Number Command\n"); - err = TestChangeChannelByNumberCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Skip Channel Command\n"); - err = TestSkipChannelCommand_4(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1( - void * context, - const chip::app::DataModel::DecodableList & channelList) - { - (static_cast(context))->OnSuccessResponse_1(channelList); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadAttributeChannelList_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ChannelClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1( - const chip::app::DataModel::DecodableList & channelList) - { - auto iter = channelList.begin(); - VerifyOrReturn(CheckNextListItemDecodes("channelList", iter, 0)); - VerifyOrReturn(CheckValue("channelList[0].majorNumber", iter.GetValue().majorNumber, 1U)); - VerifyOrReturn(CheckValue("channelList[0].minorNumber", iter.GetValue().minorNumber, 2U)); - VerifyOrReturn(CheckValueAsString("channelList[0].name", iter.GetValue().name, chip::CharSpan("exampleName", 11))); - VerifyOrReturn(CheckValueAsString("channelList[0].callSign", iter.GetValue().callSign, chip::CharSpan("exampleCSign", 12))); - VerifyOrReturn(CheckValueAsString("channelList[0].affiliateCallSign", iter.GetValue().affiliateCallSign, - chip::CharSpan("exampleASign", 12))); - VerifyOrReturn(CheckNextListItemDecodes("channelList", iter, 1)); - VerifyOrReturn(CheckValue("channelList[1].majorNumber", iter.GetValue().majorNumber, 2U)); - VerifyOrReturn(CheckValue("channelList[1].minorNumber", iter.GetValue().minorNumber, 3U)); - VerifyOrReturn(CheckValueAsString("channelList[1].name", iter.GetValue().name, chip::CharSpan("exampleName", 11))); - VerifyOrReturn(CheckValueAsString("channelList[1].callSign", iter.GetValue().callSign, chip::CharSpan("exampleCSign", 12))); - VerifyOrReturn(CheckValueAsString("channelList[1].affiliateCallSign", iter.GetValue().affiliateCallSign, - chip::CharSpan("exampleASign", 12))); - VerifyOrReturn(CheckNoMoreListItems("channelList", iter, 2)); - - NextTest(); - } - - CHIP_ERROR TestChangeChannelCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Channel::Commands::ChangeChannel::Type; - - RequestType request; - request.match = chip::Span("CNNgarbage: not in length on purpose", 3); - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_2(data.channelMatch, data.errorType); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_2(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(const chip::app::Clusters::Channel::Structs::ChannelInfo::DecodableType & channelMatch, - chip::app::Clusters::Channel::ChannelErrorType errorType) - { - VerifyOrReturn(CheckValue("channelMatch.majorNumber", channelMatch.majorNumber, 1U)); - VerifyOrReturn(CheckValue("channelMatch.minorNumber", channelMatch.minorNumber, 0U)); - VerifyOrReturn(CheckValueAsString("channelMatch.name", channelMatch.name, chip::CharSpan("name", 4))); - VerifyOrReturn(CheckValueAsString("channelMatch.callSign", channelMatch.callSign, chip::CharSpan("callSign", 8))); - VerifyOrReturn(CheckValueAsString("channelMatch.affiliateCallSign", channelMatch.affiliateCallSign, - chip::CharSpan("affiliateCallSign", 17))); - - VerifyOrReturn(CheckValue("errorType", errorType, 0)); - - NextTest(); - } - - CHIP_ERROR TestChangeChannelByNumberCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type; - - RequestType request; - request.majorNumber = 1U; - request.minorNumber = 2U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestSkipChannelCommand_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Channel::Commands::SkipChannel::Type; - - RequestType request; - request.count = 1U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } -}; - -class TV_LowPowerCluster : public TestCommand -{ -public: - TV_LowPowerCluster() : TestCommand("TV_LowPowerCluster"), mTestIndex(0) {} - - /////////// 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 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Sleep Input Status Command\n"); - err = TestSleepInputStatusCommand_1(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestSleepInputStatusCommand_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::LowPower::Commands::Sleep::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } -}; - -class TV_ContentLauncherCluster : public TestCommand -{ -public: - TV_ContentLauncherCluster() : TestCommand("TV_ContentLauncherCluster"), mTestIndex(0) {} - - /////////// 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 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute accept header list\n"); - err = TestReadAttributeAcceptHeaderList_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute supported streaming protocols\n"); - err = TestReadAttributeSupportedStreamingProtocols_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Launch Content Command\n"); - err = TestLaunchContentCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Launch URL Command\n"); - err = TestLaunchUrlCommand_4(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, const chip::app::DataModel::DecodableList & acceptHeaderList) - { - (static_cast(context))->OnSuccessResponse_1(acceptHeaderList); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint32_t supportedStreamingProtocols) - { - (static_cast(context))->OnSuccessResponse_2(supportedStreamingProtocols); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadAttributeAcceptHeaderList_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ContentLauncherClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(const chip::app::DataModel::DecodableList & acceptHeaderList) - { - auto iter = acceptHeaderList.begin(); - VerifyOrReturn(CheckNextListItemDecodes("acceptHeaderList", iter, 0)); - VerifyOrReturn(CheckValueAsString("acceptHeaderList[0]", iter.GetValue(), chip::CharSpan("example", 7))); - VerifyOrReturn(CheckNextListItemDecodes("acceptHeaderList", iter, 1)); - VerifyOrReturn(CheckValueAsString("acceptHeaderList[1]", iter.GetValue(), chip::CharSpan("example", 7))); - VerifyOrReturn(CheckNoMoreListItems("acceptHeaderList", iter, 2)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeSupportedStreamingProtocols_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ContentLauncherClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint32_t supportedStreamingProtocols) - { - VerifyOrReturn(CheckValue("supportedStreamingProtocols", supportedStreamingProtocols, 0UL)); - - NextTest(); - } - - CHIP_ERROR TestLaunchContentCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type; - - RequestType request; - request.autoPlay = true; - request.data = chip::Span("exampleDatagarbage: not in length on purpose", 11); - - request.search = chip::app::DataModel::List(); - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(data.contentLaunchStatus, data.data); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(chip::app::Clusters::ContentLauncher::ContentLaunchStatus contentLaunchStatus, chip::CharSpan data) - { - VerifyOrReturn(CheckValue("contentLaunchStatus", contentLaunchStatus, 0)); - - VerifyOrReturn(CheckValueAsString("data", data, chip::CharSpan("exampleData", 11))); - - NextTest(); - } - - CHIP_ERROR TestLaunchUrlCommand_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type; - - RequestType request; - request.contentURL = chip::Span("exampleUrlgarbage: not in length on purpose", 10); - request.displayString = chip::Span("exampleDisplayStringgarbage: not in length on purpose", 20); - - request.brandingInformation = - chip::app::DataModel::List(); - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(data.contentLaunchStatus, data.data); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(chip::app::Clusters::ContentLauncher::ContentLaunchStatus contentLaunchStatus, chip::CharSpan data) - { - VerifyOrReturn(CheckValue("contentLaunchStatus", contentLaunchStatus, 0)); - - VerifyOrReturn(CheckValueAsString("data", data, chip::CharSpan("exampleData", 11))); - - NextTest(); - } -}; - -class TV_MediaInputCluster : public TestCommand -{ -public: - TV_MediaInputCluster() : TestCommand("TV_MediaInputCluster"), mTestIndex(0) {} - - /////////// 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 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute media input list\n"); - err = TestReadAttributeMediaInputList_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read current media input\n"); - err = TestReadCurrentMediaInput_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Select Input Command\n"); - err = TestSelectInputCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Hide Input Status Command\n"); - err = TestHideInputStatusCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Show Input Status Command\n"); - err = TestShowInputStatusCommand_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Rename Input Command\n"); - err = TestRenameInputCommand_6(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1( - void * context, - const chip::app::DataModel::DecodableList & - mediaInputList) - { - (static_cast(context))->OnSuccessResponse_1(mediaInputList); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint8_t currentMediaInput) - { - (static_cast(context))->OnSuccessResponse_2(currentMediaInput); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadAttributeMediaInputList_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::MediaInputClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1( - const chip::app::DataModel::DecodableList & - mediaInputList) - { - auto iter = mediaInputList.begin(); - VerifyOrReturn(CheckNextListItemDecodes("mediaInputList", iter, 0)); - VerifyOrReturn(CheckValue("mediaInputList[0].index", iter.GetValue().index, 1)); - VerifyOrReturn(CheckValue("mediaInputList[0].inputType", iter.GetValue().inputType, 4)); - VerifyOrReturn(CheckValueAsString("mediaInputList[0].name", iter.GetValue().name, chip::CharSpan("exampleName", 11))); - VerifyOrReturn(CheckValueAsString("mediaInputList[0].description", iter.GetValue().description, - chip::CharSpan("exampleDescription", 18))); - VerifyOrReturn(CheckNextListItemDecodes("mediaInputList", iter, 1)); - VerifyOrReturn(CheckValue("mediaInputList[1].index", iter.GetValue().index, 2)); - VerifyOrReturn(CheckValue("mediaInputList[1].inputType", iter.GetValue().inputType, 4)); - VerifyOrReturn(CheckValueAsString("mediaInputList[1].name", iter.GetValue().name, chip::CharSpan("exampleName", 11))); - VerifyOrReturn(CheckValueAsString("mediaInputList[1].description", iter.GetValue().description, - chip::CharSpan("exampleDescription", 18))); - VerifyOrReturn(CheckNoMoreListItems("mediaInputList", iter, 2)); - - NextTest(); - } - - CHIP_ERROR TestReadCurrentMediaInput_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::MediaInputClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint8_t currentMediaInput) - { - VerifyOrReturn(CheckValue("currentMediaInput", currentMediaInput, 0)); - - NextTest(); - } - - CHIP_ERROR TestSelectInputCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::MediaInput::Commands::SelectInput::Type; - - RequestType request; - request.index = 1; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestHideInputStatusCommand_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::MediaInput::Commands::HideInputStatus::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestShowInputStatusCommand_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::MediaInput::Commands::ShowInputStatus::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_5(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestRenameInputCommand_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::MediaInput::Commands::RenameInput::Type; - - RequestType request; - request.index = 1; - request.name = chip::Span("newNamegarbage: not in length on purpose", 7); - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_6(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_6(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6() { NextTest(); } -}; - -class TestCluster : public TestCommand -{ -public: - TestCluster() : TestCommand("TestCluster"), mTestIndex(0) {} - - /////////// 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 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Send Test Command\n"); - err = TestSendTestCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Send Test Not Handled Command\n"); - err = TestSendTestNotHandledCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Send Test Specific Command\n"); - err = TestSendTestSpecificCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Send Test Add Arguments Command\n"); - err = TestSendTestAddArgumentsCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Send failing Test Add Arguments Command\n"); - err = TestSendFailingTestAddArgumentsCommand_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute BOOLEAN Default Value\n"); - err = TestReadAttributeBooleanDefaultValue_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Write attribute BOOLEAN True\n"); - err = TestWriteAttributeBooleanTrue_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read attribute BOOLEAN True\n"); - err = TestReadAttributeBooleanTrue_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Write attribute BOOLEAN False\n"); - err = TestWriteAttributeBooleanFalse_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Read attribute BOOLEAN False\n"); - err = TestReadAttributeBooleanFalse_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Read attribute BITMAP8 Default Value\n"); - err = TestReadAttributeBitmap8DefaultValue_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Write attribute BITMAP8 Max Value\n"); - err = TestWriteAttributeBitmap8MaxValue_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Read attribute BITMAP8 Max Value\n"); - err = TestReadAttributeBitmap8MaxValue_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Write attribute BITMAP8 Min Value\n"); - err = TestWriteAttributeBitmap8MinValue_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(); - break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : Read attribute INT8U Max Value\n"); - err = TestReadAttributeInt8uMaxValue_33(); - break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : Write attribute INT8U Min Value\n"); - err = TestWriteAttributeInt8uMinValue_34(); - break; - case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : Read attribute INT8U Min Value\n"); - err = TestReadAttributeInt8uMinValue_35(); - break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : Read attribute INT16U Default Value\n"); - err = TestReadAttributeInt16uDefaultValue_36(); - break; - case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : Write attribute INT16U Max Value\n"); - err = TestWriteAttributeInt16uMaxValue_37(); - break; - case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : Read attribute INT16U Max Value\n"); - err = TestReadAttributeInt16uMaxValue_38(); - break; - case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : Write attribute INT16U Min Value\n"); - err = TestWriteAttributeInt16uMinValue_39(); - break; - case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : Read attribute INT16U Min Value\n"); - err = TestReadAttributeInt16uMinValue_40(); - break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : Read attribute INT32U Default Value\n"); - err = TestReadAttributeInt32uDefaultValue_41(); - break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : Write attribute INT32U Max Value\n"); - err = TestWriteAttributeInt32uMaxValue_42(); - break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : Read attribute INT32U Max Value\n"); - err = TestReadAttributeInt32uMaxValue_43(); - break; - case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : Write attribute INT32U Min Value\n"); - err = TestWriteAttributeInt32uMinValue_44(); - break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Read attribute INT32U Min Value\n"); - err = TestReadAttributeInt32uMinValue_45(); - break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : Read attribute INT64U Default Value\n"); - err = TestReadAttributeInt64uDefaultValue_46(); - break; - case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : Write attribute INT64U Max Value\n"); - err = TestWriteAttributeInt64uMaxValue_47(); - break; - case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : Read attribute INT64U Max Value\n"); - err = TestReadAttributeInt64uMaxValue_48(); - break; - case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : Write attribute INT64U Min Value\n"); - err = TestWriteAttributeInt64uMinValue_49(); - break; - case 50: - ChipLogProgress(chipTool, " ***** Test Step 50 : Read attribute INT64U Min Value\n"); - err = TestReadAttributeInt64uMinValue_50(); - break; - case 51: - ChipLogProgress(chipTool, " ***** Test Step 51 : Read attribute INT8S Default Value\n"); - err = TestReadAttributeInt8sDefaultValue_51(); - break; - case 52: - ChipLogProgress(chipTool, " ***** Test Step 52 : Write attribute INT8S Max Value\n"); - err = TestWriteAttributeInt8sMaxValue_52(); - break; - case 53: - ChipLogProgress(chipTool, " ***** Test Step 53 : Read attribute INT8S Max Value\n"); - err = TestReadAttributeInt8sMaxValue_53(); - 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(); - break; - case 98: - ChipLogProgress(chipTool, " ***** Test Step 98 : Write attribute ENUM8 Max Value\n"); - err = TestWriteAttributeEnum8MaxValue_98(); - break; - case 99: - ChipLogProgress(chipTool, " ***** Test Step 99 : Read attribute ENUM8 Max Value\n"); - err = TestReadAttributeEnum8MaxValue_99(); - break; - case 100: - ChipLogProgress(chipTool, " ***** Test Step 100 : Write attribute ENUM8 Min Value\n"); - err = TestWriteAttributeEnum8MinValue_100(); - break; - case 101: - ChipLogProgress(chipTool, " ***** Test Step 101 : Read attribute ENUM8 Min Value\n"); - err = TestReadAttributeEnum8MinValue_101(); - break; - case 102: - ChipLogProgress(chipTool, " ***** Test Step 102 : Read attribute ENUM16 Default Value\n"); - err = TestReadAttributeEnum16DefaultValue_102(); - break; - case 103: - ChipLogProgress(chipTool, " ***** Test Step 103 : Write attribute ENUM16 Max Value\n"); - err = TestWriteAttributeEnum16MaxValue_103(); - break; - case 104: - ChipLogProgress(chipTool, " ***** Test Step 104 : Read attribute ENUM16 Max Value\n"); - err = TestReadAttributeEnum16MaxValue_104(); - break; - case 105: - ChipLogProgress(chipTool, " ***** Test Step 105 : Write attribute ENUM16 Min Value\n"); - err = TestWriteAttributeEnum16MinValue_105(); - break; - case 106: - ChipLogProgress(chipTool, " ***** Test Step 106 : Read attribute ENUM16 Min Value\n"); - err = TestReadAttributeEnum16MinValue_106(); - break; - case 107: - ChipLogProgress(chipTool, " ***** Test Step 107 : Read attribute OCTET_STRING Default Value\n"); - err = TestReadAttributeOctetStringDefaultValue_107(); - break; - case 108: - ChipLogProgress(chipTool, " ***** Test Step 108 : Write attribute OCTET_STRING with embedded null\n"); - err = TestWriteAttributeOctetStringWithEmbeddedNull_108(); - break; - case 109: - ChipLogProgress(chipTool, " ***** Test Step 109 : Read attribute OCTET_STRING with embedded null\n"); - err = TestReadAttributeOctetStringWithEmbeddedNull_109(); - break; - case 110: - ChipLogProgress(chipTool, " ***** Test Step 110 : Write attribute OCTET_STRING\n"); - err = TestWriteAttributeOctetString_110(); - break; - case 111: - ChipLogProgress(chipTool, " ***** Test Step 111 : Read attribute OCTET_STRING\n"); - err = TestReadAttributeOctetString_111(); - break; - case 112: - ChipLogProgress(chipTool, " ***** Test Step 112 : Write attribute OCTET_STRING\n"); - err = TestWriteAttributeOctetString_112(); - break; - case 113: - ChipLogProgress(chipTool, " ***** Test Step 113 : Read attribute OCTET_STRING\n"); - err = TestReadAttributeOctetString_113(); - break; - case 114: - ChipLogProgress(chipTool, " ***** Test Step 114 : Write attribute OCTET_STRING\n"); - err = TestWriteAttributeOctetString_114(); - break; - case 115: - ChipLogProgress(chipTool, " ***** Test Step 115 : Read attribute LONG_OCTET_STRING Default Value\n"); - err = TestReadAttributeLongOctetStringDefaultValue_115(); - break; - case 116: - ChipLogProgress(chipTool, " ***** Test Step 116 : Write attribute LONG_OCTET_STRING\n"); - err = TestWriteAttributeLongOctetString_116(); - break; - case 117: - ChipLogProgress(chipTool, " ***** Test Step 117 : Read attribute LONG_OCTET_STRING\n"); - err = TestReadAttributeLongOctetString_117(); - break; - case 118: - ChipLogProgress(chipTool, " ***** Test Step 118 : Write attribute LONG_OCTET_STRING\n"); - err = TestWriteAttributeLongOctetString_118(); - break; - case 119: - ChipLogProgress(chipTool, " ***** Test Step 119 : Read attribute CHAR_STRING Default Value\n"); - err = TestReadAttributeCharStringDefaultValue_119(); - break; - case 120: - ChipLogProgress(chipTool, " ***** Test Step 120 : Write attribute CHAR_STRING\n"); - err = TestWriteAttributeCharString_120(); - break; - case 121: - ChipLogProgress(chipTool, " ***** Test Step 121 : Read attribute CHAR_STRING\n"); - err = TestReadAttributeCharString_121(); - break; - case 122: - ChipLogProgress(chipTool, " ***** Test Step 122 : Write attribute CHAR_STRING - Value too long\n"); - err = TestWriteAttributeCharStringValueTooLong_122(); - break; - case 123: - ChipLogProgress(chipTool, " ***** Test Step 123 : Read attribute CHAR_STRING\n"); - err = TestReadAttributeCharString_123(); - break; - case 124: - ChipLogProgress(chipTool, " ***** Test Step 124 : Write attribute CHAR_STRING - Empty\n"); - err = TestWriteAttributeCharStringEmpty_124(); - break; - case 125: - ChipLogProgress(chipTool, " ***** Test Step 125 : Read attribute LONG_CHAR_STRING Default Value\n"); - err = TestReadAttributeLongCharStringDefaultValue_125(); - break; - case 126: - ChipLogProgress(chipTool, " ***** Test Step 126 : Write attribute LONG_CHAR_STRING\n"); - err = TestWriteAttributeLongCharString_126(); - break; - case 127: - ChipLogProgress(chipTool, " ***** Test Step 127 : Read attribute LONG_CHAR_STRING\n"); - err = TestReadAttributeLongCharString_127(); - break; - 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 LIST_LONG_OCTET_STRING\n"); - err = TestReadAttributeListLongOctetString_129(); - break; - case 130: - ChipLogProgress(chipTool, " ***** Test Step 130 : Read attribute EPOCH_US Default Value\n"); - err = TestReadAttributeEpochUsDefaultValue_130(); - break; - case 131: - ChipLogProgress(chipTool, " ***** Test Step 131 : Write attribute EPOCH_US Max Value\n"); - err = TestWriteAttributeEpochUsMaxValue_131(); - break; - case 132: - ChipLogProgress(chipTool, " ***** Test Step 132 : Read attribute EPOCH_US Max Value\n"); - err = TestReadAttributeEpochUsMaxValue_132(); - break; - case 133: - ChipLogProgress(chipTool, " ***** Test Step 133 : Write attribute EPOCH_US Min Value\n"); - err = TestWriteAttributeEpochUsMinValue_133(); - break; - case 134: - ChipLogProgress(chipTool, " ***** Test Step 134 : Read attribute EPOCH_US Min Value\n"); - err = TestReadAttributeEpochUsMinValue_134(); - break; - case 135: - ChipLogProgress(chipTool, " ***** Test Step 135 : Read attribute EPOCH_S Default Value\n"); - err = TestReadAttributeEpochSDefaultValue_135(); - break; - case 136: - ChipLogProgress(chipTool, " ***** Test Step 136 : Write attribute EPOCH_S Max Value\n"); - err = TestWriteAttributeEpochSMaxValue_136(); - break; - case 137: - ChipLogProgress(chipTool, " ***** Test Step 137 : Read attribute EPOCH_S Max Value\n"); - err = TestReadAttributeEpochSMaxValue_137(); - break; - case 138: - ChipLogProgress(chipTool, " ***** Test Step 138 : Write attribute EPOCH_S Min Value\n"); - err = TestWriteAttributeEpochSMinValue_138(); - break; - case 139: - ChipLogProgress(chipTool, " ***** Test Step 139 : Read attribute EPOCH_S Min Value\n"); - err = TestReadAttributeEpochSMinValue_139(); - break; - case 140: - ChipLogProgress(chipTool, " ***** Test Step 140 : Read attribute UNSUPPORTED\n"); - err = TestReadAttributeUnsupported_140(); - break; - case 141: - ChipLogProgress(chipTool, " ***** Test Step 141 : Writeattribute UNSUPPORTED\n"); - err = TestWriteattributeUnsupported_141(); - break; - case 142: - ChipLogProgress(chipTool, " ***** Test Step 142 : Send Test Command to unsupported endpoint\n"); - err = TestSendTestCommandToUnsupportedEndpoint_142(); - break; - case 143: - ChipLogProgress(chipTool, " ***** Test Step 143 : Send Test Command to unsupported cluster\n"); - err = TestSendTestCommandToUnsupportedCluster_143(); - break; - case 144: - ChipLogProgress(chipTool, " ***** Test Step 144 : Read attribute vendor_id Default Value\n"); - err = TestReadAttributeVendorIdDefaultValue_144(); - break; - case 145: - ChipLogProgress(chipTool, " ***** Test Step 145 : Write attribute vendor_id\n"); - err = TestWriteAttributeVendorId_145(); - break; - case 146: - ChipLogProgress(chipTool, " ***** Test Step 146 : Read attribute vendor_id\n"); - err = TestReadAttributeVendorId_146(); - break; - case 147: - ChipLogProgress(chipTool, " ***** Test Step 147 : Restore attribute vendor_id\n"); - err = TestRestoreAttributeVendorId_147(); - break; - case 148: - ChipLogProgress(chipTool, " ***** Test Step 148 : Send a command with a vendor_id and enum\n"); - err = TestSendACommandWithAVendorIdAndEnum_148(); - break; - case 149: - ChipLogProgress(chipTool, " ***** Test Step 149 : Send Test Command With Struct Argument and arg1.b is true\n"); - err = TestSendTestCommandWithStructArgumentAndArg1bIsTrue_149(); - break; - case 150: - ChipLogProgress(chipTool, " ***** Test Step 150 : Send Test Command With Struct Argument and arg1.b is false\n"); - err = TestSendTestCommandWithStructArgumentAndArg1bIsFalse_150(); - break; - case 151: - ChipLogProgress(chipTool, - " ***** Test Step 151 : Send Test Command With Nested Struct Argument and arg1.c.b is true\n"); - err = TestSendTestCommandWithNestedStructArgumentAndArg1cbIsTrue_151(); - break; - case 152: - ChipLogProgress(chipTool, " ***** Test Step 152 : Send Test Command With Nested Struct Argument arg1.c.b is false\n"); - err = TestSendTestCommandWithNestedStructArgumentArg1cbIsFalse_152(); - break; - case 153: - ChipLogProgress( - chipTool, - " ***** Test Step 153 : Send Test Command With Nested Struct List Argument and all fields b of arg1.d are true\n"); - err = TestSendTestCommandWithNestedStructListArgumentAndAllFieldsBOfArg1dAreTrue_153(); - break; - case 154: - ChipLogProgress(chipTool, - " ***** Test Step 154 : Send Test Command With Nested Struct List Argument and some fields b of arg1.d " - "are false\n"); - err = TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfArg1dAreFalse_154(); - break; - case 155: - ChipLogProgress(chipTool, " ***** Test Step 155 : Send Test Command With Struct Argument and see what we get back\n"); - err = TestSendTestCommandWithStructArgumentAndSeeWhatWeGetBack_155(); - break; - case 156: - ChipLogProgress(chipTool, " ***** Test Step 156 : Send Test Command With List of INT8U and none of them is set to 0\n"); - err = TestSendTestCommandWithListOfInt8uAndNoneOfThemIsSetTo0_156(); - break; - case 157: - ChipLogProgress(chipTool, " ***** Test Step 157 : Send Test Command With List of INT8U and one of them is set to 0\n"); - err = TestSendTestCommandWithListOfInt8uAndOneOfThemIsSetTo0_157(); - break; - case 158: - ChipLogProgress(chipTool, " ***** Test Step 158 : Send Test Command With List of INT8U and get it reversed\n"); - err = TestSendTestCommandWithListOfInt8uAndGetItReversed_158(); - break; - case 159: - ChipLogProgress(chipTool, - " ***** Test Step 159 : Send Test Command With empty List of INT8U and get an empty list back\n"); - err = TestSendTestCommandWithEmptyListOfInt8uAndGetAnEmptyListBack_159(); - break; - case 160: - ChipLogProgress( - chipTool, - " ***** Test Step 160 : Send Test Command With List of Struct Argument and arg1.b of first item is true\n"); - err = TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsTrue_160(); - break; - case 161: - ChipLogProgress( - chipTool, - " ***** Test Step 161 : Send Test Command With List of Struct Argument and arg1.b of first item is false\n"); - err = TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsFalse_161(); - break; - case 162: - ChipLogProgress(chipTool, - " ***** Test Step 162 : Send Test Command With List of Nested Struct List Argument and all fields b of " - "elements of arg1.d are true\n"); - err = TestSendTestCommandWithListOfNestedStructListArgumentAndAllFieldsBOfElementsOfArg1dAreTrue_162(); - break; - case 163: - ChipLogProgress(chipTool, - " ***** Test Step 163 : Send Test Command With Nested Struct List Argument and some fields b of " - "elements of arg1.d are false\n"); - err = TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfElementsOfArg1dAreFalse_163(); - break; - case 164: - ChipLogProgress(chipTool, - " ***** Test Step 164 : Write attribute LIST With List of INT8U and none of them is set to 0\n"); - err = TestWriteAttributeListWithListOfInt8uAndNoneOfThemIsSetTo0_164(); - break; - case 165: - ChipLogProgress(chipTool, " ***** Test Step 165 : Read attribute LIST With List of INT8U\n"); - err = TestReadAttributeListWithListOfInt8u_165(); - break; - case 166: - ChipLogProgress(chipTool, " ***** Test Step 166 : Write attribute LIST With List of OCTET_STRING\n"); - err = TestWriteAttributeListWithListOfOctetString_166(); - break; - case 167: - ChipLogProgress(chipTool, " ***** Test Step 167 : Read attribute LIST With List of OCTET_STRING\n"); - err = TestReadAttributeListWithListOfOctetString_167(); - break; - case 168: - ChipLogProgress(chipTool, " ***** Test Step 168 : Write attribute LIST With List of LIST_STRUCT_OCTET_STRING\n"); - err = TestWriteAttributeListWithListOfListStructOctetString_168(); - break; - case 169: - ChipLogProgress(chipTool, " ***** Test Step 169 : Read attribute LIST With List of LIST_STRUCT_OCTET_STRING\n"); - err = TestReadAttributeListWithListOfListStructOctetString_169(); - break; - case 170: - ChipLogProgress(chipTool, " ***** Test Step 170 : Send Test Command with optional arg set.\n"); - err = TestSendTestCommandWithOptionalArgSet_170(); - break; - case 171: - ChipLogProgress(chipTool, " ***** Test Step 171 : Send Test Command without its optional arg.\n"); - err = TestSendTestCommandWithoutItsOptionalArg_171(); - break; - case 172: - ChipLogProgress(chipTool, " ***** Test Step 172 : Write attribute NULLABLE_BOOLEAN null\n"); - err = TestWriteAttributeNullableBooleanNull_172(); - break; - case 173: - ChipLogProgress(chipTool, " ***** Test Step 173 : Read attribute NULLABLE_BOOLEAN null\n"); - err = TestReadAttributeNullableBooleanNull_173(); - break; - case 174: - ChipLogProgress(chipTool, " ***** Test Step 174 : Write attribute NULLABLE_BOOLEAN True\n"); - err = TestWriteAttributeNullableBooleanTrue_174(); - break; - case 175: - ChipLogProgress(chipTool, " ***** Test Step 175 : Read attribute NULLABLE_BOOLEAN True\n"); - err = TestReadAttributeNullableBooleanTrue_175(); - break; - case 176: - ChipLogProgress(chipTool, " ***** Test Step 176 : Write attribute NULLABLE_BITMAP8 Max Value\n"); - err = TestWriteAttributeNullableBitmap8MaxValue_176(); - break; - case 177: - ChipLogProgress(chipTool, " ***** Test Step 177 : Read attribute NULLABLE_BITMAP8 Max Value\n"); - err = TestReadAttributeNullableBitmap8MaxValue_177(); - break; - case 178: - ChipLogProgress(chipTool, " ***** Test Step 178 : Write attribute NULLABLE_BITMAP8 Invalid Value\n"); - err = TestWriteAttributeNullableBitmap8InvalidValue_178(); - break; - case 179: - ChipLogProgress(chipTool, " ***** Test Step 179 : Read attribute NULLABLE_BITMAP8 unchanged Value\n"); - err = TestReadAttributeNullableBitmap8UnchangedValue_179(); - break; - case 180: - ChipLogProgress(chipTool, " ***** Test Step 180 : Write attribute NULLABLE_BITMAP8 null Value\n"); - err = TestWriteAttributeNullableBitmap8NullValue_180(); - break; - case 181: - ChipLogProgress(chipTool, " ***** Test Step 181 : Read attribute NULLABLE_BITMAP8 null Value\n"); - err = TestReadAttributeNullableBitmap8NullValue_181(); - break; - case 182: - ChipLogProgress(chipTool, " ***** Test Step 182 : Write attribute NULLABLE_BITMAP16 Max Value\n"); - err = TestWriteAttributeNullableBitmap16MaxValue_182(); - break; - case 183: - ChipLogProgress(chipTool, " ***** Test Step 183 : Read attribute NULLABLE_BITMAP16 Max Value\n"); - err = TestReadAttributeNullableBitmap16MaxValue_183(); - break; - case 184: - ChipLogProgress(chipTool, " ***** Test Step 184 : Write attribute NULLABLE_BITMAP16 Invalid Value\n"); - err = TestWriteAttributeNullableBitmap16InvalidValue_184(); - break; - case 185: - ChipLogProgress(chipTool, " ***** Test Step 185 : Read attribute NULLABLE_BITMAP16 unchanged Value\n"); - err = TestReadAttributeNullableBitmap16UnchangedValue_185(); - break; - case 186: - ChipLogProgress(chipTool, " ***** Test Step 186 : Write attribute NULLABLE_BITMAP16 null Value\n"); - err = TestWriteAttributeNullableBitmap16NullValue_186(); - break; - case 187: - ChipLogProgress(chipTool, " ***** Test Step 187 : Read attribute NULLABLE_BITMAP16 null Value\n"); - err = TestReadAttributeNullableBitmap16NullValue_187(); - break; - case 188: - ChipLogProgress(chipTool, " ***** Test Step 188 : Write attribute NULLABLE_BITMAP32 Max Value\n"); - err = TestWriteAttributeNullableBitmap32MaxValue_188(); - break; - case 189: - ChipLogProgress(chipTool, " ***** Test Step 189 : Read attribute NULLABLE_BITMAP32 Max Value\n"); - err = TestReadAttributeNullableBitmap32MaxValue_189(); - break; - case 190: - ChipLogProgress(chipTool, " ***** Test Step 190 : Write attribute NULLABLE_BITMAP32 Invalid Value\n"); - err = TestWriteAttributeNullableBitmap32InvalidValue_190(); - break; - case 191: - ChipLogProgress(chipTool, " ***** Test Step 191 : Read attribute NULLABLE_BITMAP32 unchanged Value\n"); - err = TestReadAttributeNullableBitmap32UnchangedValue_191(); - break; - case 192: - ChipLogProgress(chipTool, " ***** Test Step 192 : Write attribute NULLABLE_BITMAP32 null Value\n"); - err = TestWriteAttributeNullableBitmap32NullValue_192(); - break; - case 193: - ChipLogProgress(chipTool, " ***** Test Step 193 : Read attribute NULLABLE_BITMAP32 null Value\n"); - err = TestReadAttributeNullableBitmap32NullValue_193(); - break; - case 194: - ChipLogProgress(chipTool, " ***** Test Step 194 : Write attribute NULLABLE_BITMAP64 Max Value\n"); - err = TestWriteAttributeNullableBitmap64MaxValue_194(); - break; - case 195: - ChipLogProgress(chipTool, " ***** Test Step 195 : Read attribute NULLABLE_BITMAP64 Max Value\n"); - err = TestReadAttributeNullableBitmap64MaxValue_195(); - break; - case 196: - ChipLogProgress(chipTool, " ***** Test Step 196 : Write attribute NULLABLE_BITMAP64 Invalid Value\n"); - err = TestWriteAttributeNullableBitmap64InvalidValue_196(); - break; - case 197: - ChipLogProgress(chipTool, " ***** Test Step 197 : Read attribute NULLABLE_BITMAP64 unchanged Value\n"); - err = TestReadAttributeNullableBitmap64UnchangedValue_197(); - break; - case 198: - ChipLogProgress(chipTool, " ***** Test Step 198 : Write attribute NULLABLE_BITMAP64 null Value\n"); - err = TestWriteAttributeNullableBitmap64NullValue_198(); - break; - case 199: - ChipLogProgress(chipTool, " ***** Test Step 199 : Read attribute NULLABLE_BITMAP64 null Value\n"); - err = TestReadAttributeNullableBitmap64NullValue_199(); - break; - case 200: - ChipLogProgress(chipTool, " ***** Test Step 200 : Write attribute NULLABLE_INT8U Min Value\n"); - err = TestWriteAttributeNullableInt8uMinValue_200(); - break; - case 201: - ChipLogProgress(chipTool, " ***** Test Step 201 : Read attribute NULLABLE_INT8U Min Value\n"); - err = TestReadAttributeNullableInt8uMinValue_201(); - break; - case 202: - ChipLogProgress(chipTool, " ***** Test Step 202 : Write attribute NULLABLE_INT8U Max Value\n"); - err = TestWriteAttributeNullableInt8uMaxValue_202(); - break; - case 203: - ChipLogProgress(chipTool, " ***** Test Step 203 : Read attribute NULLABLE_INT8U Max Value\n"); - err = TestReadAttributeNullableInt8uMaxValue_203(); - break; - case 204: - ChipLogProgress(chipTool, " ***** Test Step 204 : Write attribute NULLABLE_INT8U Invalid Value\n"); - err = TestWriteAttributeNullableInt8uInvalidValue_204(); - break; - case 205: - ChipLogProgress(chipTool, " ***** Test Step 205 : Read attribute NULLABLE_INT8U unchanged Value\n"); - err = TestReadAttributeNullableInt8uUnchangedValue_205(); - break; - case 206: - ChipLogProgress(chipTool, " ***** Test Step 206 : Write attribute NULLABLE_INT8U null Value\n"); - err = TestWriteAttributeNullableInt8uNullValue_206(); - break; - case 207: - ChipLogProgress(chipTool, " ***** Test Step 207 : Read attribute NULLABLE_INT8U null Value\n"); - err = TestReadAttributeNullableInt8uNullValue_207(); - break; - case 208: - ChipLogProgress(chipTool, " ***** Test Step 208 : Read attribute NULLABLE_INT8U null Value & range\n"); - err = TestReadAttributeNullableInt8uNullValueRange_208(); - break; - case 209: - ChipLogProgress(chipTool, " ***** Test Step 209 : Read attribute NULLABLE_INT8U null Value & not\n"); - err = TestReadAttributeNullableInt8uNullValueNot_209(); - break; - case 210: - ChipLogProgress(chipTool, " ***** Test Step 210 : Write attribute NULLABLE_INT8U Value\n"); - err = TestWriteAttributeNullableInt8uValue_210(); - break; - case 211: - ChipLogProgress(chipTool, " ***** Test Step 211 : Read attribute NULLABLE_INT8U Value in range\n"); - err = TestReadAttributeNullableInt8uValueInRange_211(); - break; - case 212: - ChipLogProgress(chipTool, " ***** Test Step 212 : Read attribute NULLABLE_INT8U notValue OK\n"); - err = TestReadAttributeNullableInt8uNotValueOk_212(); - break; - case 213: - ChipLogProgress(chipTool, " ***** Test Step 213 : Write attribute NULLABLE_INT16U Min Value\n"); - err = TestWriteAttributeNullableInt16uMinValue_213(); - break; - case 214: - ChipLogProgress(chipTool, " ***** Test Step 214 : Read attribute NULLABLE_INT16U Min Value\n"); - err = TestReadAttributeNullableInt16uMinValue_214(); - break; - case 215: - ChipLogProgress(chipTool, " ***** Test Step 215 : Write attribute NULLABLE_INT16U Max Value\n"); - err = TestWriteAttributeNullableInt16uMaxValue_215(); - break; - case 216: - ChipLogProgress(chipTool, " ***** Test Step 216 : Read attribute NULLABLE_INT16U Max Value\n"); - err = TestReadAttributeNullableInt16uMaxValue_216(); - break; - case 217: - ChipLogProgress(chipTool, " ***** Test Step 217 : Write attribute NULLABLE_INT16U Invalid Value\n"); - err = TestWriteAttributeNullableInt16uInvalidValue_217(); - break; - case 218: - ChipLogProgress(chipTool, " ***** Test Step 218 : Read attribute NULLABLE_INT16U unchanged Value\n"); - err = TestReadAttributeNullableInt16uUnchangedValue_218(); - break; - case 219: - ChipLogProgress(chipTool, " ***** Test Step 219 : Write attribute NULLABLE_INT16U null Value\n"); - err = TestWriteAttributeNullableInt16uNullValue_219(); - break; - case 220: - ChipLogProgress(chipTool, " ***** Test Step 220 : Read attribute NULLABLE_INT16U null Value\n"); - err = TestReadAttributeNullableInt16uNullValue_220(); - break; - case 221: - ChipLogProgress(chipTool, " ***** Test Step 221 : Read attribute NULLABLE_INT16U null Value & range\n"); - err = TestReadAttributeNullableInt16uNullValueRange_221(); - break; - case 222: - ChipLogProgress(chipTool, " ***** Test Step 222 : Read attribute NULLABLE_INT16U null Value & not\n"); - err = TestReadAttributeNullableInt16uNullValueNot_222(); - break; - case 223: - ChipLogProgress(chipTool, " ***** Test Step 223 : Write attribute NULLABLE_INT16U Value\n"); - err = TestWriteAttributeNullableInt16uValue_223(); - break; - case 224: - ChipLogProgress(chipTool, " ***** Test Step 224 : Read attribute NULLABLE_INT16U Value in range\n"); - err = TestReadAttributeNullableInt16uValueInRange_224(); - break; - case 225: - ChipLogProgress(chipTool, " ***** Test Step 225 : Read attribute NULLABLE_INT16U notValue OK\n"); - err = TestReadAttributeNullableInt16uNotValueOk_225(); - break; - case 226: - ChipLogProgress(chipTool, " ***** Test Step 226 : Write attribute NULLABLE_INT32U Min Value\n"); - err = TestWriteAttributeNullableInt32uMinValue_226(); - break; - case 227: - ChipLogProgress(chipTool, " ***** Test Step 227 : Read attribute NULLABLE_INT32U Min Value\n"); - err = TestReadAttributeNullableInt32uMinValue_227(); - break; - case 228: - ChipLogProgress(chipTool, " ***** Test Step 228 : Write attribute NULLABLE_INT32U Max Value\n"); - err = TestWriteAttributeNullableInt32uMaxValue_228(); - break; - case 229: - ChipLogProgress(chipTool, " ***** Test Step 229 : Read attribute NULLABLE_INT32U Max Value\n"); - err = TestReadAttributeNullableInt32uMaxValue_229(); - break; - case 230: - ChipLogProgress(chipTool, " ***** Test Step 230 : Write attribute NULLABLE_INT32U Invalid Value\n"); - err = TestWriteAttributeNullableInt32uInvalidValue_230(); - break; - case 231: - ChipLogProgress(chipTool, " ***** Test Step 231 : Read attribute NULLABLE_INT32U unchanged Value\n"); - err = TestReadAttributeNullableInt32uUnchangedValue_231(); - break; - case 232: - ChipLogProgress(chipTool, " ***** Test Step 232 : Write attribute NULLABLE_INT32U null Value\n"); - err = TestWriteAttributeNullableInt32uNullValue_232(); - break; - case 233: - ChipLogProgress(chipTool, " ***** Test Step 233 : Read attribute NULLABLE_INT32U null Value\n"); - err = TestReadAttributeNullableInt32uNullValue_233(); - break; - case 234: - ChipLogProgress(chipTool, " ***** Test Step 234 : Read attribute NULLABLE_INT32U null Value & range\n"); - err = TestReadAttributeNullableInt32uNullValueRange_234(); - break; - case 235: - ChipLogProgress(chipTool, " ***** Test Step 235 : Read attribute NULLABLE_INT32U null Value & not\n"); - err = TestReadAttributeNullableInt32uNullValueNot_235(); - break; - case 236: - ChipLogProgress(chipTool, " ***** Test Step 236 : Write attribute NULLABLE_INT32U Value\n"); - err = TestWriteAttributeNullableInt32uValue_236(); - break; - case 237: - ChipLogProgress(chipTool, " ***** Test Step 237 : Read attribute NULLABLE_INT32U Value in range\n"); - err = TestReadAttributeNullableInt32uValueInRange_237(); - break; - case 238: - ChipLogProgress(chipTool, " ***** Test Step 238 : Read attribute NULLABLE_INT32U notValue OK\n"); - err = TestReadAttributeNullableInt32uNotValueOk_238(); - break; - case 239: - ChipLogProgress(chipTool, " ***** Test Step 239 : Write attribute NULLABLE_INT64U Min Value\n"); - err = TestWriteAttributeNullableInt64uMinValue_239(); - break; - case 240: - ChipLogProgress(chipTool, " ***** Test Step 240 : Read attribute NULLABLE_INT64U Min Value\n"); - err = TestReadAttributeNullableInt64uMinValue_240(); - break; - case 241: - ChipLogProgress(chipTool, " ***** Test Step 241 : Write attribute NULLABLE_INT64U Max Value\n"); - err = TestWriteAttributeNullableInt64uMaxValue_241(); - break; - case 242: - ChipLogProgress(chipTool, " ***** Test Step 242 : Read attribute NULLABLE_INT64U Max Value\n"); - err = TestReadAttributeNullableInt64uMaxValue_242(); - break; - case 243: - ChipLogProgress(chipTool, " ***** Test Step 243 : Write attribute NULLABLE_INT64U Invalid Value\n"); - err = TestWriteAttributeNullableInt64uInvalidValue_243(); - break; - case 244: - ChipLogProgress(chipTool, " ***** Test Step 244 : Read attribute NULLABLE_INT64U unchanged Value\n"); - err = TestReadAttributeNullableInt64uUnchangedValue_244(); - break; - case 245: - ChipLogProgress(chipTool, " ***** Test Step 245 : Write attribute NULLABLE_INT64U null Value\n"); - err = TestWriteAttributeNullableInt64uNullValue_245(); - break; - case 246: - ChipLogProgress(chipTool, " ***** Test Step 246 : Read attribute NULLABLE_INT64U null Value\n"); - err = TestReadAttributeNullableInt64uNullValue_246(); - break; - case 247: - ChipLogProgress(chipTool, " ***** Test Step 247 : Read attribute NULLABLE_INT64U null Value & range\n"); - err = TestReadAttributeNullableInt64uNullValueRange_247(); - break; - case 248: - ChipLogProgress(chipTool, " ***** Test Step 248 : Read attribute NULLABLE_INT64U null Value & not\n"); - err = TestReadAttributeNullableInt64uNullValueNot_248(); - break; - case 249: - ChipLogProgress(chipTool, " ***** Test Step 249 : Write attribute NULLABLE_INT64U Value\n"); - err = TestWriteAttributeNullableInt64uValue_249(); - break; - case 250: - ChipLogProgress(chipTool, " ***** Test Step 250 : Read attribute NULLABLE_INT64U Value in range\n"); - err = TestReadAttributeNullableInt64uValueInRange_250(); - break; - case 251: - ChipLogProgress(chipTool, " ***** Test Step 251 : Read attribute NULLABLE_INT64U notValue OK\n"); - err = TestReadAttributeNullableInt64uNotValueOk_251(); - break; - case 252: - ChipLogProgress(chipTool, " ***** Test Step 252 : Write attribute NULLABLE_INT8S Min Value\n"); - err = TestWriteAttributeNullableInt8sMinValue_252(); - break; - case 253: - ChipLogProgress(chipTool, " ***** Test Step 253 : Read attribute NULLABLE_INT8S Min Value\n"); - err = TestReadAttributeNullableInt8sMinValue_253(); - break; - case 254: - ChipLogProgress(chipTool, " ***** Test Step 254 : Write attribute NULLABLE_INT8S Invalid Value\n"); - err = TestWriteAttributeNullableInt8sInvalidValue_254(); - break; - case 255: - ChipLogProgress(chipTool, " ***** Test Step 255 : Read attribute NULLABLE_INT8S unchanged Value\n"); - err = TestReadAttributeNullableInt8sUnchangedValue_255(); - break; - case 256: - ChipLogProgress(chipTool, " ***** Test Step 256 : Write attribute NULLABLE_INT8S null Value\n"); - err = TestWriteAttributeNullableInt8sNullValue_256(); - break; - case 257: - ChipLogProgress(chipTool, " ***** Test Step 257 : Read attribute NULLABLE_INT8S null Value\n"); - err = TestReadAttributeNullableInt8sNullValue_257(); - break; - case 258: - ChipLogProgress(chipTool, " ***** Test Step 258 : Read attribute NULLABLE_INT8S null Value & range\n"); - err = TestReadAttributeNullableInt8sNullValueRange_258(); - break; - case 259: - ChipLogProgress(chipTool, " ***** Test Step 259 : Read attribute NULLABLE_INT8S null Value & not\n"); - err = TestReadAttributeNullableInt8sNullValueNot_259(); - break; - case 260: - ChipLogProgress(chipTool, " ***** Test Step 260 : Write attribute NULLABLE_INT8S Value\n"); - err = TestWriteAttributeNullableInt8sValue_260(); - break; - case 261: - ChipLogProgress(chipTool, " ***** Test Step 261 : Read attribute NULLABLE_INT8S Value in range\n"); - err = TestReadAttributeNullableInt8sValueInRange_261(); - break; - case 262: - ChipLogProgress(chipTool, " ***** Test Step 262 : Read attribute NULLABLE_INT8S notValue OK\n"); - err = TestReadAttributeNullableInt8sNotValueOk_262(); - break; - case 263: - ChipLogProgress(chipTool, " ***** Test Step 263 : Write attribute NULLABLE_INT16S Min Value\n"); - err = TestWriteAttributeNullableInt16sMinValue_263(); - break; - case 264: - ChipLogProgress(chipTool, " ***** Test Step 264 : Read attribute NULLABLE_INT16S Min Value\n"); - err = TestReadAttributeNullableInt16sMinValue_264(); - break; - case 265: - ChipLogProgress(chipTool, " ***** Test Step 265 : Write attribute NULLABLE_INT16S Invalid Value\n"); - err = TestWriteAttributeNullableInt16sInvalidValue_265(); - break; - case 266: - ChipLogProgress(chipTool, " ***** Test Step 266 : Read attribute NULLABLE_INT16S unchanged Value\n"); - err = TestReadAttributeNullableInt16sUnchangedValue_266(); - break; - case 267: - ChipLogProgress(chipTool, " ***** Test Step 267 : Write attribute NULLABLE_INT16S null Value\n"); - err = TestWriteAttributeNullableInt16sNullValue_267(); - break; - case 268: - ChipLogProgress(chipTool, " ***** Test Step 268 : Read attribute NULLABLE_INT16S null Value\n"); - err = TestReadAttributeNullableInt16sNullValue_268(); - break; - case 269: - ChipLogProgress(chipTool, " ***** Test Step 269 : Read attribute NULLABLE_INT16S null Value & range\n"); - err = TestReadAttributeNullableInt16sNullValueRange_269(); - break; - case 270: - ChipLogProgress(chipTool, " ***** Test Step 270 : Read attribute NULLABLE_INT16S null Value & not\n"); - err = TestReadAttributeNullableInt16sNullValueNot_270(); - break; - case 271: - ChipLogProgress(chipTool, " ***** Test Step 271 : Write attribute NULLABLE_INT16S Value\n"); - err = TestWriteAttributeNullableInt16sValue_271(); - break; - case 272: - ChipLogProgress(chipTool, " ***** Test Step 272 : Read attribute NULLABLE_INT16S Value in range\n"); - err = TestReadAttributeNullableInt16sValueInRange_272(); - break; - case 273: - ChipLogProgress(chipTool, " ***** Test Step 273 : Read attribute NULLABLE_INT16S notValue OK\n"); - err = TestReadAttributeNullableInt16sNotValueOk_273(); - break; - case 274: - ChipLogProgress(chipTool, " ***** Test Step 274 : Write attribute NULLABLE_INT32S Min Value\n"); - err = TestWriteAttributeNullableInt32sMinValue_274(); - break; - case 275: - ChipLogProgress(chipTool, " ***** Test Step 275 : Read attribute NULLABLE_INT32S Min Value\n"); - err = TestReadAttributeNullableInt32sMinValue_275(); - break; - case 276: - ChipLogProgress(chipTool, " ***** Test Step 276 : Write attribute NULLABLE_INT32S Invalid Value\n"); - err = TestWriteAttributeNullableInt32sInvalidValue_276(); - break; - case 277: - ChipLogProgress(chipTool, " ***** Test Step 277 : Read attribute NULLABLE_INT32S unchanged Value\n"); - err = TestReadAttributeNullableInt32sUnchangedValue_277(); - break; - case 278: - ChipLogProgress(chipTool, " ***** Test Step 278 : Write attribute NULLABLE_INT32S null Value\n"); - err = TestWriteAttributeNullableInt32sNullValue_278(); - break; - case 279: - ChipLogProgress(chipTool, " ***** Test Step 279 : Read attribute NULLABLE_INT32S null Value\n"); - err = TestReadAttributeNullableInt32sNullValue_279(); - break; - case 280: - ChipLogProgress(chipTool, " ***** Test Step 280 : Read attribute NULLABLE_INT32S null Value & range\n"); - err = TestReadAttributeNullableInt32sNullValueRange_280(); - break; - case 281: - ChipLogProgress(chipTool, " ***** Test Step 281 : Read attribute NULLABLE_INT32S null Value & not\n"); - err = TestReadAttributeNullableInt32sNullValueNot_281(); - break; - case 282: - ChipLogProgress(chipTool, " ***** Test Step 282 : Write attribute NULLABLE_INT32S Value\n"); - err = TestWriteAttributeNullableInt32sValue_282(); - break; - case 283: - ChipLogProgress(chipTool, " ***** Test Step 283 : Read attribute NULLABLE_INT32S Value in range\n"); - err = TestReadAttributeNullableInt32sValueInRange_283(); - break; - case 284: - ChipLogProgress(chipTool, " ***** Test Step 284 : Read attribute NULLABLE_INT32S notValue OK\n"); - err = TestReadAttributeNullableInt32sNotValueOk_284(); - break; - case 285: - ChipLogProgress(chipTool, " ***** Test Step 285 : Write attribute NULLABLE_INT64S Min Value\n"); - err = TestWriteAttributeNullableInt64sMinValue_285(); - break; - case 286: - ChipLogProgress(chipTool, " ***** Test Step 286 : Read attribute NULLABLE_INT64S Min Value\n"); - err = TestReadAttributeNullableInt64sMinValue_286(); - break; - case 287: - ChipLogProgress(chipTool, " ***** Test Step 287 : Write attribute NULLABLE_INT64S Invalid Value\n"); - err = TestWriteAttributeNullableInt64sInvalidValue_287(); - break; - case 288: - ChipLogProgress(chipTool, " ***** Test Step 288 : Read attribute NULLABLE_INT64S unchanged Value\n"); - err = TestReadAttributeNullableInt64sUnchangedValue_288(); - break; - case 289: - ChipLogProgress(chipTool, " ***** Test Step 289 : Write attribute NULLABLE_INT64S null Value\n"); - err = TestWriteAttributeNullableInt64sNullValue_289(); - break; - case 290: - ChipLogProgress(chipTool, " ***** Test Step 290 : Read attribute NULLABLE_INT64S null Value\n"); - err = TestReadAttributeNullableInt64sNullValue_290(); - break; - case 291: - ChipLogProgress(chipTool, " ***** Test Step 291 : Read attribute NULLABLE_INT64S null Value & range\n"); - err = TestReadAttributeNullableInt64sNullValueRange_291(); - break; - case 292: - ChipLogProgress(chipTool, " ***** Test Step 292 : Read attribute NULLABLE_INT64S null Value & not\n"); - err = TestReadAttributeNullableInt64sNullValueNot_292(); - break; - case 293: - ChipLogProgress(chipTool, " ***** Test Step 293 : Write attribute NULLABLE_INT64S Value\n"); - err = TestWriteAttributeNullableInt64sValue_293(); - break; - case 294: - ChipLogProgress(chipTool, " ***** Test Step 294 : Read attribute NULLABLE_INT64S Value in range\n"); - err = TestReadAttributeNullableInt64sValueInRange_294(); - break; - case 295: - ChipLogProgress(chipTool, " ***** Test Step 295 : Read attribute NULLABLE_INT64S notValue OK\n"); - err = TestReadAttributeNullableInt64sNotValueOk_295(); - break; - case 296: - ChipLogProgress(chipTool, " ***** Test Step 296 : Write attribute NULLABLE_SINGLE medium Value\n"); - err = TestWriteAttributeNullableSingleMediumValue_296(); - break; - case 297: - ChipLogProgress(chipTool, " ***** Test Step 297 : Read attribute NULLABLE_SINGLE medium Value\n"); - err = TestReadAttributeNullableSingleMediumValue_297(); - break; - case 298: - ChipLogProgress(chipTool, " ***** Test Step 298 : Write attribute NULLABLE_SINGLE largest Value\n"); - err = TestWriteAttributeNullableSingleLargestValue_298(); - break; - case 299: - ChipLogProgress(chipTool, " ***** Test Step 299 : Read attribute NULLABLE_SINGLE largest Value\n"); - err = TestReadAttributeNullableSingleLargestValue_299(); - break; - case 300: - ChipLogProgress(chipTool, " ***** Test Step 300 : Write attribute NULLABLE_SINGLE smallest Value\n"); - err = TestWriteAttributeNullableSingleSmallestValue_300(); - break; - case 301: - ChipLogProgress(chipTool, " ***** Test Step 301 : Read attribute NULLABLE_SINGLE smallest Value\n"); - err = TestReadAttributeNullableSingleSmallestValue_301(); - break; - case 302: - ChipLogProgress(chipTool, " ***** Test Step 302 : Write attribute NULLABLE_SINGLE null Value\n"); - err = TestWriteAttributeNullableSingleNullValue_302(); - break; - case 303: - ChipLogProgress(chipTool, " ***** Test Step 303 : Read attribute NULLABLE_SINGLE null Value\n"); - err = TestReadAttributeNullableSingleNullValue_303(); - break; - case 304: - ChipLogProgress(chipTool, " ***** Test Step 304 : Write attribute NULLABLE_SINGLE 0 Value\n"); - err = TestWriteAttributeNullableSingle0Value_304(); - break; - case 305: - ChipLogProgress(chipTool, " ***** Test Step 305 : Read attribute NULLABLE_SINGLE 0 Value\n"); - err = TestReadAttributeNullableSingle0Value_305(); - break; - case 306: - ChipLogProgress(chipTool, " ***** Test Step 306 : Write attribute NULLABLE_DOUBLE medium Value\n"); - err = TestWriteAttributeNullableDoubleMediumValue_306(); - break; - case 307: - ChipLogProgress(chipTool, " ***** Test Step 307 : Read attribute NULLABLE_DOUBLE medium Value\n"); - err = TestReadAttributeNullableDoubleMediumValue_307(); - break; - case 308: - ChipLogProgress(chipTool, " ***** Test Step 308 : Write attribute NULLABLE_DOUBLE largest Value\n"); - err = TestWriteAttributeNullableDoubleLargestValue_308(); - break; - case 309: - ChipLogProgress(chipTool, " ***** Test Step 309 : Read attribute NULLABLE_DOUBLE largest Value\n"); - err = TestReadAttributeNullableDoubleLargestValue_309(); - break; - case 310: - ChipLogProgress(chipTool, " ***** Test Step 310 : Write attribute NULLABLE_DOUBLE smallest Value\n"); - err = TestWriteAttributeNullableDoubleSmallestValue_310(); - break; - case 311: - ChipLogProgress(chipTool, " ***** Test Step 311 : Read attribute NULLABLE_DOUBLE smallest Value\n"); - err = TestReadAttributeNullableDoubleSmallestValue_311(); - break; - case 312: - ChipLogProgress(chipTool, " ***** Test Step 312 : Write attribute NULLABLE_DOUBLE null Value\n"); - err = TestWriteAttributeNullableDoubleNullValue_312(); - break; - case 313: - ChipLogProgress(chipTool, " ***** Test Step 313 : Read attribute NULLABLE_DOUBLE null Value\n"); - err = TestReadAttributeNullableDoubleNullValue_313(); - break; - case 314: - ChipLogProgress(chipTool, " ***** Test Step 314 : Write attribute NULLABLE_DOUBLE 0 Value\n"); - err = TestWriteAttributeNullableDouble0Value_314(); - break; - case 315: - ChipLogProgress(chipTool, " ***** Test Step 315 : Read attribute NULLABLE_DOUBLE 0 Value\n"); - err = TestReadAttributeNullableDouble0Value_315(); - break; - case 316: - ChipLogProgress(chipTool, " ***** Test Step 316 : Write attribute NULLABLE_ENUM8 Min Value\n"); - err = TestWriteAttributeNullableEnum8MinValue_316(); - break; - case 317: - ChipLogProgress(chipTool, " ***** Test Step 317 : Read attribute NULLABLE_ENUM8 Min Value\n"); - err = TestReadAttributeNullableEnum8MinValue_317(); - break; - case 318: - ChipLogProgress(chipTool, " ***** Test Step 318 : Write attribute NULLABLE_ENUM8 Max Value\n"); - err = TestWriteAttributeNullableEnum8MaxValue_318(); - break; - case 319: - ChipLogProgress(chipTool, " ***** Test Step 319 : Read attribute NULLABLE_ENUM8 Max Value\n"); - err = TestReadAttributeNullableEnum8MaxValue_319(); - break; - case 320: - ChipLogProgress(chipTool, " ***** Test Step 320 : Write attribute NULLABLE_ENUM8 Invalid Value\n"); - err = TestWriteAttributeNullableEnum8InvalidValue_320(); - break; - case 321: - ChipLogProgress(chipTool, " ***** Test Step 321 : Read attribute NULLABLE_ENUM8 unchanged Value\n"); - err = TestReadAttributeNullableEnum8UnchangedValue_321(); - break; - case 322: - ChipLogProgress(chipTool, " ***** Test Step 322 : Write attribute NULLABLE_ENUM8 null Value\n"); - err = TestWriteAttributeNullableEnum8NullValue_322(); - break; - case 323: - ChipLogProgress(chipTool, " ***** Test Step 323 : Read attribute NULLABLE_ENUM8 null Value\n"); - err = TestReadAttributeNullableEnum8NullValue_323(); - break; - case 324: - ChipLogProgress(chipTool, " ***** Test Step 324 : Write attribute NULLABLE_ENUM16 Min Value\n"); - err = TestWriteAttributeNullableEnum16MinValue_324(); - break; - case 325: - ChipLogProgress(chipTool, " ***** Test Step 325 : Read attribute NULLABLE_ENUM16 Min Value\n"); - err = TestReadAttributeNullableEnum16MinValue_325(); - break; - case 326: - ChipLogProgress(chipTool, " ***** Test Step 326 : Write attribute NULLABLE_ENUM16 Max Value\n"); - err = TestWriteAttributeNullableEnum16MaxValue_326(); - break; - case 327: - ChipLogProgress(chipTool, " ***** Test Step 327 : Read attribute NULLABLE_ENUM16 Max Value\n"); - err = TestReadAttributeNullableEnum16MaxValue_327(); - break; - case 328: - ChipLogProgress(chipTool, " ***** Test Step 328 : Write attribute NULLABLE_ENUM16 Invalid Value\n"); - err = TestWriteAttributeNullableEnum16InvalidValue_328(); - break; - case 329: - ChipLogProgress(chipTool, " ***** Test Step 329 : Read attribute NULLABLE_ENUM16 unchanged Value\n"); - err = TestReadAttributeNullableEnum16UnchangedValue_329(); - break; - case 330: - ChipLogProgress(chipTool, " ***** Test Step 330 : Write attribute NULLABLE_ENUM16 null Value\n"); - err = TestWriteAttributeNullableEnum16NullValue_330(); - break; - case 331: - ChipLogProgress(chipTool, " ***** Test Step 331 : Read attribute NULLABLE_ENUM16 null Value\n"); - err = TestReadAttributeNullableEnum16NullValue_331(); - break; - case 332: - ChipLogProgress(chipTool, " ***** Test Step 332 : Write attribute NULLABLE_SIMPLE_ENUM Min Value\n"); - err = TestWriteAttributeNullableSimpleEnumMinValue_332(); - break; - case 333: - ChipLogProgress(chipTool, " ***** Test Step 333 : Read attribute NULLABLE_SIMPLE_ENUM Min Value\n"); - err = TestReadAttributeNullableSimpleEnumMinValue_333(); - break; - case 334: - ChipLogProgress(chipTool, " ***** Test Step 334 : Write attribute NULLABLE_SIMPLE_ENUM Max Value\n"); - err = TestWriteAttributeNullableSimpleEnumMaxValue_334(); - break; - case 335: - ChipLogProgress(chipTool, " ***** Test Step 335 : Read attribute NULLABLE_SIMPLE_ENUM Max Value\n"); - err = TestReadAttributeNullableSimpleEnumMaxValue_335(); - break; - case 336: - ChipLogProgress(chipTool, " ***** Test Step 336 : Write attribute NULLABLE_SIMPLE_ENUM Invalid Value\n"); - err = TestWriteAttributeNullableSimpleEnumInvalidValue_336(); - break; - case 337: - ChipLogProgress(chipTool, " ***** Test Step 337 : Read attribute NULLABLE_SIMPLE_ENUM unchanged Value\n"); - err = TestReadAttributeNullableSimpleEnumUnchangedValue_337(); - break; - case 338: - ChipLogProgress(chipTool, " ***** Test Step 338 : Write attribute NULLABLE_SIMPLE_ENUM null Value\n"); - err = TestWriteAttributeNullableSimpleEnumNullValue_338(); - break; - case 339: - ChipLogProgress(chipTool, " ***** Test Step 339 : Read attribute NULLABLE_SIMPLE_ENUM null Value\n"); - err = TestReadAttributeNullableSimpleEnumNullValue_339(); - break; - case 340: - ChipLogProgress(chipTool, " ***** Test Step 340 : Read attribute NULLABLE_OCTET_STRING Default Value\n"); - err = TestReadAttributeNullableOctetStringDefaultValue_340(); - break; - case 341: - ChipLogProgress(chipTool, " ***** Test Step 341 : Write attribute NULLABLE_OCTET_STRING\n"); - err = TestWriteAttributeNullableOctetString_341(); - break; - case 342: - ChipLogProgress(chipTool, " ***** Test Step 342 : Read attribute NULLABLE_OCTET_STRING\n"); - err = TestReadAttributeNullableOctetString_342(); - break; - case 343: - ChipLogProgress(chipTool, " ***** Test Step 343 : Write attribute NULLABLE_OCTET_STRING\n"); - err = TestWriteAttributeNullableOctetString_343(); - break; - case 344: - ChipLogProgress(chipTool, " ***** Test Step 344 : Read attribute NULLABLE_OCTET_STRING\n"); - err = TestReadAttributeNullableOctetString_344(); - break; - case 345: - ChipLogProgress(chipTool, " ***** Test Step 345 : Write attribute NULLABLE_OCTET_STRING\n"); - err = TestWriteAttributeNullableOctetString_345(); - break; - case 346: - ChipLogProgress(chipTool, " ***** Test Step 346 : Read attribute NULLABLE_OCTET_STRING\n"); - err = TestReadAttributeNullableOctetString_346(); - break; - case 347: - ChipLogProgress(chipTool, " ***** Test Step 347 : Read attribute NULLABLE_CHAR_STRING Default Value\n"); - err = TestReadAttributeNullableCharStringDefaultValue_347(); - break; - case 348: - ChipLogProgress(chipTool, " ***** Test Step 348 : Write attribute NULLABLE_CHAR_STRING\n"); - err = TestWriteAttributeNullableCharString_348(); - break; - case 349: - ChipLogProgress(chipTool, " ***** Test Step 349 : Read attribute NULLABLE_CHAR_STRING\n"); - err = TestReadAttributeNullableCharString_349(); - break; - case 350: - ChipLogProgress(chipTool, " ***** Test Step 350 : Write attribute NULLABLE_CHAR_STRING - Value too long\n"); - err = TestWriteAttributeNullableCharStringValueTooLong_350(); - break; - case 351: - ChipLogProgress(chipTool, " ***** Test Step 351 : Read attribute NULLABLE_CHAR_STRING\n"); - err = TestReadAttributeNullableCharString_351(); - break; - case 352: - ChipLogProgress(chipTool, " ***** Test Step 352 : Write attribute NULLABLE_CHAR_STRING - Empty\n"); - err = TestWriteAttributeNullableCharStringEmpty_352(); - break; - case 353: - ChipLogProgress(chipTool, " ***** Test Step 353 : Read attribute NULLABLE_CHAR_STRING\n"); - err = TestReadAttributeNullableCharString_353(); - break; - case 354: - ChipLogProgress(chipTool, " ***** Test Step 354 : Read attribute from nonexistent endpoint.\n"); - err = TestReadAttributeFromNonexistentEndpoint_354(); - break; - case 355: - ChipLogProgress(chipTool, " ***** Test Step 355 : Read attribute from nonexistent cluster.\n"); - err = TestReadAttributeFromNonexistentCluster_355(); - break; - case 356: - ChipLogProgress(chipTool, - " ***** Test Step 356 : Send a command that takes an optional parameter but do not set it.\n"); - err = TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_356(); - break; - case 357: - ChipLogProgress(chipTool, - " ***** Test Step 357 : Send a command that takes an optional parameter but do not set it.\n"); - err = TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_357(); - break; - case 358: - ChipLogProgress(chipTool, " ***** Test Step 358 : Report: Subscribe to list attribute\n"); - err = TestReportSubscribeToListAttribute_358(); - break; - case 359: - ChipLogProgress(chipTool, " ***** Test Step 359 : Subscribe to list attribute\n"); - err = TestSubscribeToListAttribute_359(); - break; - case 360: - ChipLogProgress(chipTool, " ***** Test Step 360 : Write subscribed-to list attribute\n"); - err = TestWriteSubscribedToListAttribute_360(); - break; - case 361: - ChipLogProgress(chipTool, " ***** Test Step 361 : Check for list attribute report\n"); - err = TestCheckForListAttributeReport_361(); - break; - case 362: - ChipLogProgress(chipTool, " ***** Test Step 362 : Read range-restricted unsigned 8-bit integer\n"); - err = TestReadRangeRestrictedUnsigned8BitInteger_362(); - break; - case 363: - ChipLogProgress(chipTool, " ***** Test Step 363 : Write min value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteMinValueToARangeRestrictedUnsigned8BitInteger_363(); - break; - case 364: - ChipLogProgress(chipTool, - " ***** Test Step 364 : Write just-below-range value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteJustBelowRangeValueToARangeRestrictedUnsigned8BitInteger_364(); - break; - case 365: - ChipLogProgress(chipTool, - " ***** Test Step 365 : Write just-above-range value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteJustAboveRangeValueToARangeRestrictedUnsigned8BitInteger_365(); - break; - case 366: - ChipLogProgress(chipTool, " ***** Test Step 366 : Write max value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteMaxValueToARangeRestrictedUnsigned8BitInteger_366(); - break; - case 367: - ChipLogProgress(chipTool, - " ***** Test Step 367 : Verify range-restricted unsigned 8-bit integer value has not changed\n"); - err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_367(); - break; - case 368: - ChipLogProgress(chipTool, - " ***** Test Step 368 : Write min valid value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteMinValidValueToARangeRestrictedUnsigned8BitInteger_368(); - break; - case 369: - ChipLogProgress(chipTool, - " ***** Test Step 369 : Verify range-restricted unsigned 8-bit integer value is at min valid\n"); - err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_369(); - break; - case 370: - ChipLogProgress(chipTool, - " ***** Test Step 370 : Write max valid value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteMaxValidValueToARangeRestrictedUnsigned8BitInteger_370(); - break; - case 371: - ChipLogProgress(chipTool, - " ***** Test Step 371 : Verify range-restricted unsigned 8-bit integer value is at max valid\n"); - err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_371(); - break; - case 372: - ChipLogProgress(chipTool, - " ***** Test Step 372 : Write middle valid value to a range-restricted unsigned 8-bit integer\n"); - err = TestWriteMiddleValidValueToARangeRestrictedUnsigned8BitInteger_372(); - break; - case 373: - ChipLogProgress(chipTool, - " ***** Test Step 373 : Verify range-restricted unsigned 8-bit integer value is at mid valid\n"); - err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_373(); - break; - case 374: - ChipLogProgress(chipTool, " ***** Test Step 374 : Read range-restricted unsigned 16-bit integer\n"); - err = TestReadRangeRestrictedUnsigned16BitInteger_374(); - break; - case 375: - ChipLogProgress(chipTool, " ***** Test Step 375 : Write min value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteMinValueToARangeRestrictedUnsigned16BitInteger_375(); - break; - case 376: - ChipLogProgress(chipTool, - " ***** Test Step 376 : Write just-below-range value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteJustBelowRangeValueToARangeRestrictedUnsigned16BitInteger_376(); - break; - case 377: - ChipLogProgress(chipTool, - " ***** Test Step 377 : Write just-above-range value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteJustAboveRangeValueToARangeRestrictedUnsigned16BitInteger_377(); - break; - case 378: - ChipLogProgress(chipTool, " ***** Test Step 378 : Write max value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteMaxValueToARangeRestrictedUnsigned16BitInteger_378(); - break; - case 379: - ChipLogProgress(chipTool, - " ***** Test Step 379 : Verify range-restricted unsigned 16-bit integer value has not changed\n"); - err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_379(); - break; - case 380: - ChipLogProgress(chipTool, - " ***** Test Step 380 : Write min valid value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteMinValidValueToARangeRestrictedUnsigned16BitInteger_380(); - break; - case 381: - ChipLogProgress(chipTool, - " ***** Test Step 381 : Verify range-restricted unsigned 16-bit integer value is at min valid\n"); - err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_381(); - break; - case 382: - ChipLogProgress(chipTool, - " ***** Test Step 382 : Write max valid value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteMaxValidValueToARangeRestrictedUnsigned16BitInteger_382(); - break; - case 383: - ChipLogProgress(chipTool, - " ***** Test Step 383 : Verify range-restricted unsigned 16-bit integer value is at max valid\n"); - err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_383(); - break; - case 384: - ChipLogProgress(chipTool, - " ***** Test Step 384 : Write middle valid value to a range-restricted unsigned 16-bit integer\n"); - err = TestWriteMiddleValidValueToARangeRestrictedUnsigned16BitInteger_384(); - break; - case 385: - ChipLogProgress(chipTool, - " ***** Test Step 385 : Verify range-restricted unsigned 16-bit integer value is at mid valid\n"); - err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_385(); - break; - case 386: - ChipLogProgress(chipTool, " ***** Test Step 386 : Read range-restricted signed 8-bit integer\n"); - err = TestReadRangeRestrictedSigned8BitInteger_386(); - break; - case 387: - ChipLogProgress(chipTool, " ***** Test Step 387 : Write min value to a range-restricted signed 8-bit integer\n"); - err = TestWriteMinValueToARangeRestrictedSigned8BitInteger_387(); - break; - case 388: - ChipLogProgress(chipTool, - " ***** Test Step 388 : Write just-below-range value to a range-restricted signed 8-bit integer\n"); - err = TestWriteJustBelowRangeValueToARangeRestrictedSigned8BitInteger_388(); - break; - case 389: - ChipLogProgress(chipTool, - " ***** Test Step 389 : Write just-above-range value to a range-restricted signed 8-bit integer\n"); - err = TestWriteJustAboveRangeValueToARangeRestrictedSigned8BitInteger_389(); - break; - case 390: - ChipLogProgress(chipTool, " ***** Test Step 390 : Write max value to a range-restricted signed 8-bit integer\n"); - err = TestWriteMaxValueToARangeRestrictedSigned8BitInteger_390(); - break; - case 391: - ChipLogProgress(chipTool, - " ***** Test Step 391 : Verify range-restricted signed 8-bit integer value has not changed\n"); - err = TestVerifyRangeRestrictedSigned8BitIntegerValueHasNotChanged_391(); - break; - case 392: - ChipLogProgress(chipTool, " ***** Test Step 392 : Write min valid value to a range-restricted signed 8-bit integer\n"); - err = TestWriteMinValidValueToARangeRestrictedSigned8BitInteger_392(); - break; - case 393: - ChipLogProgress(chipTool, - " ***** Test Step 393 : Verify range-restricted signed 8-bit integer value is at min valid\n"); - err = TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMinValid_393(); - break; - case 394: - ChipLogProgress(chipTool, " ***** Test Step 394 : Write max valid value to a range-restricted signed 8-bit integer\n"); - err = TestWriteMaxValidValueToARangeRestrictedSigned8BitInteger_394(); - break; - case 395: - ChipLogProgress(chipTool, - " ***** Test Step 395 : Verify range-restricted signed 8-bit integer value is at max valid\n"); - err = TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_395(); - break; - case 396: - ChipLogProgress(chipTool, - " ***** Test Step 396 : Write middle valid value to a range-restricted signed 8-bit integer\n"); - err = TestWriteMiddleValidValueToARangeRestrictedSigned8BitInteger_396(); - break; - case 397: - ChipLogProgress(chipTool, - " ***** Test Step 397 : Verify range-restricted signed 8-bit integer value is at mid valid\n"); - err = TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMidValid_397(); - break; - case 398: - ChipLogProgress(chipTool, " ***** Test Step 398 : Read range-restricted signed 16-bit integer\n"); - err = TestReadRangeRestrictedSigned16BitInteger_398(); - break; - case 399: - ChipLogProgress(chipTool, " ***** Test Step 399 : Write min value to a range-restricted signed 16-bit integer\n"); - err = TestWriteMinValueToARangeRestrictedSigned16BitInteger_399(); - break; - case 400: - ChipLogProgress(chipTool, - " ***** Test Step 400 : Write just-below-range value to a range-restricted signed 16-bit integer\n"); - err = TestWriteJustBelowRangeValueToARangeRestrictedSigned16BitInteger_400(); - break; - case 401: - ChipLogProgress(chipTool, - " ***** Test Step 401 : Write just-above-range value to a range-restricted signed 16-bit integer\n"); - err = TestWriteJustAboveRangeValueToARangeRestrictedSigned16BitInteger_401(); - break; - case 402: - ChipLogProgress(chipTool, " ***** Test Step 402 : Write max value to a range-restricted signed 16-bit integer\n"); - err = TestWriteMaxValueToARangeRestrictedSigned16BitInteger_402(); - break; - case 403: - ChipLogProgress(chipTool, - " ***** Test Step 403 : Verify range-restricted signed 16-bit integer value has not changed\n"); - err = TestVerifyRangeRestrictedSigned16BitIntegerValueHasNotChanged_403(); - break; - case 404: - ChipLogProgress(chipTool, " ***** Test Step 404 : Write min valid value to a range-restricted signed 16-bit integer\n"); - err = TestWriteMinValidValueToARangeRestrictedSigned16BitInteger_404(); - break; - case 405: - ChipLogProgress(chipTool, - " ***** Test Step 405 : Verify range-restricted signed 16-bit integer value is at min valid\n"); - err = TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMinValid_405(); - break; - case 406: - ChipLogProgress(chipTool, " ***** Test Step 406 : Write max valid value to a range-restricted signed 16-bit integer\n"); - err = TestWriteMaxValidValueToARangeRestrictedSigned16BitInteger_406(); - break; - case 407: - ChipLogProgress(chipTool, - " ***** Test Step 407 : Verify range-restricted signed 16-bit integer value is at max valid\n"); - err = TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_407(); - break; - case 408: - ChipLogProgress(chipTool, - " ***** Test Step 408 : Write middle valid value to a range-restricted signed 16-bit integer\n"); - err = TestWriteMiddleValidValueToARangeRestrictedSigned16BitInteger_408(); - break; - case 409: - ChipLogProgress(chipTool, - " ***** Test Step 409 : Verify range-restricted signed 16-bit integer value is at mid valid\n"); - err = TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMidValid_409(); - break; - case 410: - ChipLogProgress(chipTool, " ***** Test Step 410 : Read nullable range-restricted unsigned 8-bit integer\n"); - err = TestReadNullableRangeRestrictedUnsigned8BitInteger_410(); - break; - case 411: - ChipLogProgress(chipTool, - " ***** Test Step 411 : Write min value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteMinValueToANullableRangeRestrictedUnsigned8BitInteger_411(); - break; - case 412: - ChipLogProgress( - chipTool, - " ***** Test Step 412 : Write just-below-range value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned8BitInteger_412(); - break; - case 413: - ChipLogProgress( - chipTool, - " ***** Test Step 413 : Write just-above-range value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned8BitInteger_413(); - break; - case 414: - ChipLogProgress(chipTool, - " ***** Test Step 414 : Write max value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteMaxValueToANullableRangeRestrictedUnsigned8BitInteger_414(); - break; - case 415: - ChipLogProgress( - chipTool, " ***** Test Step 415 : Verify nullable range-restricted unsigned 8-bit integer value has not changed\n"); - err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_415(); - break; - case 416: - ChipLogProgress(chipTool, - " ***** Test Step 416 : Write min valid value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteMinValidValueToANullableRangeRestrictedUnsigned8BitInteger_416(); - break; - case 417: - ChipLogProgress( - chipTool, " ***** Test Step 417 : Verify nullable range-restricted unsigned 8-bit integer value is at min valid\n"); - err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_417(); - break; - case 418: - ChipLogProgress(chipTool, - " ***** Test Step 418 : Write max valid value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteMaxValidValueToANullableRangeRestrictedUnsigned8BitInteger_418(); - break; - case 419: - ChipLogProgress( - chipTool, " ***** Test Step 419 : Verify nullable range-restricted unsigned 8-bit integer value is at max valid\n"); - err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_419(); - break; - case 420: - ChipLogProgress( - chipTool, - " ***** Test Step 420 : Write middle valid value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned8BitInteger_420(); - break; - case 421: - ChipLogProgress( - chipTool, " ***** Test Step 421 : Verify nullable range-restricted unsigned 8-bit integer value is at mid valid\n"); - err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_421(); - break; - case 422: - ChipLogProgress(chipTool, - " ***** Test Step 422 : Write null value to a nullable range-restricted unsigned 8-bit integer\n"); - err = TestWriteNullValueToANullableRangeRestrictedUnsigned8BitInteger_422(); - break; - case 423: - ChipLogProgress(chipTool, - " ***** Test Step 423 : Verify nullable range-restricted unsigned 8-bit integer value is null\n"); - err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsNull_423(); - break; - case 424: - ChipLogProgress(chipTool, " ***** Test Step 424 : Read nullable range-restricted unsigned 16-bit integer\n"); - err = TestReadNullableRangeRestrictedUnsigned16BitInteger_424(); - break; - case 425: - ChipLogProgress(chipTool, - " ***** Test Step 425 : Write min value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteMinValueToANullableRangeRestrictedUnsigned16BitInteger_425(); - break; - case 426: - ChipLogProgress( - chipTool, - " ***** Test Step 426 : Write just-below-range value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned16BitInteger_426(); - break; - case 427: - ChipLogProgress( - chipTool, - " ***** Test Step 427 : Write just-above-range value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned16BitInteger_427(); - break; - case 428: - ChipLogProgress(chipTool, - " ***** Test Step 428 : Write max value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteMaxValueToANullableRangeRestrictedUnsigned16BitInteger_428(); - break; - case 429: - ChipLogProgress( - chipTool, - " ***** Test Step 429 : Verify nullable range-restricted unsigned 16-bit integer value has not changed\n"); - err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_429(); - break; - case 430: - ChipLogProgress( - chipTool, " ***** Test Step 430 : Write min valid value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteMinValidValueToANullableRangeRestrictedUnsigned16BitInteger_430(); - break; - case 431: - ChipLogProgress( - chipTool, - " ***** Test Step 431 : Verify nullable range-restricted unsigned 16-bit integer value is at min valid\n"); - err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_431(); - break; - case 432: - ChipLogProgress( - chipTool, " ***** Test Step 432 : Write max valid value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteMaxValidValueToANullableRangeRestrictedUnsigned16BitInteger_432(); - break; - case 433: - ChipLogProgress( - chipTool, - " ***** Test Step 433 : Verify nullable range-restricted unsigned 16-bit integer value is at max valid\n"); - err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_433(); - break; - case 434: - ChipLogProgress( - chipTool, - " ***** Test Step 434 : Write middle valid value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned16BitInteger_434(); - break; - case 435: - ChipLogProgress( - chipTool, - " ***** Test Step 435 : Verify nullable range-restricted unsigned 16-bit integer value is at mid valid\n"); - err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_435(); - break; - case 436: - ChipLogProgress(chipTool, - " ***** Test Step 436 : Write null value to a nullable range-restricted unsigned 16-bit integer\n"); - err = TestWriteNullValueToANullableRangeRestrictedUnsigned16BitInteger_436(); - break; - case 437: - ChipLogProgress(chipTool, - " ***** Test Step 437 : Verify nullable range-restricted unsigned 16-bit integer value is null\n"); - err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsNull_437(); - break; - case 438: - ChipLogProgress(chipTool, " ***** Test Step 438 : Read nullable range-restricted signed 8-bit integer\n"); - err = TestReadNullableRangeRestrictedSigned8BitInteger_438(); - break; - case 439: - ChipLogProgress(chipTool, - " ***** Test Step 439 : Write min value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteMinValueToANullableRangeRestrictedSigned8BitInteger_439(); - break; - case 440: - ChipLogProgress( - chipTool, - " ***** Test Step 440 : Write just-below-range value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned8BitInteger_440(); - break; - case 441: - ChipLogProgress( - chipTool, - " ***** Test Step 441 : Write just-above-range value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned8BitInteger_441(); - break; - case 442: - ChipLogProgress(chipTool, - " ***** Test Step 442 : Write max value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteMaxValueToANullableRangeRestrictedSigned8BitInteger_442(); - break; - case 443: - ChipLogProgress(chipTool, - " ***** Test Step 443 : Verify nullable range-restricted signed 8-bit integer value has not changed\n"); - err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueHasNotChanged_443(); - break; - case 444: - ChipLogProgress(chipTool, - " ***** Test Step 444 : Write min valid value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteMinValidValueToANullableRangeRestrictedSigned8BitInteger_444(); - break; - case 445: - ChipLogProgress(chipTool, - " ***** Test Step 445 : Verify nullable range-restricted signed 8-bit integer value is at min valid\n"); - err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMinValid_445(); - break; - case 446: - ChipLogProgress(chipTool, - " ***** Test Step 446 : Write max valid value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteMaxValidValueToANullableRangeRestrictedSigned8BitInteger_446(); - break; - case 447: - ChipLogProgress(chipTool, - " ***** Test Step 447 : Verify nullable range-restricted signed 8-bit integer value is at max valid\n"); - err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_447(); - break; - case 448: - ChipLogProgress( - chipTool, " ***** Test Step 448 : Write middle valid value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteMiddleValidValueToANullableRangeRestrictedSigned8BitInteger_448(); - break; - case 449: - ChipLogProgress(chipTool, - " ***** Test Step 449 : Verify nullable range-restricted signed 8-bit integer value is at mid valid\n"); - err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMidValid_449(); - break; - case 450: - ChipLogProgress(chipTool, - " ***** Test Step 450 : Write null value to a nullable range-restricted signed 8-bit integer\n"); - err = TestWriteNullValueToANullableRangeRestrictedSigned8BitInteger_450(); - break; - case 451: - ChipLogProgress(chipTool, - " ***** Test Step 451 : Verify nullable range-restricted signed 8-bit integer value is at null\n"); - err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtNull_451(); - break; - case 452: - ChipLogProgress(chipTool, " ***** Test Step 452 : Read nullable range-restricted signed 16-bit integer\n"); - err = TestReadNullableRangeRestrictedSigned16BitInteger_452(); - break; - case 453: - ChipLogProgress(chipTool, - " ***** Test Step 453 : Write min value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteMinValueToANullableRangeRestrictedSigned16BitInteger_453(); - break; - case 454: - ChipLogProgress( - chipTool, - " ***** Test Step 454 : Write just-below-range value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned16BitInteger_454(); - break; - case 455: - ChipLogProgress( - chipTool, - " ***** Test Step 455 : Write just-above-range value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned16BitInteger_455(); - break; - case 456: - ChipLogProgress(chipTool, - " ***** Test Step 456 : Write max value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteMaxValueToANullableRangeRestrictedSigned16BitInteger_456(); - break; - case 457: - ChipLogProgress( - chipTool, " ***** Test Step 457 : Verify nullable range-restricted signed 16-bit integer value has not changed\n"); - err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueHasNotChanged_457(); - break; - case 458: - ChipLogProgress(chipTool, - " ***** Test Step 458 : Write min valid value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteMinValidValueToANullableRangeRestrictedSigned16BitInteger_458(); - break; - case 459: - ChipLogProgress( - chipTool, " ***** Test Step 459 : Verify nullable range-restricted signed 16-bit integer value is at min valid\n"); - err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMinValid_459(); - break; - case 460: - ChipLogProgress(chipTool, - " ***** Test Step 460 : Write max valid value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteMaxValidValueToANullableRangeRestrictedSigned16BitInteger_460(); - break; - case 461: - ChipLogProgress( - chipTool, " ***** Test Step 461 : Verify nullable range-restricted signed 16-bit integer value is at max valid\n"); - err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_461(); - break; - case 462: - ChipLogProgress( - chipTool, " ***** Test Step 462 : Write middle valid value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteMiddleValidValueToANullableRangeRestrictedSigned16BitInteger_462(); - break; - case 463: - ChipLogProgress( - chipTool, " ***** Test Step 463 : Verify nullable range-restricted signed 16-bit integer value is at mid valid\n"); - err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMidValid_463(); - break; - case 464: - ChipLogProgress(chipTool, - " ***** Test Step 464 : Write null value to a nullable range-restricted signed 16-bit integer\n"); - err = TestWriteNullValueToANullableRangeRestrictedSigned16BitInteger_464(); - break; - case 465: - ChipLogProgress(chipTool, - " ***** Test Step 465 : Verify nullable range-restricted signed 16-bit integer value is null\n"); - err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsNull_465(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 466; - - typedef void (*Test_TestCluster_list_int8u_ReportCallback)(void * context, - const chip::app::DataModel::DecodableList & value); - Test_TestCluster_list_int8u_ReportCallback mTest_TestCluster_list_int8u_Reported = nullptr; - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, bool boolean) - { - (static_cast(context))->OnSuccessResponse_6(boolean); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context, bool boolean) - { - (static_cast(context))->OnSuccessResponse_8(boolean); - } - - static void OnFailureCallback_9(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context) { (static_cast(context))->OnSuccessResponse_9(); } - - static void OnFailureCallback_10(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_10(status); - } - - static void OnSuccessCallback_10(void * context, bool boolean) - { - (static_cast(context))->OnSuccessResponse_10(boolean); - } - - static void OnFailureCallback_11(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_11(status); - } - - static void OnSuccessCallback_11(void * context, uint8_t bitmap8) - { - (static_cast(context))->OnSuccessResponse_11(bitmap8); - } - - static void OnFailureCallback_12(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_12(status); - } - - static void OnSuccessCallback_12(void * context) { (static_cast(context))->OnSuccessResponse_12(); } - - static void OnFailureCallback_13(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_13(status); - } - - static void OnSuccessCallback_13(void * context, uint8_t bitmap8) - { - (static_cast(context))->OnSuccessResponse_13(bitmap8); - } - - static void OnFailureCallback_14(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_14(status); - } - - static void OnSuccessCallback_14(void * context) { (static_cast(context))->OnSuccessResponse_14(); } - - static void OnFailureCallback_15(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_15(status); - } - - static void OnSuccessCallback_15(void * context, uint8_t bitmap8) - { - (static_cast(context))->OnSuccessResponse_15(bitmap8); - } - - static void OnFailureCallback_16(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_16(status); - } - - static void OnSuccessCallback_16(void * context, uint16_t bitmap16) - { - (static_cast(context))->OnSuccessResponse_16(bitmap16); - } - - static void OnFailureCallback_17(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_17(status); - } - - static void OnSuccessCallback_17(void * context) { (static_cast(context))->OnSuccessResponse_17(); } - - static void OnFailureCallback_18(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_18(status); - } - - static void OnSuccessCallback_18(void * context, uint16_t bitmap16) - { - (static_cast(context))->OnSuccessResponse_18(bitmap16); - } - - static void OnFailureCallback_19(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_19(status); - } - - static void OnSuccessCallback_19(void * context) { (static_cast(context))->OnSuccessResponse_19(); } - - static void OnFailureCallback_20(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_20(status); - } - - static void OnSuccessCallback_20(void * context, uint16_t bitmap16) - { - (static_cast(context))->OnSuccessResponse_20(bitmap16); - } - - static void OnFailureCallback_21(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_21(status); - } - - static void OnSuccessCallback_21(void * context, uint32_t bitmap32) - { - (static_cast(context))->OnSuccessResponse_21(bitmap32); - } - - static void OnFailureCallback_22(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_22(status); - } - - static void OnSuccessCallback_22(void * context) { (static_cast(context))->OnSuccessResponse_22(); } - - static void OnFailureCallback_23(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_23(status); - } - - static void OnSuccessCallback_23(void * context, uint32_t bitmap32) - { - (static_cast(context))->OnSuccessResponse_23(bitmap32); - } - - static void OnFailureCallback_24(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_24(status); - } - - static void OnSuccessCallback_24(void * context) { (static_cast(context))->OnSuccessResponse_24(); } - - static void OnFailureCallback_25(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_25(status); - } - - static void OnSuccessCallback_25(void * context, uint32_t bitmap32) - { - (static_cast(context))->OnSuccessResponse_25(bitmap32); - } - - static void OnFailureCallback_26(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_26(status); - } - - static void OnSuccessCallback_26(void * context, uint64_t bitmap64) - { - (static_cast(context))->OnSuccessResponse_26(bitmap64); - } - - static void OnFailureCallback_27(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_27(status); - } - - static void OnSuccessCallback_27(void * context) { (static_cast(context))->OnSuccessResponse_27(); } - - static void OnFailureCallback_28(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_28(status); - } - - static void OnSuccessCallback_28(void * context, uint64_t bitmap64) - { - (static_cast(context))->OnSuccessResponse_28(bitmap64); - } - - static void OnFailureCallback_29(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_29(status); - } - - static void OnSuccessCallback_29(void * context) { (static_cast(context))->OnSuccessResponse_29(); } - - static void OnFailureCallback_30(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_30(status); - } - - static void OnSuccessCallback_30(void * context, uint64_t bitmap64) - { - (static_cast(context))->OnSuccessResponse_30(bitmap64); - } - - static void OnFailureCallback_31(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_31(status); - } - - static void OnSuccessCallback_31(void * context, uint8_t int8u) - { - (static_cast(context))->OnSuccessResponse_31(int8u); - } - - static void OnFailureCallback_32(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_32(status); - } - - static void OnSuccessCallback_32(void * context) { (static_cast(context))->OnSuccessResponse_32(); } - - static void OnFailureCallback_33(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_33(status); - } - - static void OnSuccessCallback_33(void * context, uint8_t int8u) - { - (static_cast(context))->OnSuccessResponse_33(int8u); - } - - static void OnFailureCallback_34(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_34(status); - } - - static void OnSuccessCallback_34(void * context) { (static_cast(context))->OnSuccessResponse_34(); } - - static void OnFailureCallback_35(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_35(status); - } - - static void OnSuccessCallback_35(void * context, uint8_t int8u) - { - (static_cast(context))->OnSuccessResponse_35(int8u); - } - - static void OnFailureCallback_36(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_36(status); - } - - static void OnSuccessCallback_36(void * context, uint16_t int16u) - { - (static_cast(context))->OnSuccessResponse_36(int16u); - } - - static void OnFailureCallback_37(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_37(status); - } - - static void OnSuccessCallback_37(void * context) { (static_cast(context))->OnSuccessResponse_37(); } - - static void OnFailureCallback_38(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_38(status); - } - - static void OnSuccessCallback_38(void * context, uint16_t int16u) - { - (static_cast(context))->OnSuccessResponse_38(int16u); - } - - static void OnFailureCallback_39(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_39(status); - } - - static void OnSuccessCallback_39(void * context) { (static_cast(context))->OnSuccessResponse_39(); } - - static void OnFailureCallback_40(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_40(status); - } - - static void OnSuccessCallback_40(void * context, uint16_t int16u) - { - (static_cast(context))->OnSuccessResponse_40(int16u); - } - - static void OnFailureCallback_41(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_41(status); - } - - static void OnSuccessCallback_41(void * context, uint32_t int32u) - { - (static_cast(context))->OnSuccessResponse_41(int32u); - } - - static void OnFailureCallback_42(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_42(status); - } - - static void OnSuccessCallback_42(void * context) { (static_cast(context))->OnSuccessResponse_42(); } - - static void OnFailureCallback_43(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_43(status); - } - - static void OnSuccessCallback_43(void * context, uint32_t int32u) - { - (static_cast(context))->OnSuccessResponse_43(int32u); - } - - static void OnFailureCallback_44(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_44(status); - } - - static void OnSuccessCallback_44(void * context) { (static_cast(context))->OnSuccessResponse_44(); } - - static void OnFailureCallback_45(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_45(status); - } - - static void OnSuccessCallback_45(void * context, uint32_t int32u) - { - (static_cast(context))->OnSuccessResponse_45(int32u); - } - - static void OnFailureCallback_46(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_46(status); - } - - static void OnSuccessCallback_46(void * context, uint64_t int64u) - { - (static_cast(context))->OnSuccessResponse_46(int64u); - } - - static void OnFailureCallback_47(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_47(status); - } - - static void OnSuccessCallback_47(void * context) { (static_cast(context))->OnSuccessResponse_47(); } - - static void OnFailureCallback_48(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_48(status); - } - - static void OnSuccessCallback_48(void * context, uint64_t int64u) - { - (static_cast(context))->OnSuccessResponse_48(int64u); - } - - static void OnFailureCallback_49(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_49(status); - } - - static void OnSuccessCallback_49(void * context) { (static_cast(context))->OnSuccessResponse_49(); } - - static void OnFailureCallback_50(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_50(status); - } - - static void OnSuccessCallback_50(void * context, uint64_t int64u) - { - (static_cast(context))->OnSuccessResponse_50(int64u); - } - - static void OnFailureCallback_51(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_51(status); - } - - static void OnSuccessCallback_51(void * context, int8_t int8s) - { - (static_cast(context))->OnSuccessResponse_51(int8s); - } - - static void OnFailureCallback_52(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_52(status); - } - - static void OnSuccessCallback_52(void * context) { (static_cast(context))->OnSuccessResponse_52(); } - - static void OnFailureCallback_53(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_53(status); - } - - static void OnSuccessCallback_53(void * context, int8_t int8s) - { - (static_cast(context))->OnSuccessResponse_53(int8s); - } - - static void OnFailureCallback_54(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_54(status); - } - - static void OnSuccessCallback_54(void * context) { (static_cast(context))->OnSuccessResponse_54(); } - - static void OnFailureCallback_55(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_55(status); - } - - static void OnSuccessCallback_55(void * context, int8_t int8s) - { - (static_cast(context))->OnSuccessResponse_55(int8s); - } - - static void OnFailureCallback_56(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_56(status); - } - - static void OnSuccessCallback_56(void * context) { (static_cast(context))->OnSuccessResponse_56(); } - - static void OnFailureCallback_57(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_57(status); - } - - static void OnSuccessCallback_57(void * context, int8_t int8s) - { - (static_cast(context))->OnSuccessResponse_57(int8s); - } - - static void OnFailureCallback_58(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_58(status); - } - - static void OnSuccessCallback_58(void * context, int16_t int16s) - { - (static_cast(context))->OnSuccessResponse_58(int16s); - } - - static void OnFailureCallback_59(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_59(status); - } - - static void OnSuccessCallback_59(void * context) { (static_cast(context))->OnSuccessResponse_59(); } - - static void OnFailureCallback_60(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_60(status); - } - - static void OnSuccessCallback_60(void * context, int16_t int16s) - { - (static_cast(context))->OnSuccessResponse_60(int16s); - } - - static void OnFailureCallback_61(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_61(status); - } - - static void OnSuccessCallback_61(void * context) { (static_cast(context))->OnSuccessResponse_61(); } - - static void OnFailureCallback_62(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_62(status); - } - - static void OnSuccessCallback_62(void * context, int16_t int16s) - { - (static_cast(context))->OnSuccessResponse_62(int16s); - } - - static void OnFailureCallback_63(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_63(status); - } - - static void OnSuccessCallback_63(void * context) { (static_cast(context))->OnSuccessResponse_63(); } - - static void OnFailureCallback_64(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_64(status); - } - - static void OnSuccessCallback_64(void * context, int16_t int16s) - { - (static_cast(context))->OnSuccessResponse_64(int16s); - } - - static void OnFailureCallback_65(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_65(status); - } - - static void OnSuccessCallback_65(void * context, int32_t int32s) - { - (static_cast(context))->OnSuccessResponse_65(int32s); - } - - static void OnFailureCallback_66(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_66(status); - } - - static void OnSuccessCallback_66(void * context) { (static_cast(context))->OnSuccessResponse_66(); } - - static void OnFailureCallback_67(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_67(status); - } - - static void OnSuccessCallback_67(void * context, int32_t int32s) - { - (static_cast(context))->OnSuccessResponse_67(int32s); - } - - static void OnFailureCallback_68(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_68(status); - } - - static void OnSuccessCallback_68(void * context) { (static_cast(context))->OnSuccessResponse_68(); } - - static void OnFailureCallback_69(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_69(status); - } - - static void OnSuccessCallback_69(void * context, int32_t int32s) - { - (static_cast(context))->OnSuccessResponse_69(int32s); - } - - static void OnFailureCallback_70(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_70(status); - } - - static void OnSuccessCallback_70(void * context) { (static_cast(context))->OnSuccessResponse_70(); } - - static void OnFailureCallback_71(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_71(status); - } - - static void OnSuccessCallback_71(void * context, int32_t int32s) - { - (static_cast(context))->OnSuccessResponse_71(int32s); - } - - static void OnFailureCallback_72(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_72(status); - } - - static void OnSuccessCallback_72(void * context, int64_t int64s) - { - (static_cast(context))->OnSuccessResponse_72(int64s); - } - - static void OnFailureCallback_73(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_73(status); - } - - static void OnSuccessCallback_73(void * context) { (static_cast(context))->OnSuccessResponse_73(); } - - static void OnFailureCallback_74(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_74(status); - } - - static void OnSuccessCallback_74(void * context, int64_t int64s) - { - (static_cast(context))->OnSuccessResponse_74(int64s); - } - - static void OnFailureCallback_75(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_75(status); - } - - static void OnSuccessCallback_75(void * context) { (static_cast(context))->OnSuccessResponse_75(); } - - static void OnFailureCallback_76(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_76(status); - } - - static void OnSuccessCallback_76(void * context, int64_t int64s) - { - (static_cast(context))->OnSuccessResponse_76(int64s); - } - - static void OnFailureCallback_77(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_77(status); - } - - static void OnSuccessCallback_77(void * context) { (static_cast(context))->OnSuccessResponse_77(); } - - static void OnFailureCallback_78(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_78(status); - } - - static void OnSuccessCallback_78(void * context, int64_t int64s) - { - (static_cast(context))->OnSuccessResponse_78(int64s); - } - - static void OnFailureCallback_79(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_79(status); - } - - static void OnSuccessCallback_79(void * context, float floatSingle) - { - (static_cast(context))->OnSuccessResponse_79(floatSingle); - } - - static void OnFailureCallback_80(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_80(status); - } - - static void OnSuccessCallback_80(void * context) { (static_cast(context))->OnSuccessResponse_80(); } - - static void OnFailureCallback_81(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_81(status); - } - - static void OnSuccessCallback_81(void * context, float floatSingle) - { - (static_cast(context))->OnSuccessResponse_81(floatSingle); - } - - static void OnFailureCallback_82(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_82(status); - } - - static void OnSuccessCallback_82(void * context) { (static_cast(context))->OnSuccessResponse_82(); } - - static void OnFailureCallback_83(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_83(status); - } - - static void OnSuccessCallback_83(void * context, float floatSingle) - { - (static_cast(context))->OnSuccessResponse_83(floatSingle); - } - - static void OnFailureCallback_84(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_84(status); - } - - static void OnSuccessCallback_84(void * context) { (static_cast(context))->OnSuccessResponse_84(); } - - static void OnFailureCallback_85(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_85(status); - } - - static void OnSuccessCallback_85(void * context, float floatSingle) - { - (static_cast(context))->OnSuccessResponse_85(floatSingle); - } - - static void OnFailureCallback_86(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_86(status); - } - - static void OnSuccessCallback_86(void * context) { (static_cast(context))->OnSuccessResponse_86(); } - - static void OnFailureCallback_87(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_87(status); - } - - static void OnSuccessCallback_87(void * context, float floatSingle) - { - (static_cast(context))->OnSuccessResponse_87(floatSingle); - } - - static void OnFailureCallback_88(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_88(status); - } - - static void OnSuccessCallback_88(void * context, double floatDouble) - { - (static_cast(context))->OnSuccessResponse_88(floatDouble); - } - - static void OnFailureCallback_89(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_89(status); - } - - static void OnSuccessCallback_89(void * context) { (static_cast(context))->OnSuccessResponse_89(); } - - static void OnFailureCallback_90(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_90(status); - } - - static void OnSuccessCallback_90(void * context, double floatDouble) - { - (static_cast(context))->OnSuccessResponse_90(floatDouble); - } - - static void OnFailureCallback_91(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_91(status); - } - - static void OnSuccessCallback_91(void * context) { (static_cast(context))->OnSuccessResponse_91(); } - - static void OnFailureCallback_92(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_92(status); - } - - static void OnSuccessCallback_92(void * context, double floatDouble) - { - (static_cast(context))->OnSuccessResponse_92(floatDouble); - } - - static void OnFailureCallback_93(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_93(status); - } - - static void OnSuccessCallback_93(void * context) { (static_cast(context))->OnSuccessResponse_93(); } - - static void OnFailureCallback_94(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_94(status); - } - - static void OnSuccessCallback_94(void * context, double floatDouble) - { - (static_cast(context))->OnSuccessResponse_94(floatDouble); - } - - static void OnFailureCallback_95(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_95(status); - } - - static void OnSuccessCallback_95(void * context) { (static_cast(context))->OnSuccessResponse_95(); } - - static void OnFailureCallback_96(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_96(status); - } - - static void OnSuccessCallback_96(void * context, double floatDouble) - { - (static_cast(context))->OnSuccessResponse_96(floatDouble); - } - - static void OnFailureCallback_97(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_97(status); - } - - static void OnSuccessCallback_97(void * context, uint8_t enum8) - { - (static_cast(context))->OnSuccessResponse_97(enum8); - } - - static void OnFailureCallback_98(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_98(status); - } - - static void OnSuccessCallback_98(void * context) { (static_cast(context))->OnSuccessResponse_98(); } - - static void OnFailureCallback_99(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_99(status); - } - - static void OnSuccessCallback_99(void * context, uint8_t enum8) - { - (static_cast(context))->OnSuccessResponse_99(enum8); - } - - static void OnFailureCallback_100(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_100(status); - } - - static void OnSuccessCallback_100(void * context) { (static_cast(context))->OnSuccessResponse_100(); } - - static void OnFailureCallback_101(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_101(status); - } - - static void OnSuccessCallback_101(void * context, uint8_t enum8) - { - (static_cast(context))->OnSuccessResponse_101(enum8); - } - - static void OnFailureCallback_102(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_102(status); - } - - static void OnSuccessCallback_102(void * context, uint16_t enum16) - { - (static_cast(context))->OnSuccessResponse_102(enum16); - } - - static void OnFailureCallback_103(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_103(status); - } - - static void OnSuccessCallback_103(void * context) { (static_cast(context))->OnSuccessResponse_103(); } - - static void OnFailureCallback_104(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_104(status); - } - - static void OnSuccessCallback_104(void * context, uint16_t enum16) - { - (static_cast(context))->OnSuccessResponse_104(enum16); - } - - static void OnFailureCallback_105(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_105(status); - } - - static void OnSuccessCallback_105(void * context) { (static_cast(context))->OnSuccessResponse_105(); } - - static void OnFailureCallback_106(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_106(status); - } - - static void OnSuccessCallback_106(void * context, uint16_t enum16) - { - (static_cast(context))->OnSuccessResponse_106(enum16); - } - - static void OnFailureCallback_107(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_107(status); - } - - static void OnSuccessCallback_107(void * context, chip::ByteSpan octetString) - { - (static_cast(context))->OnSuccessResponse_107(octetString); - } - - static void OnFailureCallback_108(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_108(status); - } - - static void OnSuccessCallback_108(void * context) { (static_cast(context))->OnSuccessResponse_108(); } - - static void OnFailureCallback_109(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_109(status); - } - - static void OnSuccessCallback_109(void * context, chip::ByteSpan octetString) - { - (static_cast(context))->OnSuccessResponse_109(octetString); - } - - static void OnFailureCallback_110(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_110(status); - } - - static void OnSuccessCallback_110(void * context) { (static_cast(context))->OnSuccessResponse_110(); } - - static void OnFailureCallback_111(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_111(status); - } - - static void OnSuccessCallback_111(void * context, chip::ByteSpan octetString) - { - (static_cast(context))->OnSuccessResponse_111(octetString); - } - - static void OnFailureCallback_112(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_112(status); - } - - static void OnSuccessCallback_112(void * context) { (static_cast(context))->OnSuccessResponse_112(); } - - static void OnFailureCallback_113(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_113(status); - } - - static void OnSuccessCallback_113(void * context, chip::ByteSpan octetString) - { - (static_cast(context))->OnSuccessResponse_113(octetString); - } - - static void OnFailureCallback_114(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_114(status); - } - - static void OnSuccessCallback_114(void * context) { (static_cast(context))->OnSuccessResponse_114(); } - - static void OnFailureCallback_115(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_115(status); - } - - static void OnSuccessCallback_115(void * context, chip::ByteSpan longOctetString) - { - (static_cast(context))->OnSuccessResponse_115(longOctetString); - } - - static void OnFailureCallback_116(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_116(status); - } - - static void OnSuccessCallback_116(void * context) { (static_cast(context))->OnSuccessResponse_116(); } - - static void OnFailureCallback_117(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_117(status); - } - - static void OnSuccessCallback_117(void * context, chip::ByteSpan longOctetString) - { - (static_cast(context))->OnSuccessResponse_117(longOctetString); - } - - static void OnFailureCallback_118(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_118(status); - } - - static void OnSuccessCallback_118(void * context) { (static_cast(context))->OnSuccessResponse_118(); } - - static void OnFailureCallback_119(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_119(status); - } - - static void OnSuccessCallback_119(void * context, chip::CharSpan charString) - { - (static_cast(context))->OnSuccessResponse_119(charString); - } - - static void OnFailureCallback_120(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_120(status); - } - - static void OnSuccessCallback_120(void * context) { (static_cast(context))->OnSuccessResponse_120(); } - - static void OnFailureCallback_121(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_121(status); - } - - static void OnSuccessCallback_121(void * context, chip::CharSpan charString) - { - (static_cast(context))->OnSuccessResponse_121(charString); - } - - static void OnFailureCallback_122(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_122(status); - } - - static void OnSuccessCallback_122(void * context) { (static_cast(context))->OnSuccessResponse_122(); } - - static void OnFailureCallback_123(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_123(status); - } - - static void OnSuccessCallback_123(void * context, chip::CharSpan charString) - { - (static_cast(context))->OnSuccessResponse_123(charString); - } - - static void OnFailureCallback_124(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_124(status); - } - - static void OnSuccessCallback_124(void * context) { (static_cast(context))->OnSuccessResponse_124(); } - - static void OnFailureCallback_125(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_125(status); - } - - static void OnSuccessCallback_125(void * context, chip::CharSpan longCharString) - { - (static_cast(context))->OnSuccessResponse_125(longCharString); - } - - static void OnFailureCallback_126(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_126(status); - } - - static void OnSuccessCallback_126(void * context) { (static_cast(context))->OnSuccessResponse_126(); } - - static void OnFailureCallback_127(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_127(status); - } - - static void OnSuccessCallback_127(void * context, chip::CharSpan longCharString) - { - (static_cast(context))->OnSuccessResponse_127(longCharString); - } - - static void OnFailureCallback_128(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_128(status); - } - - static void OnSuccessCallback_128(void * context) { (static_cast(context))->OnSuccessResponse_128(); } - - static void OnFailureCallback_129(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_129(status); - } - - static void OnSuccessCallback_129(void * context, - const chip::app::DataModel::DecodableList & listLongOctetString) - { - (static_cast(context))->OnSuccessResponse_129(listLongOctetString); - } - - static void OnFailureCallback_130(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_130(status); - } - - static void OnSuccessCallback_130(void * context, uint64_t epochUs) - { - (static_cast(context))->OnSuccessResponse_130(epochUs); - } - - static void OnFailureCallback_131(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_131(status); - } - - static void OnSuccessCallback_131(void * context) { (static_cast(context))->OnSuccessResponse_131(); } - - static void OnFailureCallback_132(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_132(status); - } - - static void OnSuccessCallback_132(void * context, uint64_t epochUs) - { - (static_cast(context))->OnSuccessResponse_132(epochUs); - } - - static void OnFailureCallback_133(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_133(status); - } - - static void OnSuccessCallback_133(void * context) { (static_cast(context))->OnSuccessResponse_133(); } - - static void OnFailureCallback_134(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_134(status); - } - - static void OnSuccessCallback_134(void * context, uint64_t epochUs) - { - (static_cast(context))->OnSuccessResponse_134(epochUs); - } - - static void OnFailureCallback_135(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_135(status); - } - - static void OnSuccessCallback_135(void * context, uint32_t epochS) - { - (static_cast(context))->OnSuccessResponse_135(epochS); - } - - static void OnFailureCallback_136(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_136(status); - } - - static void OnSuccessCallback_136(void * context) { (static_cast(context))->OnSuccessResponse_136(); } - - static void OnFailureCallback_137(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_137(status); - } - - static void OnSuccessCallback_137(void * context, uint32_t epochS) - { - (static_cast(context))->OnSuccessResponse_137(epochS); - } - - static void OnFailureCallback_138(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_138(status); - } - - static void OnSuccessCallback_138(void * context) { (static_cast(context))->OnSuccessResponse_138(); } - - static void OnFailureCallback_139(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_139(status); - } - - static void OnSuccessCallback_139(void * context, uint32_t epochS) - { - (static_cast(context))->OnSuccessResponse_139(epochS); - } - - static void OnFailureCallback_140(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_140(status); - } - - static void OnSuccessCallback_140(void * context, bool unsupported) - { - (static_cast(context))->OnSuccessResponse_140(unsupported); - } - - static void OnFailureCallback_141(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_141(status); - } - - static void OnSuccessCallback_141(void * context) { (static_cast(context))->OnSuccessResponse_141(); } - - static void OnFailureCallback_144(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_144(status); - } - - static void OnSuccessCallback_144(void * context, chip::VendorId vendorId) - { - (static_cast(context))->OnSuccessResponse_144(vendorId); - } - - static void OnFailureCallback_145(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_145(status); - } - - static void OnSuccessCallback_145(void * context) { (static_cast(context))->OnSuccessResponse_145(); } - - static void OnFailureCallback_146(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_146(status); - } - - static void OnSuccessCallback_146(void * context, chip::VendorId vendorId) - { - (static_cast(context))->OnSuccessResponse_146(vendorId); - } - - static void OnFailureCallback_147(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_147(status); - } - - static void OnSuccessCallback_147(void * context) { (static_cast(context))->OnSuccessResponse_147(); } - - static void OnFailureCallback_164(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_164(status); - } - - static void OnSuccessCallback_164(void * context) { (static_cast(context))->OnSuccessResponse_164(); } - - static void OnFailureCallback_165(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_165(status); - } - - static void OnSuccessCallback_165(void * context, const chip::app::DataModel::DecodableList & listInt8u) - { - (static_cast(context))->OnSuccessResponse_165(listInt8u); - } - - static void OnFailureCallback_166(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_166(status); - } - - static void OnSuccessCallback_166(void * context) { (static_cast(context))->OnSuccessResponse_166(); } - - static void OnFailureCallback_167(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_167(status); - } - - static void OnSuccessCallback_167(void * context, const chip::app::DataModel::DecodableList & listOctetString) - { - (static_cast(context))->OnSuccessResponse_167(listOctetString); - } - - static void OnFailureCallback_168(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_168(status); - } - - static void OnSuccessCallback_168(void * context) { (static_cast(context))->OnSuccessResponse_168(); } - - static void OnFailureCallback_169(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_169(status); - } - - static void OnSuccessCallback_169( - void * context, - const chip::app::DataModel::DecodableList & - listStructOctetString) - { - (static_cast(context))->OnSuccessResponse_169(listStructOctetString); - } - - static void OnFailureCallback_172(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_172(status); - } - - static void OnSuccessCallback_172(void * context) { (static_cast(context))->OnSuccessResponse_172(); } - - static void OnFailureCallback_173(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_173(status); - } - - static void OnSuccessCallback_173(void * context, const chip::app::DataModel::Nullable & nullableBoolean) - { - (static_cast(context))->OnSuccessResponse_173(nullableBoolean); - } - - static void OnFailureCallback_174(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_174(status); - } - - static void OnSuccessCallback_174(void * context) { (static_cast(context))->OnSuccessResponse_174(); } - - static void OnFailureCallback_175(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_175(status); - } - - static void OnSuccessCallback_175(void * context, const chip::app::DataModel::Nullable & nullableBoolean) - { - (static_cast(context))->OnSuccessResponse_175(nullableBoolean); - } - - static void OnFailureCallback_176(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_176(status); - } - - static void OnSuccessCallback_176(void * context) { (static_cast(context))->OnSuccessResponse_176(); } - - static void OnFailureCallback_177(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_177(status); - } - - static void OnSuccessCallback_177(void * context, const chip::app::DataModel::Nullable & nullableBitmap8) - { - (static_cast(context))->OnSuccessResponse_177(nullableBitmap8); - } - - static void OnFailureCallback_178(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_178(status); - } - - static void OnSuccessCallback_178(void * context) { (static_cast(context))->OnSuccessResponse_178(); } - - static void OnFailureCallback_179(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_179(status); - } - - static void OnSuccessCallback_179(void * context, const chip::app::DataModel::Nullable & nullableBitmap8) - { - (static_cast(context))->OnSuccessResponse_179(nullableBitmap8); - } - - static void OnFailureCallback_180(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_180(status); - } - - static void OnSuccessCallback_180(void * context) { (static_cast(context))->OnSuccessResponse_180(); } - - static void OnFailureCallback_181(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_181(status); - } - - static void OnSuccessCallback_181(void * context, const chip::app::DataModel::Nullable & nullableBitmap8) - { - (static_cast(context))->OnSuccessResponse_181(nullableBitmap8); - } - - static void OnFailureCallback_182(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_182(status); - } - - static void OnSuccessCallback_182(void * context) { (static_cast(context))->OnSuccessResponse_182(); } - - static void OnFailureCallback_183(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_183(status); - } - - static void OnSuccessCallback_183(void * context, const chip::app::DataModel::Nullable & nullableBitmap16) - { - (static_cast(context))->OnSuccessResponse_183(nullableBitmap16); - } - - static void OnFailureCallback_184(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_184(status); - } - - static void OnSuccessCallback_184(void * context) { (static_cast(context))->OnSuccessResponse_184(); } - - static void OnFailureCallback_185(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_185(status); - } - - static void OnSuccessCallback_185(void * context, const chip::app::DataModel::Nullable & nullableBitmap16) - { - (static_cast(context))->OnSuccessResponse_185(nullableBitmap16); - } - - static void OnFailureCallback_186(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_186(status); - } - - static void OnSuccessCallback_186(void * context) { (static_cast(context))->OnSuccessResponse_186(); } - - static void OnFailureCallback_187(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_187(status); - } - - static void OnSuccessCallback_187(void * context, const chip::app::DataModel::Nullable & nullableBitmap16) - { - (static_cast(context))->OnSuccessResponse_187(nullableBitmap16); - } - - static void OnFailureCallback_188(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_188(status); - } - - static void OnSuccessCallback_188(void * context) { (static_cast(context))->OnSuccessResponse_188(); } - - static void OnFailureCallback_189(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_189(status); - } - - static void OnSuccessCallback_189(void * context, const chip::app::DataModel::Nullable & nullableBitmap32) - { - (static_cast(context))->OnSuccessResponse_189(nullableBitmap32); - } - - static void OnFailureCallback_190(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_190(status); - } - - static void OnSuccessCallback_190(void * context) { (static_cast(context))->OnSuccessResponse_190(); } - - static void OnFailureCallback_191(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_191(status); - } - - static void OnSuccessCallback_191(void * context, const chip::app::DataModel::Nullable & nullableBitmap32) - { - (static_cast(context))->OnSuccessResponse_191(nullableBitmap32); - } - - static void OnFailureCallback_192(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_192(status); - } - - static void OnSuccessCallback_192(void * context) { (static_cast(context))->OnSuccessResponse_192(); } - - static void OnFailureCallback_193(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_193(status); - } - - static void OnSuccessCallback_193(void * context, const chip::app::DataModel::Nullable & nullableBitmap32) - { - (static_cast(context))->OnSuccessResponse_193(nullableBitmap32); - } - - static void OnFailureCallback_194(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_194(status); - } - - static void OnSuccessCallback_194(void * context) { (static_cast(context))->OnSuccessResponse_194(); } - - static void OnFailureCallback_195(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_195(status); - } - - static void OnSuccessCallback_195(void * context, const chip::app::DataModel::Nullable & nullableBitmap64) - { - (static_cast(context))->OnSuccessResponse_195(nullableBitmap64); - } - - static void OnFailureCallback_196(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_196(status); - } - - static void OnSuccessCallback_196(void * context) { (static_cast(context))->OnSuccessResponse_196(); } - - static void OnFailureCallback_197(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_197(status); - } - - static void OnSuccessCallback_197(void * context, const chip::app::DataModel::Nullable & nullableBitmap64) - { - (static_cast(context))->OnSuccessResponse_197(nullableBitmap64); - } - - static void OnFailureCallback_198(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_198(status); - } - - static void OnSuccessCallback_198(void * context) { (static_cast(context))->OnSuccessResponse_198(); } - - static void OnFailureCallback_199(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_199(status); - } - - static void OnSuccessCallback_199(void * context, const chip::app::DataModel::Nullable & nullableBitmap64) - { - (static_cast(context))->OnSuccessResponse_199(nullableBitmap64); - } - - static void OnFailureCallback_200(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_200(status); - } - - static void OnSuccessCallback_200(void * context) { (static_cast(context))->OnSuccessResponse_200(); } - - static void OnFailureCallback_201(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_201(status); - } - - static void OnSuccessCallback_201(void * context, const chip::app::DataModel::Nullable & nullableInt8u) - { - (static_cast(context))->OnSuccessResponse_201(nullableInt8u); - } - - static void OnFailureCallback_202(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_202(status); - } - - static void OnSuccessCallback_202(void * context) { (static_cast(context))->OnSuccessResponse_202(); } - - static void OnFailureCallback_203(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_203(status); - } - - static void OnSuccessCallback_203(void * context, const chip::app::DataModel::Nullable & nullableInt8u) - { - (static_cast(context))->OnSuccessResponse_203(nullableInt8u); - } - - static void OnFailureCallback_204(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_204(status); - } - - static void OnSuccessCallback_204(void * context) { (static_cast(context))->OnSuccessResponse_204(); } - - static void OnFailureCallback_205(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_205(status); - } - - static void OnSuccessCallback_205(void * context, const chip::app::DataModel::Nullable & nullableInt8u) - { - (static_cast(context))->OnSuccessResponse_205(nullableInt8u); - } - - static void OnFailureCallback_206(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_206(status); - } - - static void OnSuccessCallback_206(void * context) { (static_cast(context))->OnSuccessResponse_206(); } - - static void OnFailureCallback_207(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_207(status); - } - - static void OnSuccessCallback_207(void * context, const chip::app::DataModel::Nullable & nullableInt8u) - { - (static_cast(context))->OnSuccessResponse_207(nullableInt8u); - } - - static void OnFailureCallback_208(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_208(status); - } - - static void OnSuccessCallback_208(void * context, const chip::app::DataModel::Nullable & nullableInt8u) - { - (static_cast(context))->OnSuccessResponse_208(nullableInt8u); - } - - static void OnFailureCallback_209(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_209(status); - } - - static void OnSuccessCallback_209(void * context, const chip::app::DataModel::Nullable & nullableInt8u) - { - (static_cast(context))->OnSuccessResponse_209(nullableInt8u); - } - - static void OnFailureCallback_210(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_210(status); - } - - static void OnSuccessCallback_210(void * context) { (static_cast(context))->OnSuccessResponse_210(); } - - static void OnFailureCallback_211(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_211(status); - } - - static void OnSuccessCallback_211(void * context, const chip::app::DataModel::Nullable & nullableInt8u) - { - (static_cast(context))->OnSuccessResponse_211(nullableInt8u); - } - - static void OnFailureCallback_212(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_212(status); - } - - static void OnSuccessCallback_212(void * context, const chip::app::DataModel::Nullable & nullableInt8u) - { - (static_cast(context))->OnSuccessResponse_212(nullableInt8u); - } - - static void OnFailureCallback_213(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_213(status); - } - - static void OnSuccessCallback_213(void * context) { (static_cast(context))->OnSuccessResponse_213(); } - - static void OnFailureCallback_214(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_214(status); - } - - static void OnSuccessCallback_214(void * context, const chip::app::DataModel::Nullable & nullableInt16u) - { - (static_cast(context))->OnSuccessResponse_214(nullableInt16u); - } - - static void OnFailureCallback_215(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_215(status); - } - - static void OnSuccessCallback_215(void * context) { (static_cast(context))->OnSuccessResponse_215(); } - - static void OnFailureCallback_216(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_216(status); - } - - static void OnSuccessCallback_216(void * context, const chip::app::DataModel::Nullable & nullableInt16u) - { - (static_cast(context))->OnSuccessResponse_216(nullableInt16u); - } - - static void OnFailureCallback_217(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_217(status); - } - - static void OnSuccessCallback_217(void * context) { (static_cast(context))->OnSuccessResponse_217(); } - - static void OnFailureCallback_218(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_218(status); - } - - static void OnSuccessCallback_218(void * context, const chip::app::DataModel::Nullable & nullableInt16u) - { - (static_cast(context))->OnSuccessResponse_218(nullableInt16u); - } - - static void OnFailureCallback_219(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_219(status); - } - - static void OnSuccessCallback_219(void * context) { (static_cast(context))->OnSuccessResponse_219(); } - - static void OnFailureCallback_220(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_220(status); - } - - static void OnSuccessCallback_220(void * context, const chip::app::DataModel::Nullable & nullableInt16u) - { - (static_cast(context))->OnSuccessResponse_220(nullableInt16u); - } - - static void OnFailureCallback_221(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_221(status); - } - - static void OnSuccessCallback_221(void * context, const chip::app::DataModel::Nullable & nullableInt16u) - { - (static_cast(context))->OnSuccessResponse_221(nullableInt16u); - } - - static void OnFailureCallback_222(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_222(status); - } - - static void OnSuccessCallback_222(void * context, const chip::app::DataModel::Nullable & nullableInt16u) - { - (static_cast(context))->OnSuccessResponse_222(nullableInt16u); - } - - static void OnFailureCallback_223(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_223(status); - } - - static void OnSuccessCallback_223(void * context) { (static_cast(context))->OnSuccessResponse_223(); } - - static void OnFailureCallback_224(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_224(status); - } - - static void OnSuccessCallback_224(void * context, const chip::app::DataModel::Nullable & nullableInt16u) - { - (static_cast(context))->OnSuccessResponse_224(nullableInt16u); - } - - static void OnFailureCallback_225(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_225(status); - } - - static void OnSuccessCallback_225(void * context, const chip::app::DataModel::Nullable & nullableInt16u) - { - (static_cast(context))->OnSuccessResponse_225(nullableInt16u); - } - - static void OnFailureCallback_226(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_226(status); - } - - static void OnSuccessCallback_226(void * context) { (static_cast(context))->OnSuccessResponse_226(); } - - static void OnFailureCallback_227(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_227(status); - } - - static void OnSuccessCallback_227(void * context, const chip::app::DataModel::Nullable & nullableInt32u) - { - (static_cast(context))->OnSuccessResponse_227(nullableInt32u); - } - - static void OnFailureCallback_228(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_228(status); - } - - static void OnSuccessCallback_228(void * context) { (static_cast(context))->OnSuccessResponse_228(); } - - static void OnFailureCallback_229(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_229(status); - } - - static void OnSuccessCallback_229(void * context, const chip::app::DataModel::Nullable & nullableInt32u) - { - (static_cast(context))->OnSuccessResponse_229(nullableInt32u); - } - - static void OnFailureCallback_230(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_230(status); - } - - static void OnSuccessCallback_230(void * context) { (static_cast(context))->OnSuccessResponse_230(); } - - static void OnFailureCallback_231(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_231(status); - } - - static void OnSuccessCallback_231(void * context, const chip::app::DataModel::Nullable & nullableInt32u) - { - (static_cast(context))->OnSuccessResponse_231(nullableInt32u); - } - - static void OnFailureCallback_232(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_232(status); - } - - static void OnSuccessCallback_232(void * context) { (static_cast(context))->OnSuccessResponse_232(); } - - static void OnFailureCallback_233(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_233(status); - } - - static void OnSuccessCallback_233(void * context, const chip::app::DataModel::Nullable & nullableInt32u) - { - (static_cast(context))->OnSuccessResponse_233(nullableInt32u); - } - - static void OnFailureCallback_234(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_234(status); - } - - static void OnSuccessCallback_234(void * context, const chip::app::DataModel::Nullable & nullableInt32u) - { - (static_cast(context))->OnSuccessResponse_234(nullableInt32u); - } - - static void OnFailureCallback_235(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_235(status); - } - - static void OnSuccessCallback_235(void * context, const chip::app::DataModel::Nullable & nullableInt32u) - { - (static_cast(context))->OnSuccessResponse_235(nullableInt32u); - } - - static void OnFailureCallback_236(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_236(status); - } - - static void OnSuccessCallback_236(void * context) { (static_cast(context))->OnSuccessResponse_236(); } - - static void OnFailureCallback_237(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_237(status); - } - - static void OnSuccessCallback_237(void * context, const chip::app::DataModel::Nullable & nullableInt32u) - { - (static_cast(context))->OnSuccessResponse_237(nullableInt32u); - } - - static void OnFailureCallback_238(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_238(status); - } - - static void OnSuccessCallback_238(void * context, const chip::app::DataModel::Nullable & nullableInt32u) - { - (static_cast(context))->OnSuccessResponse_238(nullableInt32u); - } - - static void OnFailureCallback_239(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_239(status); - } - - static void OnSuccessCallback_239(void * context) { (static_cast(context))->OnSuccessResponse_239(); } - - static void OnFailureCallback_240(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_240(status); - } - - static void OnSuccessCallback_240(void * context, const chip::app::DataModel::Nullable & nullableInt64u) - { - (static_cast(context))->OnSuccessResponse_240(nullableInt64u); - } - - static void OnFailureCallback_241(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_241(status); - } - - static void OnSuccessCallback_241(void * context) { (static_cast(context))->OnSuccessResponse_241(); } - - static void OnFailureCallback_242(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_242(status); - } - - static void OnSuccessCallback_242(void * context, const chip::app::DataModel::Nullable & nullableInt64u) - { - (static_cast(context))->OnSuccessResponse_242(nullableInt64u); - } - - static void OnFailureCallback_243(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_243(status); - } - - static void OnSuccessCallback_243(void * context) { (static_cast(context))->OnSuccessResponse_243(); } - - static void OnFailureCallback_244(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_244(status); - } - - static void OnSuccessCallback_244(void * context, const chip::app::DataModel::Nullable & nullableInt64u) - { - (static_cast(context))->OnSuccessResponse_244(nullableInt64u); - } - - static void OnFailureCallback_245(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_245(status); - } - - static void OnSuccessCallback_245(void * context) { (static_cast(context))->OnSuccessResponse_245(); } - - static void OnFailureCallback_246(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_246(status); - } - - static void OnSuccessCallback_246(void * context, const chip::app::DataModel::Nullable & nullableInt64u) - { - (static_cast(context))->OnSuccessResponse_246(nullableInt64u); - } - - static void OnFailureCallback_247(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_247(status); - } - - static void OnSuccessCallback_247(void * context, const chip::app::DataModel::Nullable & nullableInt64u) - { - (static_cast(context))->OnSuccessResponse_247(nullableInt64u); - } - - static void OnFailureCallback_248(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_248(status); - } - - static void OnSuccessCallback_248(void * context, const chip::app::DataModel::Nullable & nullableInt64u) - { - (static_cast(context))->OnSuccessResponse_248(nullableInt64u); - } - - static void OnFailureCallback_249(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_249(status); - } - - static void OnSuccessCallback_249(void * context) { (static_cast(context))->OnSuccessResponse_249(); } - - static void OnFailureCallback_250(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_250(status); - } - - static void OnSuccessCallback_250(void * context, const chip::app::DataModel::Nullable & nullableInt64u) - { - (static_cast(context))->OnSuccessResponse_250(nullableInt64u); - } - - static void OnFailureCallback_251(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_251(status); - } - - static void OnSuccessCallback_251(void * context, const chip::app::DataModel::Nullable & nullableInt64u) - { - (static_cast(context))->OnSuccessResponse_251(nullableInt64u); - } - - static void OnFailureCallback_252(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_252(status); - } - - static void OnSuccessCallback_252(void * context) { (static_cast(context))->OnSuccessResponse_252(); } - - static void OnFailureCallback_253(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_253(status); - } - - static void OnSuccessCallback_253(void * context, const chip::app::DataModel::Nullable & nullableInt8s) - { - (static_cast(context))->OnSuccessResponse_253(nullableInt8s); - } - - static void OnFailureCallback_254(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_254(status); - } - - static void OnSuccessCallback_254(void * context) { (static_cast(context))->OnSuccessResponse_254(); } - - static void OnFailureCallback_255(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_255(status); - } - - static void OnSuccessCallback_255(void * context, const chip::app::DataModel::Nullable & nullableInt8s) - { - (static_cast(context))->OnSuccessResponse_255(nullableInt8s); - } - - static void OnFailureCallback_256(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_256(status); - } - - static void OnSuccessCallback_256(void * context) { (static_cast(context))->OnSuccessResponse_256(); } - - static void OnFailureCallback_257(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_257(status); - } - - static void OnSuccessCallback_257(void * context, const chip::app::DataModel::Nullable & nullableInt8s) - { - (static_cast(context))->OnSuccessResponse_257(nullableInt8s); - } - - static void OnFailureCallback_258(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_258(status); - } - - static void OnSuccessCallback_258(void * context, const chip::app::DataModel::Nullable & nullableInt8s) - { - (static_cast(context))->OnSuccessResponse_258(nullableInt8s); - } - - static void OnFailureCallback_259(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_259(status); - } - - static void OnSuccessCallback_259(void * context, const chip::app::DataModel::Nullable & nullableInt8s) - { - (static_cast(context))->OnSuccessResponse_259(nullableInt8s); - } - - static void OnFailureCallback_260(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_260(status); - } - - static void OnSuccessCallback_260(void * context) { (static_cast(context))->OnSuccessResponse_260(); } - - static void OnFailureCallback_261(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_261(status); - } - - static void OnSuccessCallback_261(void * context, const chip::app::DataModel::Nullable & nullableInt8s) - { - (static_cast(context))->OnSuccessResponse_261(nullableInt8s); - } - - static void OnFailureCallback_262(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_262(status); - } - - static void OnSuccessCallback_262(void * context, const chip::app::DataModel::Nullable & nullableInt8s) - { - (static_cast(context))->OnSuccessResponse_262(nullableInt8s); - } - - static void OnFailureCallback_263(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_263(status); - } - - static void OnSuccessCallback_263(void * context) { (static_cast(context))->OnSuccessResponse_263(); } - - static void OnFailureCallback_264(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_264(status); - } - - static void OnSuccessCallback_264(void * context, const chip::app::DataModel::Nullable & nullableInt16s) - { - (static_cast(context))->OnSuccessResponse_264(nullableInt16s); - } - - static void OnFailureCallback_265(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_265(status); - } - - static void OnSuccessCallback_265(void * context) { (static_cast(context))->OnSuccessResponse_265(); } - - static void OnFailureCallback_266(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_266(status); - } - - static void OnSuccessCallback_266(void * context, const chip::app::DataModel::Nullable & nullableInt16s) - { - (static_cast(context))->OnSuccessResponse_266(nullableInt16s); - } - - static void OnFailureCallback_267(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_267(status); - } - - static void OnSuccessCallback_267(void * context) { (static_cast(context))->OnSuccessResponse_267(); } - - static void OnFailureCallback_268(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_268(status); - } - - static void OnSuccessCallback_268(void * context, const chip::app::DataModel::Nullable & nullableInt16s) - { - (static_cast(context))->OnSuccessResponse_268(nullableInt16s); - } - - static void OnFailureCallback_269(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_269(status); - } - - static void OnSuccessCallback_269(void * context, const chip::app::DataModel::Nullable & nullableInt16s) - { - (static_cast(context))->OnSuccessResponse_269(nullableInt16s); - } - - static void OnFailureCallback_270(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_270(status); - } - - static void OnSuccessCallback_270(void * context, const chip::app::DataModel::Nullable & nullableInt16s) - { - (static_cast(context))->OnSuccessResponse_270(nullableInt16s); - } - - static void OnFailureCallback_271(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_271(status); - } - - static void OnSuccessCallback_271(void * context) { (static_cast(context))->OnSuccessResponse_271(); } - - static void OnFailureCallback_272(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_272(status); - } - - static void OnSuccessCallback_272(void * context, const chip::app::DataModel::Nullable & nullableInt16s) - { - (static_cast(context))->OnSuccessResponse_272(nullableInt16s); - } - - static void OnFailureCallback_273(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_273(status); - } - - static void OnSuccessCallback_273(void * context, const chip::app::DataModel::Nullable & nullableInt16s) - { - (static_cast(context))->OnSuccessResponse_273(nullableInt16s); - } - - static void OnFailureCallback_274(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_274(status); - } - - static void OnSuccessCallback_274(void * context) { (static_cast(context))->OnSuccessResponse_274(); } - - static void OnFailureCallback_275(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_275(status); - } - - static void OnSuccessCallback_275(void * context, const chip::app::DataModel::Nullable & nullableInt32s) - { - (static_cast(context))->OnSuccessResponse_275(nullableInt32s); - } - - static void OnFailureCallback_276(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_276(status); - } - - static void OnSuccessCallback_276(void * context) { (static_cast(context))->OnSuccessResponse_276(); } - - static void OnFailureCallback_277(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_277(status); - } - - static void OnSuccessCallback_277(void * context, const chip::app::DataModel::Nullable & nullableInt32s) - { - (static_cast(context))->OnSuccessResponse_277(nullableInt32s); - } - - static void OnFailureCallback_278(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_278(status); - } - - static void OnSuccessCallback_278(void * context) { (static_cast(context))->OnSuccessResponse_278(); } - - static void OnFailureCallback_279(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_279(status); - } - - static void OnSuccessCallback_279(void * context, const chip::app::DataModel::Nullable & nullableInt32s) - { - (static_cast(context))->OnSuccessResponse_279(nullableInt32s); - } - - static void OnFailureCallback_280(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_280(status); - } - - static void OnSuccessCallback_280(void * context, const chip::app::DataModel::Nullable & nullableInt32s) - { - (static_cast(context))->OnSuccessResponse_280(nullableInt32s); - } - - static void OnFailureCallback_281(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_281(status); - } - - static void OnSuccessCallback_281(void * context, const chip::app::DataModel::Nullable & nullableInt32s) - { - (static_cast(context))->OnSuccessResponse_281(nullableInt32s); - } - - static void OnFailureCallback_282(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_282(status); - } - - static void OnSuccessCallback_282(void * context) { (static_cast(context))->OnSuccessResponse_282(); } - - static void OnFailureCallback_283(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_283(status); - } - - static void OnSuccessCallback_283(void * context, const chip::app::DataModel::Nullable & nullableInt32s) - { - (static_cast(context))->OnSuccessResponse_283(nullableInt32s); - } - - static void OnFailureCallback_284(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_284(status); - } - - static void OnSuccessCallback_284(void * context, const chip::app::DataModel::Nullable & nullableInt32s) - { - (static_cast(context))->OnSuccessResponse_284(nullableInt32s); - } - - static void OnFailureCallback_285(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_285(status); - } - - static void OnSuccessCallback_285(void * context) { (static_cast(context))->OnSuccessResponse_285(); } - - static void OnFailureCallback_286(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_286(status); - } - - static void OnSuccessCallback_286(void * context, const chip::app::DataModel::Nullable & nullableInt64s) - { - (static_cast(context))->OnSuccessResponse_286(nullableInt64s); - } - - static void OnFailureCallback_287(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_287(status); - } - - static void OnSuccessCallback_287(void * context) { (static_cast(context))->OnSuccessResponse_287(); } - - static void OnFailureCallback_288(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_288(status); - } - - static void OnSuccessCallback_288(void * context, const chip::app::DataModel::Nullable & nullableInt64s) - { - (static_cast(context))->OnSuccessResponse_288(nullableInt64s); - } - - static void OnFailureCallback_289(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_289(status); - } - - static void OnSuccessCallback_289(void * context) { (static_cast(context))->OnSuccessResponse_289(); } - - static void OnFailureCallback_290(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_290(status); - } - - static void OnSuccessCallback_290(void * context, const chip::app::DataModel::Nullable & nullableInt64s) - { - (static_cast(context))->OnSuccessResponse_290(nullableInt64s); - } - - static void OnFailureCallback_291(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_291(status); - } - - static void OnSuccessCallback_291(void * context, const chip::app::DataModel::Nullable & nullableInt64s) - { - (static_cast(context))->OnSuccessResponse_291(nullableInt64s); - } - - static void OnFailureCallback_292(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_292(status); - } - - static void OnSuccessCallback_292(void * context, const chip::app::DataModel::Nullable & nullableInt64s) - { - (static_cast(context))->OnSuccessResponse_292(nullableInt64s); - } - - static void OnFailureCallback_293(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_293(status); - } - - static void OnSuccessCallback_293(void * context) { (static_cast(context))->OnSuccessResponse_293(); } - - static void OnFailureCallback_294(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_294(status); - } - - static void OnSuccessCallback_294(void * context, const chip::app::DataModel::Nullable & nullableInt64s) - { - (static_cast(context))->OnSuccessResponse_294(nullableInt64s); - } - - static void OnFailureCallback_295(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_295(status); - } - - static void OnSuccessCallback_295(void * context, const chip::app::DataModel::Nullable & nullableInt64s) - { - (static_cast(context))->OnSuccessResponse_295(nullableInt64s); - } - - static void OnFailureCallback_296(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_296(status); - } - - static void OnSuccessCallback_296(void * context) { (static_cast(context))->OnSuccessResponse_296(); } - - static void OnFailureCallback_297(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_297(status); - } - - static void OnSuccessCallback_297(void * context, const chip::app::DataModel::Nullable & nullableFloatSingle) - { - (static_cast(context))->OnSuccessResponse_297(nullableFloatSingle); - } - - static void OnFailureCallback_298(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_298(status); - } - - static void OnSuccessCallback_298(void * context) { (static_cast(context))->OnSuccessResponse_298(); } - - static void OnFailureCallback_299(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_299(status); - } - - static void OnSuccessCallback_299(void * context, const chip::app::DataModel::Nullable & nullableFloatSingle) - { - (static_cast(context))->OnSuccessResponse_299(nullableFloatSingle); - } - - static void OnFailureCallback_300(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_300(status); - } - - static void OnSuccessCallback_300(void * context) { (static_cast(context))->OnSuccessResponse_300(); } - - static void OnFailureCallback_301(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_301(status); - } - - static void OnSuccessCallback_301(void * context, const chip::app::DataModel::Nullable & nullableFloatSingle) - { - (static_cast(context))->OnSuccessResponse_301(nullableFloatSingle); - } - - static void OnFailureCallback_302(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_302(status); - } - - static void OnSuccessCallback_302(void * context) { (static_cast(context))->OnSuccessResponse_302(); } - - static void OnFailureCallback_303(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_303(status); - } - - static void OnSuccessCallback_303(void * context, const chip::app::DataModel::Nullable & nullableFloatSingle) - { - (static_cast(context))->OnSuccessResponse_303(nullableFloatSingle); - } - - static void OnFailureCallback_304(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_304(status); - } - - static void OnSuccessCallback_304(void * context) { (static_cast(context))->OnSuccessResponse_304(); } - - static void OnFailureCallback_305(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_305(status); - } - - static void OnSuccessCallback_305(void * context, const chip::app::DataModel::Nullable & nullableFloatSingle) - { - (static_cast(context))->OnSuccessResponse_305(nullableFloatSingle); - } - - static void OnFailureCallback_306(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_306(status); - } - - static void OnSuccessCallback_306(void * context) { (static_cast(context))->OnSuccessResponse_306(); } - - static void OnFailureCallback_307(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_307(status); - } - - static void OnSuccessCallback_307(void * context, const chip::app::DataModel::Nullable & nullableFloatDouble) - { - (static_cast(context))->OnSuccessResponse_307(nullableFloatDouble); - } - - static void OnFailureCallback_308(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_308(status); - } - - static void OnSuccessCallback_308(void * context) { (static_cast(context))->OnSuccessResponse_308(); } - - static void OnFailureCallback_309(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_309(status); - } - - static void OnSuccessCallback_309(void * context, const chip::app::DataModel::Nullable & nullableFloatDouble) - { - (static_cast(context))->OnSuccessResponse_309(nullableFloatDouble); - } - - static void OnFailureCallback_310(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_310(status); - } - - static void OnSuccessCallback_310(void * context) { (static_cast(context))->OnSuccessResponse_310(); } - - static void OnFailureCallback_311(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_311(status); - } - - static void OnSuccessCallback_311(void * context, const chip::app::DataModel::Nullable & nullableFloatDouble) - { - (static_cast(context))->OnSuccessResponse_311(nullableFloatDouble); - } - - static void OnFailureCallback_312(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_312(status); - } - - static void OnSuccessCallback_312(void * context) { (static_cast(context))->OnSuccessResponse_312(); } - - static void OnFailureCallback_313(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_313(status); - } - - static void OnSuccessCallback_313(void * context, const chip::app::DataModel::Nullable & nullableFloatDouble) - { - (static_cast(context))->OnSuccessResponse_313(nullableFloatDouble); - } - - static void OnFailureCallback_314(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_314(status); - } - - static void OnSuccessCallback_314(void * context) { (static_cast(context))->OnSuccessResponse_314(); } - - static void OnFailureCallback_315(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_315(status); - } - - static void OnSuccessCallback_315(void * context, const chip::app::DataModel::Nullable & nullableFloatDouble) - { - (static_cast(context))->OnSuccessResponse_315(nullableFloatDouble); - } - - static void OnFailureCallback_316(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_316(status); - } - - static void OnSuccessCallback_316(void * context) { (static_cast(context))->OnSuccessResponse_316(); } - - static void OnFailureCallback_317(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_317(status); - } - - static void OnSuccessCallback_317(void * context, const chip::app::DataModel::Nullable & nullableEnum8) - { - (static_cast(context))->OnSuccessResponse_317(nullableEnum8); - } - - static void OnFailureCallback_318(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_318(status); - } - - static void OnSuccessCallback_318(void * context) { (static_cast(context))->OnSuccessResponse_318(); } - - static void OnFailureCallback_319(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_319(status); - } - - static void OnSuccessCallback_319(void * context, const chip::app::DataModel::Nullable & nullableEnum8) - { - (static_cast(context))->OnSuccessResponse_319(nullableEnum8); - } - - static void OnFailureCallback_320(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_320(status); - } - - static void OnSuccessCallback_320(void * context) { (static_cast(context))->OnSuccessResponse_320(); } - - static void OnFailureCallback_321(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_321(status); - } - - static void OnSuccessCallback_321(void * context, const chip::app::DataModel::Nullable & nullableEnum8) - { - (static_cast(context))->OnSuccessResponse_321(nullableEnum8); - } - - static void OnFailureCallback_322(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_322(status); - } - - static void OnSuccessCallback_322(void * context) { (static_cast(context))->OnSuccessResponse_322(); } - - static void OnFailureCallback_323(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_323(status); - } - - static void OnSuccessCallback_323(void * context, const chip::app::DataModel::Nullable & nullableEnum8) - { - (static_cast(context))->OnSuccessResponse_323(nullableEnum8); - } - - static void OnFailureCallback_324(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_324(status); - } - - static void OnSuccessCallback_324(void * context) { (static_cast(context))->OnSuccessResponse_324(); } - - static void OnFailureCallback_325(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_325(status); - } - - static void OnSuccessCallback_325(void * context, const chip::app::DataModel::Nullable & nullableEnum16) - { - (static_cast(context))->OnSuccessResponse_325(nullableEnum16); - } - - static void OnFailureCallback_326(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_326(status); - } - - static void OnSuccessCallback_326(void * context) { (static_cast(context))->OnSuccessResponse_326(); } - - static void OnFailureCallback_327(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_327(status); - } - - static void OnSuccessCallback_327(void * context, const chip::app::DataModel::Nullable & nullableEnum16) - { - (static_cast(context))->OnSuccessResponse_327(nullableEnum16); - } - - static void OnFailureCallback_328(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_328(status); - } - - static void OnSuccessCallback_328(void * context) { (static_cast(context))->OnSuccessResponse_328(); } - - static void OnFailureCallback_329(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_329(status); - } - - static void OnSuccessCallback_329(void * context, const chip::app::DataModel::Nullable & nullableEnum16) - { - (static_cast(context))->OnSuccessResponse_329(nullableEnum16); - } - - static void OnFailureCallback_330(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_330(status); - } - - static void OnSuccessCallback_330(void * context) { (static_cast(context))->OnSuccessResponse_330(); } - - static void OnFailureCallback_331(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_331(status); - } - - static void OnSuccessCallback_331(void * context, const chip::app::DataModel::Nullable & nullableEnum16) - { - (static_cast(context))->OnSuccessResponse_331(nullableEnum16); - } - - static void OnFailureCallback_332(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_332(status); - } - - static void OnSuccessCallback_332(void * context) { (static_cast(context))->OnSuccessResponse_332(); } - - static void OnFailureCallback_333(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_333(status); - } - - static void - OnSuccessCallback_333(void * context, - const chip::app::DataModel::Nullable & nullableEnumAttr) - { - (static_cast(context))->OnSuccessResponse_333(nullableEnumAttr); - } - - static void OnFailureCallback_334(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_334(status); - } - - static void OnSuccessCallback_334(void * context) { (static_cast(context))->OnSuccessResponse_334(); } - - static void OnFailureCallback_335(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_335(status); - } - - static void - OnSuccessCallback_335(void * context, - const chip::app::DataModel::Nullable & nullableEnumAttr) - { - (static_cast(context))->OnSuccessResponse_335(nullableEnumAttr); - } - - static void OnFailureCallback_336(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_336(status); - } - - static void OnSuccessCallback_336(void * context) { (static_cast(context))->OnSuccessResponse_336(); } - - static void OnFailureCallback_337(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_337(status); - } - - static void - OnSuccessCallback_337(void * context, - const chip::app::DataModel::Nullable & nullableEnumAttr) - { - (static_cast(context))->OnSuccessResponse_337(nullableEnumAttr); - } - - static void OnFailureCallback_338(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_338(status); - } - - static void OnSuccessCallback_338(void * context) { (static_cast(context))->OnSuccessResponse_338(); } - - static void OnFailureCallback_339(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_339(status); - } - - static void - OnSuccessCallback_339(void * context, - const chip::app::DataModel::Nullable & nullableEnumAttr) - { - (static_cast(context))->OnSuccessResponse_339(nullableEnumAttr); - } - - static void OnFailureCallback_340(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_340(status); - } - - static void OnSuccessCallback_340(void * context, const chip::app::DataModel::Nullable & nullableOctetString) - { - (static_cast(context))->OnSuccessResponse_340(nullableOctetString); - } - - static void OnFailureCallback_341(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_341(status); - } - - static void OnSuccessCallback_341(void * context) { (static_cast(context))->OnSuccessResponse_341(); } - - static void OnFailureCallback_342(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_342(status); - } - - static void OnSuccessCallback_342(void * context, const chip::app::DataModel::Nullable & nullableOctetString) - { - (static_cast(context))->OnSuccessResponse_342(nullableOctetString); - } - - static void OnFailureCallback_343(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_343(status); - } - - static void OnSuccessCallback_343(void * context) { (static_cast(context))->OnSuccessResponse_343(); } - - static void OnFailureCallback_344(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_344(status); - } - - static void OnSuccessCallback_344(void * context, const chip::app::DataModel::Nullable & nullableOctetString) - { - (static_cast(context))->OnSuccessResponse_344(nullableOctetString); - } - - static void OnFailureCallback_345(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_345(status); - } - - static void OnSuccessCallback_345(void * context) { (static_cast(context))->OnSuccessResponse_345(); } - - static void OnFailureCallback_346(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_346(status); - } - - static void OnSuccessCallback_346(void * context, const chip::app::DataModel::Nullable & nullableOctetString) - { - (static_cast(context))->OnSuccessResponse_346(nullableOctetString); - } - - static void OnFailureCallback_347(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_347(status); - } - - static void OnSuccessCallback_347(void * context, const chip::app::DataModel::Nullable & nullableCharString) - { - (static_cast(context))->OnSuccessResponse_347(nullableCharString); - } - - static void OnFailureCallback_348(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_348(status); - } - - static void OnSuccessCallback_348(void * context) { (static_cast(context))->OnSuccessResponse_348(); } - - static void OnFailureCallback_349(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_349(status); - } - - static void OnSuccessCallback_349(void * context, const chip::app::DataModel::Nullable & nullableCharString) - { - (static_cast(context))->OnSuccessResponse_349(nullableCharString); - } - - static void OnFailureCallback_350(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_350(status); - } - - static void OnSuccessCallback_350(void * context) { (static_cast(context))->OnSuccessResponse_350(); } - - static void OnFailureCallback_351(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_351(status); - } - - static void OnSuccessCallback_351(void * context, const chip::app::DataModel::Nullable & nullableCharString) - { - (static_cast(context))->OnSuccessResponse_351(nullableCharString); - } - - static void OnFailureCallback_352(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_352(status); - } - - static void OnSuccessCallback_352(void * context) { (static_cast(context))->OnSuccessResponse_352(); } - - static void OnFailureCallback_353(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_353(status); - } - - static void OnSuccessCallback_353(void * context, const chip::app::DataModel::Nullable & nullableCharString) - { - (static_cast(context))->OnSuccessResponse_353(nullableCharString); - } - - static void OnFailureCallback_354(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_354(status); - } - - static void OnSuccessCallback_354(void * context, const chip::app::DataModel::DecodableList & listInt8u) - { - (static_cast(context))->OnSuccessResponse_354(listInt8u); - } - - static void OnFailureCallback_355(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_355(status); - } - - static void OnSuccessCallback_355(void * context, const chip::app::DataModel::DecodableList & listInt8u) - { - (static_cast(context))->OnSuccessResponse_355(listInt8u); - } - - static void OnFailureCallback_358(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_358(status); - } - - static void OnSuccessCallback_358(void * context, const chip::app::DataModel::DecodableList & listInt8u) - { - (static_cast(context))->OnSuccessResponse_358(listInt8u); - } - - bool mReceivedReport_358 = false; - - static void OnFailureCallback_359(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_359(status); - } - - static void OnSuccessCallback_359(void * context, const chip::app::DataModel::DecodableList & listInt8u) - { - (static_cast(context))->OnSuccessResponse_359(listInt8u); - } - - static void OnSubscriptionEstablished_359(void * context) - { - (static_cast(context))->OnSubscriptionEstablishedResponse_359(); - } - - static void OnFailureCallback_360(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_360(status); - } - - static void OnSuccessCallback_360(void * context) { (static_cast(context))->OnSuccessResponse_360(); } - - static void OnFailureCallback_361(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_361(status); - } - - static void OnSuccessCallback_361(void * context, const chip::app::DataModel::DecodableList & listInt8u) - { - (static_cast(context))->OnSuccessResponse_361(listInt8u); - } - - bool mReceivedReport_361 = false; - - static void OnFailureCallback_362(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_362(status); - } - - static void OnSuccessCallback_362(void * context, uint8_t rangeRestrictedInt8u) - { - (static_cast(context))->OnSuccessResponse_362(rangeRestrictedInt8u); - } - - static void OnFailureCallback_363(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_363(status); - } - - static void OnSuccessCallback_363(void * context) { (static_cast(context))->OnSuccessResponse_363(); } - - static void OnFailureCallback_364(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_364(status); - } - - static void OnSuccessCallback_364(void * context) { (static_cast(context))->OnSuccessResponse_364(); } - - static void OnFailureCallback_365(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_365(status); - } - - static void OnSuccessCallback_365(void * context) { (static_cast(context))->OnSuccessResponse_365(); } - - static void OnFailureCallback_366(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_366(status); - } - - static void OnSuccessCallback_366(void * context) { (static_cast(context))->OnSuccessResponse_366(); } - - static void OnFailureCallback_367(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_367(status); - } - - static void OnSuccessCallback_367(void * context, uint8_t rangeRestrictedInt8u) - { - (static_cast(context))->OnSuccessResponse_367(rangeRestrictedInt8u); - } - - static void OnFailureCallback_368(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_368(status); - } - - static void OnSuccessCallback_368(void * context) { (static_cast(context))->OnSuccessResponse_368(); } - - static void OnFailureCallback_369(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_369(status); - } - - static void OnSuccessCallback_369(void * context, uint8_t rangeRestrictedInt8u) - { - (static_cast(context))->OnSuccessResponse_369(rangeRestrictedInt8u); - } - - static void OnFailureCallback_370(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_370(status); - } - - static void OnSuccessCallback_370(void * context) { (static_cast(context))->OnSuccessResponse_370(); } - - static void OnFailureCallback_371(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_371(status); - } - - static void OnSuccessCallback_371(void * context, uint8_t rangeRestrictedInt8u) - { - (static_cast(context))->OnSuccessResponse_371(rangeRestrictedInt8u); - } - - static void OnFailureCallback_372(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_372(status); - } - - static void OnSuccessCallback_372(void * context) { (static_cast(context))->OnSuccessResponse_372(); } - - static void OnFailureCallback_373(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_373(status); - } - - static void OnSuccessCallback_373(void * context, uint8_t rangeRestrictedInt8u) - { - (static_cast(context))->OnSuccessResponse_373(rangeRestrictedInt8u); - } - - static void OnFailureCallback_374(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_374(status); - } - - static void OnSuccessCallback_374(void * context, uint16_t rangeRestrictedInt16u) - { - (static_cast(context))->OnSuccessResponse_374(rangeRestrictedInt16u); - } - - static void OnFailureCallback_375(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_375(status); - } - - static void OnSuccessCallback_375(void * context) { (static_cast(context))->OnSuccessResponse_375(); } - - static void OnFailureCallback_376(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_376(status); - } - - static void OnSuccessCallback_376(void * context) { (static_cast(context))->OnSuccessResponse_376(); } - - static void OnFailureCallback_377(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_377(status); - } - - static void OnSuccessCallback_377(void * context) { (static_cast(context))->OnSuccessResponse_377(); } - - static void OnFailureCallback_378(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_378(status); - } - - static void OnSuccessCallback_378(void * context) { (static_cast(context))->OnSuccessResponse_378(); } - - static void OnFailureCallback_379(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_379(status); - } - - static void OnSuccessCallback_379(void * context, uint16_t rangeRestrictedInt16u) - { - (static_cast(context))->OnSuccessResponse_379(rangeRestrictedInt16u); - } - - static void OnFailureCallback_380(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_380(status); - } - - static void OnSuccessCallback_380(void * context) { (static_cast(context))->OnSuccessResponse_380(); } - - static void OnFailureCallback_381(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_381(status); - } - - static void OnSuccessCallback_381(void * context, uint16_t rangeRestrictedInt16u) - { - (static_cast(context))->OnSuccessResponse_381(rangeRestrictedInt16u); - } - - static void OnFailureCallback_382(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_382(status); - } - - static void OnSuccessCallback_382(void * context) { (static_cast(context))->OnSuccessResponse_382(); } - - static void OnFailureCallback_383(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_383(status); - } - - static void OnSuccessCallback_383(void * context, uint16_t rangeRestrictedInt16u) - { - (static_cast(context))->OnSuccessResponse_383(rangeRestrictedInt16u); - } - - static void OnFailureCallback_384(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_384(status); - } - - static void OnSuccessCallback_384(void * context) { (static_cast(context))->OnSuccessResponse_384(); } - - static void OnFailureCallback_385(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_385(status); - } - - static void OnSuccessCallback_385(void * context, uint16_t rangeRestrictedInt16u) - { - (static_cast(context))->OnSuccessResponse_385(rangeRestrictedInt16u); - } - - static void OnFailureCallback_386(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_386(status); - } - - static void OnSuccessCallback_386(void * context, int8_t rangeRestrictedInt8s) - { - (static_cast(context))->OnSuccessResponse_386(rangeRestrictedInt8s); - } - - static void OnFailureCallback_387(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_387(status); - } - - static void OnSuccessCallback_387(void * context) { (static_cast(context))->OnSuccessResponse_387(); } - - static void OnFailureCallback_388(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_388(status); - } - - static void OnSuccessCallback_388(void * context) { (static_cast(context))->OnSuccessResponse_388(); } - - static void OnFailureCallback_389(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_389(status); - } - - static void OnSuccessCallback_389(void * context) { (static_cast(context))->OnSuccessResponse_389(); } - - static void OnFailureCallback_390(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_390(status); - } - - static void OnSuccessCallback_390(void * context) { (static_cast(context))->OnSuccessResponse_390(); } - - static void OnFailureCallback_391(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_391(status); - } - - static void OnSuccessCallback_391(void * context, int8_t rangeRestrictedInt8s) - { - (static_cast(context))->OnSuccessResponse_391(rangeRestrictedInt8s); - } - - static void OnFailureCallback_392(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_392(status); - } - - static void OnSuccessCallback_392(void * context) { (static_cast(context))->OnSuccessResponse_392(); } - - static void OnFailureCallback_393(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_393(status); - } - - static void OnSuccessCallback_393(void * context, int8_t rangeRestrictedInt8s) - { - (static_cast(context))->OnSuccessResponse_393(rangeRestrictedInt8s); - } - - static void OnFailureCallback_394(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_394(status); - } - - static void OnSuccessCallback_394(void * context) { (static_cast(context))->OnSuccessResponse_394(); } - - static void OnFailureCallback_395(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_395(status); - } - - static void OnSuccessCallback_395(void * context, int8_t rangeRestrictedInt8s) - { - (static_cast(context))->OnSuccessResponse_395(rangeRestrictedInt8s); - } - - static void OnFailureCallback_396(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_396(status); - } - - static void OnSuccessCallback_396(void * context) { (static_cast(context))->OnSuccessResponse_396(); } - - static void OnFailureCallback_397(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_397(status); - } - - static void OnSuccessCallback_397(void * context, int8_t rangeRestrictedInt8s) - { - (static_cast(context))->OnSuccessResponse_397(rangeRestrictedInt8s); - } - - static void OnFailureCallback_398(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_398(status); - } - - static void OnSuccessCallback_398(void * context, int16_t rangeRestrictedInt16s) - { - (static_cast(context))->OnSuccessResponse_398(rangeRestrictedInt16s); - } - - static void OnFailureCallback_399(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_399(status); - } - - static void OnSuccessCallback_399(void * context) { (static_cast(context))->OnSuccessResponse_399(); } - - static void OnFailureCallback_400(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_400(status); - } - - static void OnSuccessCallback_400(void * context) { (static_cast(context))->OnSuccessResponse_400(); } - - static void OnFailureCallback_401(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_401(status); - } - - static void OnSuccessCallback_401(void * context) { (static_cast(context))->OnSuccessResponse_401(); } - - static void OnFailureCallback_402(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_402(status); - } - - static void OnSuccessCallback_402(void * context) { (static_cast(context))->OnSuccessResponse_402(); } - - static void OnFailureCallback_403(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_403(status); - } - - static void OnSuccessCallback_403(void * context, int16_t rangeRestrictedInt16s) - { - (static_cast(context))->OnSuccessResponse_403(rangeRestrictedInt16s); - } - - static void OnFailureCallback_404(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_404(status); - } - - static void OnSuccessCallback_404(void * context) { (static_cast(context))->OnSuccessResponse_404(); } - - static void OnFailureCallback_405(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_405(status); - } - - static void OnSuccessCallback_405(void * context, int16_t rangeRestrictedInt16s) - { - (static_cast(context))->OnSuccessResponse_405(rangeRestrictedInt16s); - } - - static void OnFailureCallback_406(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_406(status); - } - - static void OnSuccessCallback_406(void * context) { (static_cast(context))->OnSuccessResponse_406(); } - - static void OnFailureCallback_407(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_407(status); - } - - static void OnSuccessCallback_407(void * context, int16_t rangeRestrictedInt16s) - { - (static_cast(context))->OnSuccessResponse_407(rangeRestrictedInt16s); - } - - static void OnFailureCallback_408(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_408(status); - } - - static void OnSuccessCallback_408(void * context) { (static_cast(context))->OnSuccessResponse_408(); } - - static void OnFailureCallback_409(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_409(status); - } - - static void OnSuccessCallback_409(void * context, int16_t rangeRestrictedInt16s) - { - (static_cast(context))->OnSuccessResponse_409(rangeRestrictedInt16s); - } - - static void OnFailureCallback_410(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_410(status); - } - - static void OnSuccessCallback_410(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) - { - (static_cast(context))->OnSuccessResponse_410(nullableRangeRestrictedInt8u); - } - - static void OnFailureCallback_411(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_411(status); - } - - static void OnSuccessCallback_411(void * context) { (static_cast(context))->OnSuccessResponse_411(); } - - static void OnFailureCallback_412(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_412(status); - } - - static void OnSuccessCallback_412(void * context) { (static_cast(context))->OnSuccessResponse_412(); } - - static void OnFailureCallback_413(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_413(status); - } - - static void OnSuccessCallback_413(void * context) { (static_cast(context))->OnSuccessResponse_413(); } - - static void OnFailureCallback_414(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_414(status); - } - - static void OnSuccessCallback_414(void * context) { (static_cast(context))->OnSuccessResponse_414(); } - - static void OnFailureCallback_415(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_415(status); - } - - static void OnSuccessCallback_415(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) - { - (static_cast(context))->OnSuccessResponse_415(nullableRangeRestrictedInt8u); - } - - static void OnFailureCallback_416(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_416(status); - } - - static void OnSuccessCallback_416(void * context) { (static_cast(context))->OnSuccessResponse_416(); } - - static void OnFailureCallback_417(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_417(status); - } - - static void OnSuccessCallback_417(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) - { - (static_cast(context))->OnSuccessResponse_417(nullableRangeRestrictedInt8u); - } - - static void OnFailureCallback_418(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_418(status); - } - - static void OnSuccessCallback_418(void * context) { (static_cast(context))->OnSuccessResponse_418(); } - - static void OnFailureCallback_419(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_419(status); - } - - static void OnSuccessCallback_419(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) - { - (static_cast(context))->OnSuccessResponse_419(nullableRangeRestrictedInt8u); - } - - static void OnFailureCallback_420(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_420(status); - } - - static void OnSuccessCallback_420(void * context) { (static_cast(context))->OnSuccessResponse_420(); } - - static void OnFailureCallback_421(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_421(status); - } - - static void OnSuccessCallback_421(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) - { - (static_cast(context))->OnSuccessResponse_421(nullableRangeRestrictedInt8u); - } - - static void OnFailureCallback_422(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_422(status); - } - - static void OnSuccessCallback_422(void * context) { (static_cast(context))->OnSuccessResponse_422(); } - - static void OnFailureCallback_423(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_423(status); - } - - static void OnSuccessCallback_423(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) - { - (static_cast(context))->OnSuccessResponse_423(nullableRangeRestrictedInt8u); - } - - static void OnFailureCallback_424(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_424(status); - } - - static void OnSuccessCallback_424(void * context, - const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) - { - (static_cast(context))->OnSuccessResponse_424(nullableRangeRestrictedInt16u); - } - - static void OnFailureCallback_425(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_425(status); - } - - static void OnSuccessCallback_425(void * context) { (static_cast(context))->OnSuccessResponse_425(); } - - static void OnFailureCallback_426(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_426(status); - } - - static void OnSuccessCallback_426(void * context) { (static_cast(context))->OnSuccessResponse_426(); } - - static void OnFailureCallback_427(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_427(status); - } - - static void OnSuccessCallback_427(void * context) { (static_cast(context))->OnSuccessResponse_427(); } - - static void OnFailureCallback_428(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_428(status); - } - - static void OnSuccessCallback_428(void * context) { (static_cast(context))->OnSuccessResponse_428(); } - - static void OnFailureCallback_429(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_429(status); - } - - static void OnSuccessCallback_429(void * context, - const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) - { - (static_cast(context))->OnSuccessResponse_429(nullableRangeRestrictedInt16u); - } - - static void OnFailureCallback_430(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_430(status); - } - - static void OnSuccessCallback_430(void * context) { (static_cast(context))->OnSuccessResponse_430(); } - - static void OnFailureCallback_431(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_431(status); - } - - static void OnSuccessCallback_431(void * context, - const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) - { - (static_cast(context))->OnSuccessResponse_431(nullableRangeRestrictedInt16u); - } - - static void OnFailureCallback_432(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_432(status); - } - - static void OnSuccessCallback_432(void * context) { (static_cast(context))->OnSuccessResponse_432(); } - - static void OnFailureCallback_433(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_433(status); - } - - static void OnSuccessCallback_433(void * context, - const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) - { - (static_cast(context))->OnSuccessResponse_433(nullableRangeRestrictedInt16u); - } - - static void OnFailureCallback_434(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_434(status); - } - - static void OnSuccessCallback_434(void * context) { (static_cast(context))->OnSuccessResponse_434(); } - - static void OnFailureCallback_435(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_435(status); - } - - static void OnSuccessCallback_435(void * context, - const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) - { - (static_cast(context))->OnSuccessResponse_435(nullableRangeRestrictedInt16u); - } - - static void OnFailureCallback_436(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_436(status); - } - - static void OnSuccessCallback_436(void * context) { (static_cast(context))->OnSuccessResponse_436(); } - - static void OnFailureCallback_437(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_437(status); - } - - static void OnSuccessCallback_437(void * context, - const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) - { - (static_cast(context))->OnSuccessResponse_437(nullableRangeRestrictedInt16u); - } - - static void OnFailureCallback_438(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_438(status); - } - - static void OnSuccessCallback_438(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) - { - (static_cast(context))->OnSuccessResponse_438(nullableRangeRestrictedInt8s); - } - - static void OnFailureCallback_439(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_439(status); - } - - static void OnSuccessCallback_439(void * context) { (static_cast(context))->OnSuccessResponse_439(); } - - static void OnFailureCallback_440(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_440(status); - } - - static void OnSuccessCallback_440(void * context) { (static_cast(context))->OnSuccessResponse_440(); } - - static void OnFailureCallback_441(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_441(status); - } - - static void OnSuccessCallback_441(void * context) { (static_cast(context))->OnSuccessResponse_441(); } - - static void OnFailureCallback_442(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_442(status); - } - - static void OnSuccessCallback_442(void * context) { (static_cast(context))->OnSuccessResponse_442(); } - - static void OnFailureCallback_443(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_443(status); - } - - static void OnSuccessCallback_443(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) - { - (static_cast(context))->OnSuccessResponse_443(nullableRangeRestrictedInt8s); - } - - static void OnFailureCallback_444(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_444(status); - } - - static void OnSuccessCallback_444(void * context) { (static_cast(context))->OnSuccessResponse_444(); } - - static void OnFailureCallback_445(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_445(status); - } - - static void OnSuccessCallback_445(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) - { - (static_cast(context))->OnSuccessResponse_445(nullableRangeRestrictedInt8s); - } - - static void OnFailureCallback_446(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_446(status); - } - - static void OnSuccessCallback_446(void * context) { (static_cast(context))->OnSuccessResponse_446(); } - - static void OnFailureCallback_447(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_447(status); - } - - static void OnSuccessCallback_447(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) - { - (static_cast(context))->OnSuccessResponse_447(nullableRangeRestrictedInt8s); - } - - static void OnFailureCallback_448(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_448(status); - } - - static void OnSuccessCallback_448(void * context) { (static_cast(context))->OnSuccessResponse_448(); } - - static void OnFailureCallback_449(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_449(status); - } - - static void OnSuccessCallback_449(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) - { - (static_cast(context))->OnSuccessResponse_449(nullableRangeRestrictedInt8s); - } - - static void OnFailureCallback_450(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_450(status); - } - - static void OnSuccessCallback_450(void * context) { (static_cast(context))->OnSuccessResponse_450(); } - - static void OnFailureCallback_451(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_451(status); - } - - static void OnSuccessCallback_451(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) - { - (static_cast(context))->OnSuccessResponse_451(nullableRangeRestrictedInt8s); - } - - static void OnFailureCallback_452(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_452(status); - } - - static void OnSuccessCallback_452(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) - { - (static_cast(context))->OnSuccessResponse_452(nullableRangeRestrictedInt16s); - } - - static void OnFailureCallback_453(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_453(status); - } - - static void OnSuccessCallback_453(void * context) { (static_cast(context))->OnSuccessResponse_453(); } - - static void OnFailureCallback_454(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_454(status); - } - - static void OnSuccessCallback_454(void * context) { (static_cast(context))->OnSuccessResponse_454(); } - - static void OnFailureCallback_455(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_455(status); - } - - static void OnSuccessCallback_455(void * context) { (static_cast(context))->OnSuccessResponse_455(); } - - static void OnFailureCallback_456(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_456(status); - } - - static void OnSuccessCallback_456(void * context) { (static_cast(context))->OnSuccessResponse_456(); } - - static void OnFailureCallback_457(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_457(status); - } - - static void OnSuccessCallback_457(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) - { - (static_cast(context))->OnSuccessResponse_457(nullableRangeRestrictedInt16s); - } - - static void OnFailureCallback_458(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_458(status); - } - - static void OnSuccessCallback_458(void * context) { (static_cast(context))->OnSuccessResponse_458(); } - - static void OnFailureCallback_459(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_459(status); - } - - static void OnSuccessCallback_459(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) - { - (static_cast(context))->OnSuccessResponse_459(nullableRangeRestrictedInt16s); - } - - static void OnFailureCallback_460(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_460(status); - } - - static void OnSuccessCallback_460(void * context) { (static_cast(context))->OnSuccessResponse_460(); } - - static void OnFailureCallback_461(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_461(status); - } - - static void OnSuccessCallback_461(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) - { - (static_cast(context))->OnSuccessResponse_461(nullableRangeRestrictedInt16s); - } - - static void OnFailureCallback_462(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_462(status); - } - - static void OnSuccessCallback_462(void * context) { (static_cast(context))->OnSuccessResponse_462(); } - - static void OnFailureCallback_463(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_463(status); - } - - static void OnSuccessCallback_463(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) - { - (static_cast(context))->OnSuccessResponse_463(nullableRangeRestrictedInt16s); - } - - static void OnFailureCallback_464(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_464(status); - } - - static void OnSuccessCallback_464(void * context) { (static_cast(context))->OnSuccessResponse_464(); } - - static void OnFailureCallback_465(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_465(status); - } - - static void OnSuccessCallback_465(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) - { - (static_cast(context))->OnSuccessResponse_465(nullableRangeRestrictedInt16s); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestSendTestCommand_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::Test::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestSendTestNotHandledCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestNotHandled::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_2(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_2(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_INVALID_COMMAND)); - NextTest(); - } - - void OnSuccessResponse_2() { ThrowSuccessResponse(); } - - CHIP_ERROR TestSendTestSpecificCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestSpecific::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(data.returnValue); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(uint8_t returnValue) - { - VerifyOrReturn(CheckValue("returnValue", returnValue, 7)); - - NextTest(); - } - - CHIP_ERROR TestSendTestAddArgumentsCommand_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestAddArguments::Type; - - RequestType request; - request.arg1 = 3; - request.arg2 = 17; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(data.returnValue); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint8_t returnValue) - { - VerifyOrReturn(CheckValue("returnValue", returnValue, 20)); - - NextTest(); - } - - CHIP_ERROR TestSendFailingTestAddArgumentsCommand_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestAddArguments::Type; - - RequestType request; - request.arg1 = 250; - request.arg2 = 6; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(data.returnValue); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_5(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_INVALID_COMMAND)); - NextTest(); - } - - void OnSuccessResponse_5(uint8_t returnValue) { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeBooleanDefaultValue_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(bool boolean) - { - VerifyOrReturn(CheckValue("boolean", boolean, 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeBooleanTrue_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - bool booleanArgument; - booleanArgument = 1; - - ReturnErrorOnFailure(cluster.WriteAttribute( - booleanArgument, this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7() { NextTest(); } - - CHIP_ERROR TestReadAttributeBooleanTrue_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8(bool boolean) - { - VerifyOrReturn(CheckValue("boolean", boolean, 1)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeBooleanFalse_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - bool booleanArgument; - booleanArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - booleanArgument, this, OnSuccessCallback_9, OnFailureCallback_9)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9() { NextTest(); } - - CHIP_ERROR TestReadAttributeBooleanFalse_10() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_10, OnFailureCallback_10)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10(bool boolean) - { - VerifyOrReturn(CheckValue("boolean", boolean, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeBitmap8DefaultValue_11() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_11, OnFailureCallback_11)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_11(uint8_t bitmap8) - { - VerifyOrReturn(CheckValue("bitmap8", bitmap8, 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeBitmap8MaxValue_12() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t bitmap8Argument; - bitmap8Argument = 255; - - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap8Argument, this, OnSuccessCallback_12, OnFailureCallback_12)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_12(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_12() { NextTest(); } - - CHIP_ERROR TestReadAttributeBitmap8MaxValue_13() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_13, OnFailureCallback_13)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_13(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_13(uint8_t bitmap8) - { - VerifyOrReturn(CheckValue("bitmap8", bitmap8, 255)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeBitmap8MinValue_14() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t bitmap8Argument; - bitmap8Argument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap8Argument, this, OnSuccessCallback_14, OnFailureCallback_14)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_14(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_14() { NextTest(); } - - CHIP_ERROR TestReadAttributeBitmap8MinValue_15() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_15, OnFailureCallback_15)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_15(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_15(uint8_t bitmap8) - { - VerifyOrReturn(CheckValue("bitmap8", bitmap8, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeBitmap16DefaultValue_16() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_16, OnFailureCallback_16)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_16(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_16(uint16_t bitmap16) - { - VerifyOrReturn(CheckValue("bitmap16", bitmap16, 0U)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeBitmap16MaxValue_17() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t bitmap16Argument; - bitmap16Argument = 65535U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap16Argument, this, OnSuccessCallback_17, OnFailureCallback_17)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_17(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_17() { NextTest(); } - - CHIP_ERROR TestReadAttributeBitmap16MaxValue_18() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_18, OnFailureCallback_18)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_18(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_18(uint16_t bitmap16) - { - VerifyOrReturn(CheckValue("bitmap16", bitmap16, 65535U)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeBitmap16MinValue_19() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t bitmap16Argument; - bitmap16Argument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap16Argument, this, OnSuccessCallback_19, OnFailureCallback_19)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_19(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_19() { NextTest(); } - - CHIP_ERROR TestReadAttributeBitmap16MinValue_20() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_20, OnFailureCallback_20)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_20(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_20(uint16_t bitmap16) - { - VerifyOrReturn(CheckValue("bitmap16", bitmap16, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeBitmap32DefaultValue_21() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_21, OnFailureCallback_21)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_21(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_21(uint32_t bitmap32) - { - VerifyOrReturn(CheckValue("bitmap32", bitmap32, 0UL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeBitmap32MaxValue_22() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint32_t bitmap32Argument; - bitmap32Argument = 4294967295UL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap32Argument, this, OnSuccessCallback_22, OnFailureCallback_22)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_22(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_22() { NextTest(); } - - CHIP_ERROR TestReadAttributeBitmap32MaxValue_23() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_23, OnFailureCallback_23)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_23(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_23(uint32_t bitmap32) - { - VerifyOrReturn(CheckValue("bitmap32", bitmap32, 4294967295UL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeBitmap32MinValue_24() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint32_t bitmap32Argument; - bitmap32Argument = 0UL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap32Argument, this, OnSuccessCallback_24, OnFailureCallback_24)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_24(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_24() { NextTest(); } - - CHIP_ERROR TestReadAttributeBitmap32MinValue_25() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_25, OnFailureCallback_25)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_25(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_25(uint32_t bitmap32) - { - VerifyOrReturn(CheckValue("bitmap32", bitmap32, 0UL)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeBitmap64DefaultValue_26() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_26, OnFailureCallback_26)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_26(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_26(uint64_t bitmap64) - { - VerifyOrReturn(CheckValue("bitmap64", bitmap64, 0ULL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeBitmap64MaxValue_27() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint64_t bitmap64Argument; - bitmap64Argument = 18446744073709551615ULL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap64Argument, this, OnSuccessCallback_27, OnFailureCallback_27)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_27(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_27() { NextTest(); } - - CHIP_ERROR TestReadAttributeBitmap64MaxValue_28() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_28, OnFailureCallback_28)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_28(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_28(uint64_t bitmap64) - { - VerifyOrReturn(CheckValue("bitmap64", bitmap64, 18446744073709551615ULL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeBitmap64MinValue_29() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint64_t bitmap64Argument; - bitmap64Argument = 0ULL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap64Argument, this, OnSuccessCallback_29, OnFailureCallback_29)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_29(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_29() { NextTest(); } - - CHIP_ERROR TestReadAttributeBitmap64MinValue_30() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_30, OnFailureCallback_30)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_30(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_30(uint64_t bitmap64) - { - VerifyOrReturn(CheckValue("bitmap64", bitmap64, 0ULL)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeInt8uDefaultValue_31() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_31, OnFailureCallback_31)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_31(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_31(uint8_t int8u) - { - VerifyOrReturn(CheckValue("int8u", int8u, 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt8uMaxValue_32() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t int8uArgument; - int8uArgument = 255; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int8uArgument, this, OnSuccessCallback_32, OnFailureCallback_32)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_32(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_32() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt8uMaxValue_33() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_33, OnFailureCallback_33)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_33(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_33(uint8_t int8u) - { - VerifyOrReturn(CheckValue("int8u", int8u, 255)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt8uMinValue_34() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t int8uArgument; - int8uArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int8uArgument, this, OnSuccessCallback_34, OnFailureCallback_34)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_34(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_34() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt8uMinValue_35() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_35, OnFailureCallback_35)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_35(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_35(uint8_t int8u) - { - VerifyOrReturn(CheckValue("int8u", int8u, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeInt16uDefaultValue_36() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_36, OnFailureCallback_36)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_36(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_36(uint16_t int16u) - { - VerifyOrReturn(CheckValue("int16u", int16u, 0U)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt16uMaxValue_37() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t int16uArgument; - int16uArgument = 65535U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int16uArgument, this, OnSuccessCallback_37, OnFailureCallback_37)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_37(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_37() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt16uMaxValue_38() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_38, OnFailureCallback_38)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_38(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_38(uint16_t int16u) - { - VerifyOrReturn(CheckValue("int16u", int16u, 65535U)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt16uMinValue_39() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t int16uArgument; - int16uArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int16uArgument, this, OnSuccessCallback_39, OnFailureCallback_39)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_39(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_39() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt16uMinValue_40() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_40, OnFailureCallback_40)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_40(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_40(uint16_t int16u) - { - VerifyOrReturn(CheckValue("int16u", int16u, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeInt32uDefaultValue_41() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_41, OnFailureCallback_41)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_41(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_41(uint32_t int32u) - { - VerifyOrReturn(CheckValue("int32u", int32u, 0UL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt32uMaxValue_42() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint32_t int32uArgument; - int32uArgument = 4294967295UL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int32uArgument, this, OnSuccessCallback_42, OnFailureCallback_42)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_42(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_42() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt32uMaxValue_43() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_43, OnFailureCallback_43)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_43(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_43(uint32_t int32u) - { - VerifyOrReturn(CheckValue("int32u", int32u, 4294967295UL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt32uMinValue_44() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint32_t int32uArgument; - int32uArgument = 0UL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int32uArgument, this, OnSuccessCallback_44, OnFailureCallback_44)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_44(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_44() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt32uMinValue_45() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_45, OnFailureCallback_45)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_45(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_45(uint32_t int32u) - { - VerifyOrReturn(CheckValue("int32u", int32u, 0UL)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeInt64uDefaultValue_46() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_46, OnFailureCallback_46)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_46(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_46(uint64_t int64u) - { - VerifyOrReturn(CheckValue("int64u", int64u, 0ULL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt64uMaxValue_47() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint64_t int64uArgument; - int64uArgument = 18446744073709551615ULL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int64uArgument, this, OnSuccessCallback_47, OnFailureCallback_47)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_47(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_47() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt64uMaxValue_48() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_48, OnFailureCallback_48)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_48(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_48(uint64_t int64u) - { - VerifyOrReturn(CheckValue("int64u", int64u, 18446744073709551615ULL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt64uMinValue_49() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint64_t int64uArgument; - int64uArgument = 0ULL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int64uArgument, this, OnSuccessCallback_49, OnFailureCallback_49)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_49(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_49() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt64uMinValue_50() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_50, OnFailureCallback_50)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_50(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_50(uint64_t int64u) - { - VerifyOrReturn(CheckValue("int64u", int64u, 0ULL)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeInt8sDefaultValue_51() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_51, OnFailureCallback_51)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_51(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_51(int8_t int8s) - { - VerifyOrReturn(CheckValue("int8s", int8s, 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt8sMaxValue_52() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int8_t int8sArgument; - int8sArgument = 127; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int8sArgument, this, OnSuccessCallback_52, OnFailureCallback_52)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_52(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_52() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt8sMaxValue_53() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_53, OnFailureCallback_53)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_53(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_53(int8_t int8s) - { - VerifyOrReturn(CheckValue("int8s", int8s, 127)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt8sMinValue_54() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int8_t int8sArgument; - int8sArgument = -128; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int8sArgument, this, OnSuccessCallback_54, OnFailureCallback_54)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_54(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_54() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt8sMinValue_55() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_55, OnFailureCallback_55)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_55(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_55(int8_t int8s) - { - VerifyOrReturn(CheckValue("int8s", int8s, -128)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt8sDefaultValue_56() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int8_t int8sArgument; - int8sArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int8sArgument, this, OnSuccessCallback_56, OnFailureCallback_56)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_56(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_56() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt8sDefaultValue_57() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_57, OnFailureCallback_57)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_57(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_57(int8_t int8s) - { - VerifyOrReturn(CheckValue("int8s", int8s, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeInt16sDefaultValue_58() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_58, OnFailureCallback_58)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_58(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_58(int16_t int16s) - { - VerifyOrReturn(CheckValue("int16s", int16s, 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt16sMaxValue_59() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t int16sArgument; - int16sArgument = 32767; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int16sArgument, this, OnSuccessCallback_59, OnFailureCallback_59)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_59(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_59() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt16sMaxValue_60() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_60, OnFailureCallback_60)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_60(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_60(int16_t int16s) - { - VerifyOrReturn(CheckValue("int16s", int16s, 32767)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt16sMinValue_61() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t int16sArgument; - int16sArgument = -32768; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int16sArgument, this, OnSuccessCallback_61, OnFailureCallback_61)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_61(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_61() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt16sMinValue_62() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_62, OnFailureCallback_62)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_62(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_62(int16_t int16s) - { - VerifyOrReturn(CheckValue("int16s", int16s, -32768)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt16sDefaultValue_63() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t int16sArgument; - int16sArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int16sArgument, this, OnSuccessCallback_63, OnFailureCallback_63)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_63(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_63() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt16sDefaultValue_64() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_64, OnFailureCallback_64)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_64(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_64(int16_t int16s) - { - VerifyOrReturn(CheckValue("int16s", int16s, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeInt32sDefaultValue_65() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_65, OnFailureCallback_65)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_65(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_65(int32_t int32s) - { - VerifyOrReturn(CheckValue("int32s", int32s, 0L)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt32sMaxValue_66() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int32_t int32sArgument; - int32sArgument = 2147483647L; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int32sArgument, this, OnSuccessCallback_66, OnFailureCallback_66)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_66(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_66() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt32sMaxValue_67() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_67, OnFailureCallback_67)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_67(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_67(int32_t int32s) - { - VerifyOrReturn(CheckValue("int32s", int32s, 2147483647L)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt32sMinValue_68() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int32_t int32sArgument; - int32sArgument = -2147483648L; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int32sArgument, this, OnSuccessCallback_68, OnFailureCallback_68)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_68(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_68() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt32sMinValue_69() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_69, OnFailureCallback_69)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_69(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_69(int32_t int32s) - { - VerifyOrReturn(CheckValue("int32s", int32s, -2147483648L)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt32sDefaultValue_70() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int32_t int32sArgument; - int32sArgument = 0L; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int32sArgument, this, OnSuccessCallback_70, OnFailureCallback_70)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_70(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_70() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt32sDefaultValue_71() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_71, OnFailureCallback_71)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_71(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_71(int32_t int32s) - { - VerifyOrReturn(CheckValue("int32s", int32s, 0L)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeInt64sDefaultValue_72() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_72, OnFailureCallback_72)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_72(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_72(int64_t int64s) - { - VerifyOrReturn(CheckValue("int64s", int64s, 0LL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt64sMaxValue_73() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int64_t int64sArgument; - int64sArgument = 9223372036854775807LL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int64sArgument, this, OnSuccessCallback_73, OnFailureCallback_73)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_73(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_73() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt64sMaxValue_74() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_74, OnFailureCallback_74)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_74(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_74(int64_t int64s) - { - VerifyOrReturn(CheckValue("int64s", int64s, 9223372036854775807LL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt64sMinValue_75() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int64_t int64sArgument; - int64sArgument = -9223372036854775807LL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int64sArgument, this, OnSuccessCallback_75, OnFailureCallback_75)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_75(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_75() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt64sMinValue_76() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_76, OnFailureCallback_76)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_76(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_76(int64_t int64s) - { - VerifyOrReturn(CheckValue("int64s", int64s, -9223372036854775807LL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt64sDefaultValue_77() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int64_t int64sArgument; - int64sArgument = 0LL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int64sArgument, this, OnSuccessCallback_77, OnFailureCallback_77)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_77(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_77() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt64sDefaultValue_78() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_78, OnFailureCallback_78)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_78(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_78(int64_t int64s) - { - VerifyOrReturn(CheckValue("int64s", int64s, 0LL)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeSingleDefaultValue_79() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_79, OnFailureCallback_79)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_79(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_79(float floatSingle) - { - VerifyOrReturn(CheckValue("floatSingle", floatSingle, 0.0f)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeSingleMediumValue_80() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - float floatSingleArgument; - floatSingleArgument = 0.1f; - - ReturnErrorOnFailure(cluster.WriteAttribute( - floatSingleArgument, this, OnSuccessCallback_80, OnFailureCallback_80)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_80(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_80() { NextTest(); } - - CHIP_ERROR TestReadAttributeSingleMediumValue_81() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_81, OnFailureCallback_81)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_81(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_81(float floatSingle) - { - VerifyOrReturn(CheckValue("floatSingle", floatSingle, 0.1f)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeSingleLargeValue_82() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - float floatSingleArgument; - floatSingleArgument = 17000000000.0f; - - ReturnErrorOnFailure(cluster.WriteAttribute( - floatSingleArgument, this, OnSuccessCallback_82, OnFailureCallback_82)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_82(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_82() { NextTest(); } - - CHIP_ERROR TestReadAttributeSingleLargeValue_83() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_83, OnFailureCallback_83)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_83(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_83(float floatSingle) - { - VerifyOrReturn(CheckValue("floatSingle", floatSingle, 17000000000.0f)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeSingleSmallValue_84() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - float floatSingleArgument; - floatSingleArgument = 1.7e-10f; - - ReturnErrorOnFailure(cluster.WriteAttribute( - floatSingleArgument, this, OnSuccessCallback_84, OnFailureCallback_84)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_84(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_84() { NextTest(); } - - CHIP_ERROR TestReadAttributeSingleSmallValue_85() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_85, OnFailureCallback_85)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_85(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_85(float floatSingle) - { - VerifyOrReturn(CheckValue("floatSingle", floatSingle, 1.7e-10f)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeSingleDefaultValue_86() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - float floatSingleArgument; - floatSingleArgument = 0.0f; - - ReturnErrorOnFailure(cluster.WriteAttribute( - floatSingleArgument, this, OnSuccessCallback_86, OnFailureCallback_86)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_86(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_86() { NextTest(); } - - CHIP_ERROR TestReadAttributeSingleDefaultValue_87() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_87, OnFailureCallback_87)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_87(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_87(float floatSingle) - { - VerifyOrReturn(CheckValue("floatSingle", floatSingle, 0.0f)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeDoubleDefaultValue_88() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_88, OnFailureCallback_88)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_88(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_88(double floatDouble) - { - VerifyOrReturn(CheckValue("floatDouble", floatDouble, 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeDoubleMediumValue_89() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - double floatDoubleArgument; - floatDoubleArgument = 0.1234567890123; - - ReturnErrorOnFailure(cluster.WriteAttribute( - floatDoubleArgument, this, OnSuccessCallback_89, OnFailureCallback_89)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_89(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_89() { NextTest(); } - - CHIP_ERROR TestReadAttributeDoubleMediumValue_90() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_90, OnFailureCallback_90)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_90(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_90(double floatDouble) - { - VerifyOrReturn(CheckValue("floatDouble", floatDouble, 0.1234567890123)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeDoubleLargeValue_91() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - double floatDoubleArgument; - floatDoubleArgument = 1.7e+200; - - ReturnErrorOnFailure(cluster.WriteAttribute( - floatDoubleArgument, this, OnSuccessCallback_91, OnFailureCallback_91)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_91(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_91() { NextTest(); } - - CHIP_ERROR TestReadAttributeDoubleLargeValue_92() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_92, OnFailureCallback_92)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_92(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_92(double floatDouble) - { - VerifyOrReturn(CheckValue("floatDouble", floatDouble, 1.7e+200)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeDoubleSmallValue_93() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - double floatDoubleArgument; - floatDoubleArgument = 1.7e-200; - - ReturnErrorOnFailure(cluster.WriteAttribute( - floatDoubleArgument, this, OnSuccessCallback_93, OnFailureCallback_93)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_93(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_93() { NextTest(); } - - CHIP_ERROR TestReadAttributeDoubleSmallValue_94() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_94, OnFailureCallback_94)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_94(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_94(double floatDouble) - { - VerifyOrReturn(CheckValue("floatDouble", floatDouble, 1.7e-200)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeDoubleDefaultValue_95() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - double floatDoubleArgument; - floatDoubleArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - floatDoubleArgument, this, OnSuccessCallback_95, OnFailureCallback_95)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_95(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_95() { NextTest(); } - - CHIP_ERROR TestReadAttributeDoubleDefaultValue_96() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_96, OnFailureCallback_96)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_96(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_96(double floatDouble) - { - VerifyOrReturn(CheckValue("floatDouble", floatDouble, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeEnum8DefaultValue_97() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_97, OnFailureCallback_97)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_97(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_97(uint8_t enum8) - { - VerifyOrReturn(CheckValue("enum8", enum8, 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeEnum8MaxValue_98() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t enum8Argument; - enum8Argument = 255; - - ReturnErrorOnFailure(cluster.WriteAttribute( - enum8Argument, this, OnSuccessCallback_98, OnFailureCallback_98)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_98(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_98() { NextTest(); } - - CHIP_ERROR TestReadAttributeEnum8MaxValue_99() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_99, OnFailureCallback_99)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_99(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_99(uint8_t enum8) - { - VerifyOrReturn(CheckValue("enum8", enum8, 255)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeEnum8MinValue_100() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t enum8Argument; - enum8Argument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - enum8Argument, this, OnSuccessCallback_100, OnFailureCallback_100)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_100(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_100() { NextTest(); } - - CHIP_ERROR TestReadAttributeEnum8MinValue_101() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_101, OnFailureCallback_101)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_101(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_101(uint8_t enum8) - { - VerifyOrReturn(CheckValue("enum8", enum8, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeEnum16DefaultValue_102() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_102, OnFailureCallback_102)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_102(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_102(uint16_t enum16) - { - VerifyOrReturn(CheckValue("enum16", enum16, 0U)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeEnum16MaxValue_103() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t enum16Argument; - enum16Argument = 65535U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - enum16Argument, this, OnSuccessCallback_103, OnFailureCallback_103)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_103(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_103() { NextTest(); } - - CHIP_ERROR TestReadAttributeEnum16MaxValue_104() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_104, OnFailureCallback_104)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_104(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_104(uint16_t enum16) - { - VerifyOrReturn(CheckValue("enum16", enum16, 65535U)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeEnum16MinValue_105() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t enum16Argument; - enum16Argument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - enum16Argument, this, OnSuccessCallback_105, OnFailureCallback_105)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_105(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_105() { NextTest(); } - - CHIP_ERROR TestReadAttributeEnum16MinValue_106() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_106, OnFailureCallback_106)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_106(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_106(uint16_t enum16) - { - VerifyOrReturn(CheckValue("enum16", enum16, 0U)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeOctetStringDefaultValue_107() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_107, OnFailureCallback_107)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_107(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_107(chip::ByteSpan octetString) - { - VerifyOrReturn(CheckValueAsString("octetString", octetString, chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeOctetStringWithEmbeddedNull_108() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::ByteSpan octetStringArgument; - octetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char("Tes\x00ti\x00nggarbage: not in length on purpose"), 9); - - ReturnErrorOnFailure(cluster.WriteAttribute( - octetStringArgument, this, OnSuccessCallback_108, OnFailureCallback_108)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_108(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_108() { NextTest(); } - - CHIP_ERROR TestReadAttributeOctetStringWithEmbeddedNull_109() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_109, OnFailureCallback_109)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_109(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_109(chip::ByteSpan octetString) - { - VerifyOrReturn( - CheckValueAsString("octetString", octetString, chip::ByteSpan(chip::Uint8::from_const_char("Tes\x00ti\x00ng"), 9))); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeOctetString_110() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::ByteSpan octetStringArgument; - octetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char("TestValuegarbage: not in length on purpose"), 9); - - ReturnErrorOnFailure(cluster.WriteAttribute( - octetStringArgument, this, OnSuccessCallback_110, OnFailureCallback_110)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_110(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_110() { NextTest(); } - - CHIP_ERROR TestReadAttributeOctetString_111() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_111, OnFailureCallback_111)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_111(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_111(chip::ByteSpan octetString) - { - VerifyOrReturn( - CheckValueAsString("octetString", octetString, chip::ByteSpan(chip::Uint8::from_const_char("TestValue"), 9))); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeOctetString_112() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::ByteSpan octetStringArgument; - octetStringArgument = - chip::ByteSpan(chip::Uint8::from_const_char("TestValueLongerThan10garbage: not in length on purpose"), 21); - - ReturnErrorOnFailure(cluster.WriteAttribute( - octetStringArgument, this, OnSuccessCallback_112, OnFailureCallback_112)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_112(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_112() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeOctetString_113() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_113, OnFailureCallback_113)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_113(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_113(chip::ByteSpan octetString) - { - VerifyOrReturn( - CheckValueAsString("octetString", octetString, chip::ByteSpan(chip::Uint8::from_const_char("TestValue"), 9))); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeOctetString_114() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::ByteSpan octetStringArgument; - octetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char("garbage: not in length on purpose"), 0); - - ReturnErrorOnFailure(cluster.WriteAttribute( - octetStringArgument, this, OnSuccessCallback_114, OnFailureCallback_114)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_114(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_114() { NextTest(); } - - CHIP_ERROR TestReadAttributeLongOctetStringDefaultValue_115() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_115, OnFailureCallback_115)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_115(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_115(chip::ByteSpan longOctetString) - { - VerifyOrReturn(CheckValueAsString("longOctetString", longOctetString, chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeLongOctetString_116() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::ByteSpan longOctetStringArgument; - longOctetStringArgument = chip::ByteSpan( - chip::Uint8::from_const_char( - "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "111111111111111111111111111111111111111111111111111111111111111111111111garbage: not in length on purpose"), - 300); - - ReturnErrorOnFailure(cluster.WriteAttribute( - longOctetStringArgument, this, OnSuccessCallback_116, OnFailureCallback_116)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_116(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_116() { NextTest(); } - - CHIP_ERROR TestReadAttributeLongOctetString_117() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_117, OnFailureCallback_117)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_117(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_117(chip::ByteSpan longOctetString) - { - VerifyOrReturn(CheckValueAsString( - "longOctetString", longOctetString, - chip::ByteSpan( - chip::Uint8::from_const_char( - "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "11111111111111111111111111111111111111111111111111111111111111111111111111111111"), - 300))); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeLongOctetString_118() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::ByteSpan longOctetStringArgument; - longOctetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char("garbage: not in length on purpose"), 0); - - ReturnErrorOnFailure(cluster.WriteAttribute( - longOctetStringArgument, this, OnSuccessCallback_118, OnFailureCallback_118)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_118(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_118() { NextTest(); } - - CHIP_ERROR TestReadAttributeCharStringDefaultValue_119() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_119, OnFailureCallback_119)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_119(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_119(chip::CharSpan charString) - { - VerifyOrReturn(CheckValueAsString("charString", charString, chip::CharSpan("", 0))); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeCharString_120() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::CharSpan charStringArgument; - charStringArgument = chip::Span("☉T☉garbage: not in length on purpose", 7); - - ReturnErrorOnFailure(cluster.WriteAttribute( - charStringArgument, this, OnSuccessCallback_120, OnFailureCallback_120)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_120(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_120() { NextTest(); } - - CHIP_ERROR TestReadAttributeCharString_121() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_121, OnFailureCallback_121)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_121(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_121(chip::CharSpan charString) - { - VerifyOrReturn(CheckValueAsString("charString", charString, chip::CharSpan("☉T☉", 7))); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeCharStringValueTooLong_122() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::CharSpan charStringArgument; - charStringArgument = chip::Span("☉TestValueLongerThan10☉garbage: not in length on purpose", 27); - - ReturnErrorOnFailure(cluster.WriteAttribute( - charStringArgument, this, OnSuccessCallback_122, OnFailureCallback_122)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_122(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_122() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeCharString_123() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_123, OnFailureCallback_123)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_123(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_123(chip::CharSpan charString) - { - VerifyOrReturn(CheckValueAsString("charString", charString, chip::CharSpan("☉T☉", 7))); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeCharStringEmpty_124() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::CharSpan charStringArgument; - charStringArgument = chip::Span("garbage: not in length on purpose", 0); - - ReturnErrorOnFailure(cluster.WriteAttribute( - charStringArgument, this, OnSuccessCallback_124, OnFailureCallback_124)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_124(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_124() { NextTest(); } - - CHIP_ERROR TestReadAttributeLongCharStringDefaultValue_125() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_125, OnFailureCallback_125)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_125(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_125(chip::CharSpan longCharString) - { - VerifyOrReturn(CheckValueAsString("longCharString", longCharString, chip::CharSpan("", 0))); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeLongCharString_126() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::CharSpan longCharStringArgument; - longCharStringArgument = chip::Span( - "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉garbage: not in length on purpose", - 900); - - ReturnErrorOnFailure(cluster.WriteAttribute( - longCharStringArgument, this, OnSuccessCallback_126, OnFailureCallback_126)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_126(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_126() { NextTest(); } - - CHIP_ERROR TestReadAttributeLongCharString_127() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_127, OnFailureCallback_127)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_127(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_127(chip::CharSpan longCharString) - { - VerifyOrReturn(CheckValueAsString( - "longCharString", longCharString, - chip::CharSpan("☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉", - 900))); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeLongCharString_128() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::CharSpan longCharStringArgument; - longCharStringArgument = chip::Span("garbage: not in length on purpose", 0); - - ReturnErrorOnFailure(cluster.WriteAttribute( - longCharStringArgument, this, OnSuccessCallback_128, OnFailureCallback_128)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_128(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_128() { NextTest(); } - - CHIP_ERROR TestReadAttributeListLongOctetString_129() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_129, OnFailureCallback_129)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_129(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_129(const chip::app::DataModel::DecodableList & listLongOctetString) - { - auto iter = listLongOctetString.begin(); - VerifyOrReturn(CheckNextListItemDecodes("listLongOctetString", iter, 0)); - VerifyOrReturn(CheckValueAsString( - "listLongOctetString[0]", iter.GetValue(), - chip::ByteSpan( - chip::Uint8::from_const_char( - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" - "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" - "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"), - 512))); - VerifyOrReturn(CheckNextListItemDecodes("listLongOctetString", iter, 1)); - VerifyOrReturn(CheckValueAsString( - "listLongOctetString[1]", iter.GetValue(), - chip::ByteSpan( - chip::Uint8::from_const_char( - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" - "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" - "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"), - 512))); - VerifyOrReturn(CheckNextListItemDecodes("listLongOctetString", iter, 2)); - VerifyOrReturn(CheckValueAsString( - "listLongOctetString[2]", iter.GetValue(), - chip::ByteSpan( - chip::Uint8::from_const_char( - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" - "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" - "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"), - 512))); - VerifyOrReturn(CheckNextListItemDecodes("listLongOctetString", iter, 3)); - VerifyOrReturn(CheckValueAsString( - "listLongOctetString[3]", iter.GetValue(), - chip::ByteSpan( - chip::Uint8::from_const_char( - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" - "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" - "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"), - 512))); - VerifyOrReturn(CheckNoMoreListItems("listLongOctetString", iter, 4)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeEpochUsDefaultValue_130() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_130, OnFailureCallback_130)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_130(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_130(uint64_t epochUs) - { - VerifyOrReturn(CheckValue("epochUs", epochUs, 0ULL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeEpochUsMaxValue_131() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint64_t epochUsArgument; - epochUsArgument = 18446744073709551615ULL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - epochUsArgument, this, OnSuccessCallback_131, OnFailureCallback_131)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_131(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_131() { NextTest(); } - - CHIP_ERROR TestReadAttributeEpochUsMaxValue_132() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_132, OnFailureCallback_132)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_132(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_132(uint64_t epochUs) - { - VerifyOrReturn(CheckValue("epochUs", epochUs, 18446744073709551615ULL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeEpochUsMinValue_133() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint64_t epochUsArgument; - epochUsArgument = 0ULL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - epochUsArgument, this, OnSuccessCallback_133, OnFailureCallback_133)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_133(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_133() { NextTest(); } - - CHIP_ERROR TestReadAttributeEpochUsMinValue_134() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_134, OnFailureCallback_134)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_134(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_134(uint64_t epochUs) - { - VerifyOrReturn(CheckValue("epochUs", epochUs, 0ULL)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeEpochSDefaultValue_135() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_135, OnFailureCallback_135)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_135(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_135(uint32_t epochS) - { - VerifyOrReturn(CheckValue("epochS", epochS, 0UL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeEpochSMaxValue_136() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint32_t epochSArgument; - epochSArgument = 4294967295UL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - epochSArgument, this, OnSuccessCallback_136, OnFailureCallback_136)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_136(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_136() { NextTest(); } - - CHIP_ERROR TestReadAttributeEpochSMaxValue_137() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_137, OnFailureCallback_137)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_137(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_137(uint32_t epochS) - { - VerifyOrReturn(CheckValue("epochS", epochS, 4294967295UL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeEpochSMinValue_138() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint32_t epochSArgument; - epochSArgument = 0UL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - epochSArgument, this, OnSuccessCallback_138, OnFailureCallback_138)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_138(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_138() { NextTest(); } - - CHIP_ERROR TestReadAttributeEpochSMinValue_139() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_139, OnFailureCallback_139)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_139(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_139(uint32_t epochS) - { - VerifyOrReturn(CheckValue("epochS", epochS, 0UL)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeUnsupported_140() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_140, OnFailureCallback_140)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_140(EmberAfStatus status) - { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); - } - - void OnSuccessResponse_140(bool unsupported) - { - VerifyOrReturn(CheckValue("unsupported", unsupported, 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteattributeUnsupported_141() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - bool unsupportedArgument; - unsupportedArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - unsupportedArgument, this, OnSuccessCallback_141, OnFailureCallback_141)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_141(EmberAfStatus status) - { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); - } - - void OnSuccessResponse_141() { NextTest(); } - - CHIP_ERROR TestSendTestCommandToUnsupportedEndpoint_142() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 200; - using RequestType = chip::app::Clusters::TestCluster::Commands::Test::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_142(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_142(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_142(EmberAfStatus status) - { - VerifyOrReturn(CheckConstraintNotValue("status", status, 0)); - NextTest(); - } - - void OnSuccessResponse_142() { ThrowSuccessResponse(); } - - CHIP_ERROR TestSendTestCommandToUnsupportedCluster_143() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - using RequestType = chip::app::Clusters::TestCluster::Commands::Test::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_143(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_143(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_143(EmberAfStatus status) - { - VerifyOrReturn(CheckConstraintNotValue("status", status, 0)); - NextTest(); - } - - void OnSuccessResponse_143() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeVendorIdDefaultValue_144() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_144, OnFailureCallback_144)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_144(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_144(chip::VendorId vendorId) - { - VerifyOrReturn(CheckValue("vendorId", vendorId, 0U)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeVendorId_145() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::VendorId vendorIdArgument; - vendorIdArgument = static_cast(17); - - ReturnErrorOnFailure(cluster.WriteAttribute( - vendorIdArgument, this, OnSuccessCallback_145, OnFailureCallback_145)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_145(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_145() { NextTest(); } - - CHIP_ERROR TestReadAttributeVendorId_146() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_146, OnFailureCallback_146)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_146(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_146(chip::VendorId vendorId) - { - VerifyOrReturn(CheckValue("vendorId", vendorId, 17U)); - - NextTest(); - } - - CHIP_ERROR TestRestoreAttributeVendorId_147() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::VendorId vendorIdArgument; - vendorIdArgument = static_cast(0); - - ReturnErrorOnFailure(cluster.WriteAttribute( - vendorIdArgument, this, OnSuccessCallback_147, OnFailureCallback_147)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_147(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_147() { NextTest(); } - - CHIP_ERROR TestSendACommandWithAVendorIdAndEnum_148() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestEnumsRequest::Type; - - RequestType request; - request.arg1 = static_cast(20003); - request.arg2 = static_cast(101); - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_148(data.arg1, data.arg2); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_148(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_148(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_148(chip::VendorId arg1, chip::app::Clusters::TestCluster::SimpleEnum arg2) - { - VerifyOrReturn(CheckValue("arg1", arg1, 20003U)); - - VerifyOrReturn(CheckValue("arg2", arg2, 101)); - - NextTest(); - } - - CHIP_ERROR TestSendTestCommandWithStructArgumentAndArg1bIsTrue_149() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestStructArgumentRequest::Type; - - RequestType request; - - request.arg1.a = 0; - request.arg1.b = true; - request.arg1.c = static_cast(2); - request.arg1.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); - request.arg1.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - request.arg1.f = static_cast>(1); - request.arg1.g = 0.0f; - request.arg1.h = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_149(data.value); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_149(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_149(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_149(bool value) - { - VerifyOrReturn(CheckValue("value", value, true)); - - NextTest(); - } - - CHIP_ERROR TestSendTestCommandWithStructArgumentAndArg1bIsFalse_150() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestStructArgumentRequest::Type; - - RequestType request; - - request.arg1.a = 0; - request.arg1.b = false; - request.arg1.c = static_cast(2); - request.arg1.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); - request.arg1.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - request.arg1.f = static_cast>(1); - request.arg1.g = 0.0f; - request.arg1.h = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_150(data.value); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_150(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_150(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_150(bool value) - { - VerifyOrReturn(CheckValue("value", value, false)); - - NextTest(); - } - - CHIP_ERROR TestSendTestCommandWithNestedStructArgumentAndArg1cbIsTrue_151() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestNestedStructArgumentRequest::Type; - - RequestType request; - - request.arg1.a = 0; - request.arg1.b = true; - - request.arg1.c.a = 0; - request.arg1.c.b = true; - request.arg1.c.c = static_cast(2); - request.arg1.c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); - request.arg1.c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - request.arg1.c.f = static_cast>(1); - request.arg1.c.g = 0.0f; - request.arg1.c.h = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_151(data.value); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_151(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_151(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_151(bool value) - { - VerifyOrReturn(CheckValue("value", value, true)); - - NextTest(); - } - - CHIP_ERROR TestSendTestCommandWithNestedStructArgumentArg1cbIsFalse_152() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestNestedStructArgumentRequest::Type; - - RequestType request; - - request.arg1.a = 0; - request.arg1.b = true; - - request.arg1.c.a = 0; - request.arg1.c.b = false; - request.arg1.c.c = static_cast(2); - request.arg1.c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); - request.arg1.c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - request.arg1.c.f = static_cast>(1); - request.arg1.c.g = 0.0f; - request.arg1.c.h = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_152(data.value); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_152(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_152(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_152(bool value) - { - VerifyOrReturn(CheckValue("value", value, false)); - - NextTest(); - } - - CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndAllFieldsBOfArg1dAreTrue_153() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestNestedStructListArgumentRequest::Type; - - RequestType request; - - request.arg1.a = 0; - request.arg1.b = true; - - request.arg1.c.a = 0; - request.arg1.c.b = true; - request.arg1.c.c = static_cast(2); - request.arg1.c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); - request.arg1.c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - request.arg1.c.f = static_cast>(1); - request.arg1.c.g = 0.0f; - request.arg1.c.h = 0; - - chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type dList[2]; - - dList[0].a = 1; - dList[0].b = true; - dList[0].c = static_cast(3); - dList[0].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); - dList[0].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - dList[0].f = static_cast>(1); - dList[0].g = 0.0f; - dList[0].h = 0; - - dList[1].a = 2; - dList[1].b = true; - dList[1].c = static_cast(3); - dList[1].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); - dList[1].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - dList[1].f = static_cast>(1); - dList[1].g = 0.0f; - dList[1].h = 0; - - request.arg1.d = dList; - - uint32_t eList[3]; - eList[0] = 1UL; - eList[1] = 2UL; - eList[2] = 3UL; - request.arg1.e = eList; - - chip::ByteSpan fList[3]; - fList[0] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_1garbage: not in length on purpose"), 14); - fList[1] = chip::ByteSpan(chip::Uint8::from_const_char("octect_string_2garbage: not in length on purpose"), 15); - fList[2] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_3garbage: not in length on purpose"), 14); - request.arg1.f = fList; - - uint8_t gList[2]; - gList[0] = 0; - gList[1] = 255; - request.arg1.g = gList; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_153(data.value); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_153(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_153(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_153(bool value) - { - VerifyOrReturn(CheckValue("value", value, true)); - - NextTest(); - } - - CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfArg1dAreFalse_154() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestNestedStructListArgumentRequest::Type; - - RequestType request; - - request.arg1.a = 0; - request.arg1.b = true; - - request.arg1.c.a = 0; - request.arg1.c.b = true; - request.arg1.c.c = static_cast(2); - request.arg1.c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); - request.arg1.c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - request.arg1.c.f = static_cast>(1); - request.arg1.c.g = 0.0f; - request.arg1.c.h = 0; - - chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type dList[2]; - - dList[0].a = 1; - dList[0].b = true; - dList[0].c = static_cast(3); - dList[0].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); - dList[0].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - dList[0].f = static_cast>(1); - dList[0].g = 0.0f; - dList[0].h = 0; - - dList[1].a = 2; - dList[1].b = false; - dList[1].c = static_cast(3); - dList[1].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); - dList[1].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - dList[1].f = static_cast>(1); - dList[1].g = 0.0f; - dList[1].h = 0; - - request.arg1.d = dList; - - uint32_t eList[3]; - eList[0] = 1UL; - eList[1] = 2UL; - eList[2] = 3UL; - request.arg1.e = eList; - - chip::ByteSpan fList[3]; - fList[0] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_1garbage: not in length on purpose"), 14); - fList[1] = chip::ByteSpan(chip::Uint8::from_const_char("octect_string_2garbage: not in length on purpose"), 15); - fList[2] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_3garbage: not in length on purpose"), 14); - request.arg1.f = fList; - - uint8_t gList[2]; - gList[0] = 0; - gList[1] = 255; - request.arg1.g = gList; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_154(data.value); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_154(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_154(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_154(bool value) - { - VerifyOrReturn(CheckValue("value", value, false)); - - NextTest(); - } - - CHIP_ERROR TestSendTestCommandWithStructArgumentAndSeeWhatWeGetBack_155() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::SimpleStructEchoRequest::Type; - - RequestType request; - - request.arg1.a = 17; - request.arg1.b = false; - request.arg1.c = static_cast(2); - request.arg1.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); - request.arg1.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - request.arg1.f = static_cast>(1); - request.arg1.g = 0.1f; - request.arg1.h = 0.1; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_155(data.arg1); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_155(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_155(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_155(const chip::app::Clusters::TestCluster::Structs::SimpleStruct::DecodableType & arg1) - { - VerifyOrReturn(CheckValue("arg1.a", arg1.a, 17)); - VerifyOrReturn(CheckValue("arg1.b", arg1.b, false)); - VerifyOrReturn(CheckValue("arg1.c", arg1.c, 2)); - VerifyOrReturn(CheckValueAsString("arg1.d", arg1.d, chip::ByteSpan(chip::Uint8::from_const_char("octet_string"), 12))); - VerifyOrReturn(CheckValueAsString("arg1.e", arg1.e, chip::CharSpan("char_string", 11))); - VerifyOrReturn(CheckValue("arg1.f", arg1.f, 1)); - VerifyOrReturn(CheckValue("arg1.g", arg1.g, 0.1f)); - VerifyOrReturn(CheckValue("arg1.h", arg1.h, 0.1)); - - NextTest(); - } - - CHIP_ERROR TestSendTestCommandWithListOfInt8uAndNoneOfThemIsSetTo0_156() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestListInt8UArgumentRequest::Type; - - RequestType request; - - uint8_t arg1List[9]; - arg1List[0] = 1; - arg1List[1] = 2; - arg1List[2] = 3; - arg1List[3] = 4; - arg1List[4] = 5; - arg1List[5] = 6; - arg1List[6] = 7; - arg1List[7] = 8; - arg1List[8] = 9; - request.arg1 = arg1List; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_156(data.value); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_156(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_156(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_156(bool value) - { - VerifyOrReturn(CheckValue("value", value, true)); - - NextTest(); - } - - CHIP_ERROR TestSendTestCommandWithListOfInt8uAndOneOfThemIsSetTo0_157() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestListInt8UArgumentRequest::Type; - - RequestType request; - - uint8_t arg1List[10]; - arg1List[0] = 1; - arg1List[1] = 2; - arg1List[2] = 3; - arg1List[3] = 4; - arg1List[4] = 5; - arg1List[5] = 6; - arg1List[6] = 7; - arg1List[7] = 8; - arg1List[8] = 9; - arg1List[9] = 0; - request.arg1 = arg1List; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_157(data.value); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_157(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_157(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_157(bool value) - { - VerifyOrReturn(CheckValue("value", value, false)); - - NextTest(); - } - - CHIP_ERROR TestSendTestCommandWithListOfInt8uAndGetItReversed_158() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestListInt8UReverseRequest::Type; - - RequestType request; - - uint8_t arg1List[9]; - arg1List[0] = 1; - arg1List[1] = 2; - arg1List[2] = 3; - arg1List[3] = 4; - arg1List[4] = 5; - arg1List[5] = 6; - arg1List[6] = 7; - arg1List[7] = 8; - arg1List[8] = 9; - request.arg1 = arg1List; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_158(data.arg1); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_158(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_158(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_158(const chip::app::DataModel::DecodableList & arg1) - { - auto iter = arg1.begin(); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 0)); - VerifyOrReturn(CheckValue("arg1[0]", iter.GetValue(), 9)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 1)); - VerifyOrReturn(CheckValue("arg1[1]", iter.GetValue(), 8)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 2)); - VerifyOrReturn(CheckValue("arg1[2]", iter.GetValue(), 7)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 3)); - VerifyOrReturn(CheckValue("arg1[3]", iter.GetValue(), 6)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 4)); - VerifyOrReturn(CheckValue("arg1[4]", iter.GetValue(), 5)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 5)); - VerifyOrReturn(CheckValue("arg1[5]", iter.GetValue(), 4)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 6)); - VerifyOrReturn(CheckValue("arg1[6]", iter.GetValue(), 3)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 7)); - VerifyOrReturn(CheckValue("arg1[7]", iter.GetValue(), 2)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 8)); - VerifyOrReturn(CheckValue("arg1[8]", iter.GetValue(), 1)); - VerifyOrReturn(CheckNoMoreListItems("arg1", iter, 9)); - - NextTest(); - } - - CHIP_ERROR TestSendTestCommandWithEmptyListOfInt8uAndGetAnEmptyListBack_159() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestListInt8UReverseRequest::Type; - - RequestType request; - - request.arg1 = chip::app::DataModel::List(); - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_159(data.arg1); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_159(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_159(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_159(const chip::app::DataModel::DecodableList & arg1) - { - auto iter = arg1.begin(); - VerifyOrReturn(CheckNoMoreListItems("arg1", iter, 0)); - - NextTest(); - } - - CHIP_ERROR TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsTrue_160() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestListStructArgumentRequest::Type; - - RequestType request; - - chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type arg1List[2]; - - arg1List[0].a = 0; - arg1List[0].b = true; - arg1List[0].c = static_cast(2); - arg1List[0].d = chip::ByteSpan(chip::Uint8::from_const_char("first_octet_stringgarbage: not in length on purpose"), 18); - arg1List[0].e = chip::Span("first_char_stringgarbage: not in length on purpose", 17); - arg1List[0].f = static_cast>(1); - arg1List[0].g = 0.0f; - arg1List[0].h = 0; - - arg1List[1].a = 1; - arg1List[1].b = true; - arg1List[1].c = static_cast(3); - arg1List[1].d = chip::ByteSpan(chip::Uint8::from_const_char("second_octet_stringgarbage: not in length on purpose"), 19); - arg1List[1].e = chip::Span("second_char_stringgarbage: not in length on purpose", 18); - arg1List[1].f = static_cast>(1); - arg1List[1].g = 0.0f; - arg1List[1].h = 0; - - request.arg1 = arg1List; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_160(data.value); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_160(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_160(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_160(bool value) - { - VerifyOrReturn(CheckValue("value", value, true)); - - NextTest(); - } - - CHIP_ERROR TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsFalse_161() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestListStructArgumentRequest::Type; - - RequestType request; - - chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type arg1List[2]; - - arg1List[0].a = 1; - arg1List[0].b = true; - arg1List[0].c = static_cast(3); - arg1List[0].d = chip::ByteSpan(chip::Uint8::from_const_char("second_octet_stringgarbage: not in length on purpose"), 19); - arg1List[0].e = chip::Span("second_char_stringgarbage: not in length on purpose", 18); - arg1List[0].f = static_cast>(1); - arg1List[0].g = 0.0f; - arg1List[0].h = 0; - - arg1List[1].a = 0; - arg1List[1].b = false; - arg1List[1].c = static_cast(2); - arg1List[1].d = chip::ByteSpan(chip::Uint8::from_const_char("first_octet_stringgarbage: not in length on purpose"), 18); - arg1List[1].e = chip::Span("first_char_stringgarbage: not in length on purpose", 17); - arg1List[1].f = static_cast>(1); - arg1List[1].g = 0.0f; - arg1List[1].h = 0; - - request.arg1 = arg1List; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_161(data.value); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_161(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_161(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_161(bool value) - { - VerifyOrReturn(CheckValue("value", value, false)); - - NextTest(); - } - - CHIP_ERROR TestSendTestCommandWithListOfNestedStructListArgumentAndAllFieldsBOfElementsOfArg1dAreTrue_162() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestListNestedStructListArgumentRequest::Type; - - RequestType request; - - chip::app::Clusters::TestCluster::Structs::NestedStructList::Type arg1List[1]; - - arg1List[0].a = 0; - arg1List[0].b = true; - - arg1List[0].c.a = 0; - arg1List[0].c.b = true; - arg1List[0].c.c = static_cast(2); - arg1List[0].c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); - arg1List[0].c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - arg1List[0].c.f = static_cast>(1); - arg1List[0].c.g = 0.0f; - arg1List[0].c.h = 0; - - chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type dList[2]; - - dList[0].a = 1; - dList[0].b = true; - dList[0].c = static_cast(3); - dList[0].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); - dList[0].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - dList[0].f = static_cast>(1); - dList[0].g = 0.0f; - dList[0].h = 0; - - dList[1].a = 2; - dList[1].b = true; - dList[1].c = static_cast(3); - dList[1].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); - dList[1].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - dList[1].f = static_cast>(1); - dList[1].g = 0.0f; - dList[1].h = 0; - - arg1List[0].d = dList; - - uint32_t eList[3]; - eList[0] = 1UL; - eList[1] = 2UL; - eList[2] = 3UL; - arg1List[0].e = eList; - - chip::ByteSpan fList[3]; - fList[0] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_1garbage: not in length on purpose"), 14); - fList[1] = chip::ByteSpan(chip::Uint8::from_const_char("octect_string_2garbage: not in length on purpose"), 15); - fList[2] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_3garbage: not in length on purpose"), 14); - arg1List[0].f = fList; - - uint8_t gList[2]; - gList[0] = 0; - gList[1] = 255; - arg1List[0].g = gList; - - request.arg1 = arg1List; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_162(data.value); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_162(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_162(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_162(bool value) - { - VerifyOrReturn(CheckValue("value", value, true)); - - NextTest(); - } - - CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfElementsOfArg1dAreFalse_163() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestListNestedStructListArgumentRequest::Type; - - RequestType request; - - chip::app::Clusters::TestCluster::Structs::NestedStructList::Type arg1List[1]; - - arg1List[0].a = 0; - arg1List[0].b = true; - - arg1List[0].c.a = 0; - arg1List[0].c.b = true; - arg1List[0].c.c = static_cast(2); - arg1List[0].c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); - arg1List[0].c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - arg1List[0].c.f = static_cast>(1); - arg1List[0].c.g = 0.0f; - arg1List[0].c.h = 0; - - chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type dList[2]; - - dList[0].a = 1; - dList[0].b = true; - dList[0].c = static_cast(3); - dList[0].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); - dList[0].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - dList[0].f = static_cast>(1); - dList[0].g = 0.0f; - dList[0].h = 0; - - dList[1].a = 2; - dList[1].b = false; - dList[1].c = static_cast(3); - dList[1].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); - dList[1].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - dList[1].f = static_cast>(1); - dList[1].g = 0.0f; - dList[1].h = 0; - - arg1List[0].d = dList; - - uint32_t eList[3]; - eList[0] = 1UL; - eList[1] = 2UL; - eList[2] = 3UL; - arg1List[0].e = eList; - - chip::ByteSpan fList[3]; - fList[0] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_1garbage: not in length on purpose"), 14); - fList[1] = chip::ByteSpan(chip::Uint8::from_const_char("octect_string_2garbage: not in length on purpose"), 15); - fList[2] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_3garbage: not in length on purpose"), 14); - arg1List[0].f = fList; - - uint8_t gList[2]; - gList[0] = 0; - gList[1] = 255; - arg1List[0].g = gList; - - request.arg1 = arg1List; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_163(data.value); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_163(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_163(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_163(bool value) - { - VerifyOrReturn(CheckValue("value", value, false)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeListWithListOfInt8uAndNoneOfThemIsSetTo0_164() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::List listInt8uArgument; - - uint8_t listInt8uList[4]; - listInt8uList[0] = 1; - listInt8uList[1] = 2; - listInt8uList[2] = 3; - listInt8uList[3] = 4; - listInt8uArgument = listInt8uList; - - ReturnErrorOnFailure(cluster.WriteAttribute( - listInt8uArgument, this, OnSuccessCallback_164, OnFailureCallback_164)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_164(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_164() { NextTest(); } - - CHIP_ERROR TestReadAttributeListWithListOfInt8u_165() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_165, OnFailureCallback_165)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_165(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_165(const chip::app::DataModel::DecodableList & listInt8u) - { - auto iter = listInt8u.begin(); - VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 0)); - VerifyOrReturn(CheckValue("listInt8u[0]", iter.GetValue(), 1)); - VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 1)); - VerifyOrReturn(CheckValue("listInt8u[1]", iter.GetValue(), 2)); - VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 2)); - VerifyOrReturn(CheckValue("listInt8u[2]", iter.GetValue(), 3)); - VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 3)); - VerifyOrReturn(CheckValue("listInt8u[3]", iter.GetValue(), 4)); - VerifyOrReturn(CheckNoMoreListItems("listInt8u", iter, 4)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeListWithListOfOctetString_166() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::List listOctetStringArgument; - - chip::ByteSpan listOctetStringList[4]; - listOctetStringList[0] = chip::ByteSpan(chip::Uint8::from_const_char("Test0garbage: not in length on purpose"), 5); - listOctetStringList[1] = chip::ByteSpan(chip::Uint8::from_const_char("Test1garbage: not in length on purpose"), 5); - listOctetStringList[2] = chip::ByteSpan(chip::Uint8::from_const_char("Test2garbage: not in length on purpose"), 5); - listOctetStringList[3] = chip::ByteSpan(chip::Uint8::from_const_char("Test3garbage: not in length on purpose"), 5); - listOctetStringArgument = listOctetStringList; - - ReturnErrorOnFailure(cluster.WriteAttribute( - listOctetStringArgument, this, OnSuccessCallback_166, OnFailureCallback_166)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_166(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_166() { NextTest(); } - - CHIP_ERROR TestReadAttributeListWithListOfOctetString_167() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_167, OnFailureCallback_167)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_167(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_167(const chip::app::DataModel::DecodableList & listOctetString) - { - auto iter = listOctetString.begin(); - VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter, 0)); - VerifyOrReturn( - CheckValueAsString("listOctetString[0]", iter.GetValue(), chip::ByteSpan(chip::Uint8::from_const_char("Test0"), 5))); - VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter, 1)); - VerifyOrReturn( - CheckValueAsString("listOctetString[1]", iter.GetValue(), chip::ByteSpan(chip::Uint8::from_const_char("Test1"), 5))); - VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter, 2)); - VerifyOrReturn( - CheckValueAsString("listOctetString[2]", iter.GetValue(), chip::ByteSpan(chip::Uint8::from_const_char("Test2"), 5))); - VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter, 3)); - VerifyOrReturn( - CheckValueAsString("listOctetString[3]", iter.GetValue(), chip::ByteSpan(chip::Uint8::from_const_char("Test3"), 5))); - VerifyOrReturn(CheckNoMoreListItems("listOctetString", iter, 4)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeListWithListOfListStructOctetString_168() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::List - listStructOctetStringArgument; - - chip::app::Clusters::TestCluster::Structs::TestListStructOctet::Type listStructOctetStringList[4]; - - listStructOctetStringList[0].fabricIndex = 0ULL; - listStructOctetStringList[0].operationalCert = - chip::ByteSpan(chip::Uint8::from_const_char("Test0garbage: not in length on purpose"), 5); - - listStructOctetStringList[1].fabricIndex = 1ULL; - listStructOctetStringList[1].operationalCert = - chip::ByteSpan(chip::Uint8::from_const_char("Test1garbage: not in length on purpose"), 5); - - listStructOctetStringList[2].fabricIndex = 2ULL; - listStructOctetStringList[2].operationalCert = - chip::ByteSpan(chip::Uint8::from_const_char("Test2garbage: not in length on purpose"), 5); - - listStructOctetStringList[3].fabricIndex = 3ULL; - listStructOctetStringList[3].operationalCert = - chip::ByteSpan(chip::Uint8::from_const_char("Test3garbage: not in length on purpose"), 5); - - listStructOctetStringArgument = listStructOctetStringList; - - ReturnErrorOnFailure(cluster.WriteAttribute( - listStructOctetStringArgument, this, OnSuccessCallback_168, OnFailureCallback_168)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_168(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_168() { NextTest(); } - - CHIP_ERROR TestReadAttributeListWithListOfListStructOctetString_169() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_169, OnFailureCallback_169)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_169(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_169( - const chip::app::DataModel::DecodableList & - listStructOctetString) - { - auto iter = listStructOctetString.begin(); - VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter, 0)); - VerifyOrReturn(CheckValue("listStructOctetString[0].fabricIndex", iter.GetValue().fabricIndex, 0ULL)); - VerifyOrReturn(CheckValueAsString("listStructOctetString[0].operationalCert", iter.GetValue().operationalCert, - chip::ByteSpan(chip::Uint8::from_const_char("Test0"), 5))); - VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter, 1)); - VerifyOrReturn(CheckValue("listStructOctetString[1].fabricIndex", iter.GetValue().fabricIndex, 1ULL)); - VerifyOrReturn(CheckValueAsString("listStructOctetString[1].operationalCert", iter.GetValue().operationalCert, - chip::ByteSpan(chip::Uint8::from_const_char("Test1"), 5))); - VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter, 2)); - VerifyOrReturn(CheckValue("listStructOctetString[2].fabricIndex", iter.GetValue().fabricIndex, 2ULL)); - VerifyOrReturn(CheckValueAsString("listStructOctetString[2].operationalCert", iter.GetValue().operationalCert, - chip::ByteSpan(chip::Uint8::from_const_char("Test2"), 5))); - VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter, 3)); - VerifyOrReturn(CheckValue("listStructOctetString[3].fabricIndex", iter.GetValue().fabricIndex, 3ULL)); - VerifyOrReturn(CheckValueAsString("listStructOctetString[3].operationalCert", iter.GetValue().operationalCert, - chip::ByteSpan(chip::Uint8::from_const_char("Test3"), 5))); - VerifyOrReturn(CheckNoMoreListItems("listStructOctetString", iter, 4)); - - NextTest(); - } - - CHIP_ERROR TestSendTestCommandWithOptionalArgSet_170() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type; - - RequestType request; - request.arg1.Emplace().SetNonNull() = 5; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context)) - ->OnSuccessResponse_170(data.wasPresent, data.wasNull, data.value, data.originalValue); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_170(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_170(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_170(bool wasPresent, const chip::Optional & wasNull, const chip::Optional & value, - const chip::Optional> & originalValue) - { - VerifyOrReturn(CheckValue("wasPresent", wasPresent, true)); - - VerifyOrReturn(CheckValuePresent("wasNull", wasNull)); - VerifyOrReturn(CheckValue("wasNull.Value()", wasNull.Value(), false)); - - VerifyOrReturn(CheckValuePresent("value", value)); - VerifyOrReturn(CheckValue("value.Value()", value.Value(), 5)); - - VerifyOrReturn(CheckValuePresent("originalValue", originalValue)); - VerifyOrReturn(CheckValueNonNull("originalValue.Value()", originalValue.Value())); - VerifyOrReturn(CheckValue("originalValue.Value().Value()", originalValue.Value().Value(), 5)); - - NextTest(); - } - - CHIP_ERROR TestSendTestCommandWithoutItsOptionalArg_171() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context)) - ->OnSuccessResponse_171(data.wasPresent, data.wasNull, data.value, data.originalValue); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_171(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_171(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_171(bool wasPresent, const chip::Optional & wasNull, const chip::Optional & value, - const chip::Optional> & originalValue) - { - VerifyOrReturn(CheckValue("wasPresent", wasPresent, false)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableBooleanNull_172() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableBooleanArgument; - nullableBooleanArgument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBooleanArgument, this, OnSuccessCallback_172, OnFailureCallback_172)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_172(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_172() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableBooleanNull_173() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_173, OnFailureCallback_173)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_173(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_173(const chip::app::DataModel::Nullable & nullableBoolean) - { - VerifyOrReturn(CheckValueNull("nullableBoolean", nullableBoolean)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableBooleanTrue_174() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableBooleanArgument; - nullableBooleanArgument.SetNonNull() = true; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBooleanArgument, this, OnSuccessCallback_174, OnFailureCallback_174)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_174(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_174() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableBooleanTrue_175() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_175, OnFailureCallback_175)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_175(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_175(const chip::app::DataModel::Nullable & nullableBoolean) - { - VerifyOrReturn(CheckValueNonNull("nullableBoolean", nullableBoolean)); - VerifyOrReturn(CheckValue("nullableBoolean.Value()", nullableBoolean.Value(), true)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableBitmap8MaxValue_176() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableBitmap8Argument; - nullableBitmap8Argument.SetNonNull() = 254; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap8Argument, this, OnSuccessCallback_176, OnFailureCallback_176)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_176(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_176() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableBitmap8MaxValue_177() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_177, OnFailureCallback_177)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_177(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_177(const chip::app::DataModel::Nullable & nullableBitmap8) - { - VerifyOrReturn(CheckValueNonNull("nullableBitmap8", nullableBitmap8)); - VerifyOrReturn(CheckValue("nullableBitmap8.Value()", nullableBitmap8.Value(), 254)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableBitmap8InvalidValue_178() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableBitmap8Argument; - nullableBitmap8Argument.SetNonNull() = 255; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap8Argument, this, OnSuccessCallback_178, OnFailureCallback_178)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_178(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_178() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeNullableBitmap8UnchangedValue_179() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_179, OnFailureCallback_179)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_179(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_179(const chip::app::DataModel::Nullable & nullableBitmap8) - { - VerifyOrReturn(CheckValueNonNull("nullableBitmap8", nullableBitmap8)); - VerifyOrReturn(CheckValue("nullableBitmap8.Value()", nullableBitmap8.Value(), 254)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableBitmap8NullValue_180() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableBitmap8Argument; - nullableBitmap8Argument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap8Argument, this, OnSuccessCallback_180, OnFailureCallback_180)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_180(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_180() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableBitmap8NullValue_181() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_181, OnFailureCallback_181)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_181(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_181(const chip::app::DataModel::Nullable & nullableBitmap8) - { - VerifyOrReturn(CheckValueNull("nullableBitmap8", nullableBitmap8)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableBitmap16MaxValue_182() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableBitmap16Argument; - nullableBitmap16Argument.SetNonNull() = 65534U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap16Argument, this, OnSuccessCallback_182, OnFailureCallback_182)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_182(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_182() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableBitmap16MaxValue_183() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_183, OnFailureCallback_183)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_183(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_183(const chip::app::DataModel::Nullable & nullableBitmap16) - { - VerifyOrReturn(CheckValueNonNull("nullableBitmap16", nullableBitmap16)); - VerifyOrReturn(CheckValue("nullableBitmap16.Value()", nullableBitmap16.Value(), 65534U)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableBitmap16InvalidValue_184() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableBitmap16Argument; - nullableBitmap16Argument.SetNonNull() = 65535U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap16Argument, this, OnSuccessCallback_184, OnFailureCallback_184)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_184(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_184() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeNullableBitmap16UnchangedValue_185() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_185, OnFailureCallback_185)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_185(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_185(const chip::app::DataModel::Nullable & nullableBitmap16) - { - VerifyOrReturn(CheckValueNonNull("nullableBitmap16", nullableBitmap16)); - VerifyOrReturn(CheckValue("nullableBitmap16.Value()", nullableBitmap16.Value(), 65534U)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableBitmap16NullValue_186() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableBitmap16Argument; - nullableBitmap16Argument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap16Argument, this, OnSuccessCallback_186, OnFailureCallback_186)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_186(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_186() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableBitmap16NullValue_187() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_187, OnFailureCallback_187)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_187(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_187(const chip::app::DataModel::Nullable & nullableBitmap16) - { - VerifyOrReturn(CheckValueNull("nullableBitmap16", nullableBitmap16)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableBitmap32MaxValue_188() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableBitmap32Argument; - nullableBitmap32Argument.SetNonNull() = 4294967294UL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap32Argument, this, OnSuccessCallback_188, OnFailureCallback_188)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_188(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_188() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableBitmap32MaxValue_189() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_189, OnFailureCallback_189)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_189(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_189(const chip::app::DataModel::Nullable & nullableBitmap32) - { - VerifyOrReturn(CheckValueNonNull("nullableBitmap32", nullableBitmap32)); - VerifyOrReturn(CheckValue("nullableBitmap32.Value()", nullableBitmap32.Value(), 4294967294UL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableBitmap32InvalidValue_190() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableBitmap32Argument; - nullableBitmap32Argument.SetNonNull() = 4294967295UL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap32Argument, this, OnSuccessCallback_190, OnFailureCallback_190)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_190(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_190() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeNullableBitmap32UnchangedValue_191() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_191, OnFailureCallback_191)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_191(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_191(const chip::app::DataModel::Nullable & nullableBitmap32) - { - VerifyOrReturn(CheckValueNonNull("nullableBitmap32", nullableBitmap32)); - VerifyOrReturn(CheckValue("nullableBitmap32.Value()", nullableBitmap32.Value(), 4294967294UL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableBitmap32NullValue_192() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableBitmap32Argument; - nullableBitmap32Argument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap32Argument, this, OnSuccessCallback_192, OnFailureCallback_192)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_192(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_192() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableBitmap32NullValue_193() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_193, OnFailureCallback_193)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_193(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_193(const chip::app::DataModel::Nullable & nullableBitmap32) - { - VerifyOrReturn(CheckValueNull("nullableBitmap32", nullableBitmap32)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableBitmap64MaxValue_194() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableBitmap64Argument; - nullableBitmap64Argument.SetNonNull() = 18446744073709551614ULL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap64Argument, this, OnSuccessCallback_194, OnFailureCallback_194)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_194(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_194() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableBitmap64MaxValue_195() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_195, OnFailureCallback_195)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_195(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_195(const chip::app::DataModel::Nullable & nullableBitmap64) - { - VerifyOrReturn(CheckValueNonNull("nullableBitmap64", nullableBitmap64)); - VerifyOrReturn(CheckValue("nullableBitmap64.Value()", nullableBitmap64.Value(), 18446744073709551614ULL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableBitmap64InvalidValue_196() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableBitmap64Argument; - nullableBitmap64Argument.SetNonNull() = 18446744073709551615ULL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap64Argument, this, OnSuccessCallback_196, OnFailureCallback_196)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_196(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_196() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeNullableBitmap64UnchangedValue_197() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_197, OnFailureCallback_197)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_197(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_197(const chip::app::DataModel::Nullable & nullableBitmap64) - { - VerifyOrReturn(CheckValueNonNull("nullableBitmap64", nullableBitmap64)); - VerifyOrReturn(CheckValue("nullableBitmap64.Value()", nullableBitmap64.Value(), 18446744073709551614ULL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableBitmap64NullValue_198() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableBitmap64Argument; - nullableBitmap64Argument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap64Argument, this, OnSuccessCallback_198, OnFailureCallback_198)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_198(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_198() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableBitmap64NullValue_199() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_199, OnFailureCallback_199)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_199(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_199(const chip::app::DataModel::Nullable & nullableBitmap64) - { - VerifyOrReturn(CheckValueNull("nullableBitmap64", nullableBitmap64)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt8uMinValue_200() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt8uArgument; - nullableInt8uArgument.SetNonNull() = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt8uArgument, this, OnSuccessCallback_200, OnFailureCallback_200)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_200(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_200() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt8uMinValue_201() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_201, OnFailureCallback_201)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_201(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_201(const chip::app::DataModel::Nullable & nullableInt8u) - { - VerifyOrReturn(CheckValueNonNull("nullableInt8u", nullableInt8u)); - VerifyOrReturn(CheckValue("nullableInt8u.Value()", nullableInt8u.Value(), 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt8uMaxValue_202() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt8uArgument; - nullableInt8uArgument.SetNonNull() = 254; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt8uArgument, this, OnSuccessCallback_202, OnFailureCallback_202)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_202(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_202() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt8uMaxValue_203() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_203, OnFailureCallback_203)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_203(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_203(const chip::app::DataModel::Nullable & nullableInt8u) - { - VerifyOrReturn(CheckValueNonNull("nullableInt8u", nullableInt8u)); - VerifyOrReturn(CheckValue("nullableInt8u.Value()", nullableInt8u.Value(), 254)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt8uInvalidValue_204() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt8uArgument; - nullableInt8uArgument.SetNonNull() = 255; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt8uArgument, this, OnSuccessCallback_204, OnFailureCallback_204)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_204(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_204() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeNullableInt8uUnchangedValue_205() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_205, OnFailureCallback_205)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_205(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_205(const chip::app::DataModel::Nullable & nullableInt8u) - { - VerifyOrReturn(CheckValueNonNull("nullableInt8u", nullableInt8u)); - VerifyOrReturn(CheckValue("nullableInt8u.Value()", nullableInt8u.Value(), 254)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt8uNullValue_206() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt8uArgument; - nullableInt8uArgument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt8uArgument, this, OnSuccessCallback_206, OnFailureCallback_206)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_206(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_206() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt8uNullValue_207() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_207, OnFailureCallback_207)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_207(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_207(const chip::app::DataModel::Nullable & nullableInt8u) - { - VerifyOrReturn(CheckValueNull("nullableInt8u", nullableInt8u)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt8uNullValueRange_208() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_208, OnFailureCallback_208)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_208(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_208(const chip::app::DataModel::Nullable & nullableInt8u) - { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt8u", nullableInt8u, 254)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt8uNullValueNot_209() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_209, OnFailureCallback_209)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_209(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_209(const chip::app::DataModel::Nullable & nullableInt8u) - { - VerifyOrReturn(CheckConstraintNotValue("nullableInt8u", nullableInt8u, 254)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt8uValue_210() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt8uArgument; - nullableInt8uArgument.SetNonNull() = 128; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt8uArgument, this, OnSuccessCallback_210, OnFailureCallback_210)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_210(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_210() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt8uValueInRange_211() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_211, OnFailureCallback_211)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_211(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_211(const chip::app::DataModel::Nullable & nullableInt8u) - { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt8u", nullableInt8u, 254)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt8uNotValueOk_212() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_212, OnFailureCallback_212)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_212(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_212(const chip::app::DataModel::Nullable & nullableInt8u) - { - VerifyOrReturn(CheckConstraintNotValue("nullableInt8u", nullableInt8u, 129)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt16uMinValue_213() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt16uArgument; - nullableInt16uArgument.SetNonNull() = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt16uArgument, this, OnSuccessCallback_213, OnFailureCallback_213)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_213(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_213() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt16uMinValue_214() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_214, OnFailureCallback_214)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_214(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_214(const chip::app::DataModel::Nullable & nullableInt16u) - { - VerifyOrReturn(CheckValueNonNull("nullableInt16u", nullableInt16u)); - VerifyOrReturn(CheckValue("nullableInt16u.Value()", nullableInt16u.Value(), 0U)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt16uMaxValue_215() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt16uArgument; - nullableInt16uArgument.SetNonNull() = 65534U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt16uArgument, this, OnSuccessCallback_215, OnFailureCallback_215)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_215(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_215() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt16uMaxValue_216() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_216, OnFailureCallback_216)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_216(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_216(const chip::app::DataModel::Nullable & nullableInt16u) - { - VerifyOrReturn(CheckValueNonNull("nullableInt16u", nullableInt16u)); - VerifyOrReturn(CheckValue("nullableInt16u.Value()", nullableInt16u.Value(), 65534U)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt16uInvalidValue_217() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt16uArgument; - nullableInt16uArgument.SetNonNull() = 65535U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt16uArgument, this, OnSuccessCallback_217, OnFailureCallback_217)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_217(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_217() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeNullableInt16uUnchangedValue_218() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_218, OnFailureCallback_218)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_218(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_218(const chip::app::DataModel::Nullable & nullableInt16u) - { - VerifyOrReturn(CheckValueNonNull("nullableInt16u", nullableInt16u)); - VerifyOrReturn(CheckValue("nullableInt16u.Value()", nullableInt16u.Value(), 65534U)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt16uNullValue_219() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt16uArgument; - nullableInt16uArgument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt16uArgument, this, OnSuccessCallback_219, OnFailureCallback_219)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_219(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_219() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt16uNullValue_220() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_220, OnFailureCallback_220)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_220(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_220(const chip::app::DataModel::Nullable & nullableInt16u) - { - VerifyOrReturn(CheckValueNull("nullableInt16u", nullableInt16u)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt16uNullValueRange_221() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_221, OnFailureCallback_221)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_221(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_221(const chip::app::DataModel::Nullable & nullableInt16u) - { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt16u", nullableInt16u, 65534U)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt16uNullValueNot_222() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_222, OnFailureCallback_222)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_222(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_222(const chip::app::DataModel::Nullable & nullableInt16u) - { - VerifyOrReturn(CheckConstraintNotValue("nullableInt16u", nullableInt16u, 65534U)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt16uValue_223() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt16uArgument; - nullableInt16uArgument.SetNonNull() = 32000U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt16uArgument, this, OnSuccessCallback_223, OnFailureCallback_223)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_223(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_223() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt16uValueInRange_224() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_224, OnFailureCallback_224)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_224(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_224(const chip::app::DataModel::Nullable & nullableInt16u) - { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt16u", nullableInt16u, 65534U)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt16uNotValueOk_225() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_225, OnFailureCallback_225)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_225(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_225(const chip::app::DataModel::Nullable & nullableInt16u) - { - VerifyOrReturn(CheckConstraintNotValue("nullableInt16u", nullableInt16u, 32001U)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt32uMinValue_226() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt32uArgument; - nullableInt32uArgument.SetNonNull() = 0UL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt32uArgument, this, OnSuccessCallback_226, OnFailureCallback_226)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_226(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_226() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt32uMinValue_227() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_227, OnFailureCallback_227)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_227(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_227(const chip::app::DataModel::Nullable & nullableInt32u) - { - VerifyOrReturn(CheckValueNonNull("nullableInt32u", nullableInt32u)); - VerifyOrReturn(CheckValue("nullableInt32u.Value()", nullableInt32u.Value(), 0UL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt32uMaxValue_228() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt32uArgument; - nullableInt32uArgument.SetNonNull() = 4294967294UL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt32uArgument, this, OnSuccessCallback_228, OnFailureCallback_228)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_228(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_228() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt32uMaxValue_229() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_229, OnFailureCallback_229)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_229(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_229(const chip::app::DataModel::Nullable & nullableInt32u) - { - VerifyOrReturn(CheckValueNonNull("nullableInt32u", nullableInt32u)); - VerifyOrReturn(CheckValue("nullableInt32u.Value()", nullableInt32u.Value(), 4294967294UL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt32uInvalidValue_230() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt32uArgument; - nullableInt32uArgument.SetNonNull() = 4294967295UL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt32uArgument, this, OnSuccessCallback_230, OnFailureCallback_230)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_230(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_230() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeNullableInt32uUnchangedValue_231() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_231, OnFailureCallback_231)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_231(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_231(const chip::app::DataModel::Nullable & nullableInt32u) - { - VerifyOrReturn(CheckValueNonNull("nullableInt32u", nullableInt32u)); - VerifyOrReturn(CheckValue("nullableInt32u.Value()", nullableInt32u.Value(), 4294967294UL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt32uNullValue_232() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt32uArgument; - nullableInt32uArgument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt32uArgument, this, OnSuccessCallback_232, OnFailureCallback_232)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_232(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_232() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt32uNullValue_233() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_233, OnFailureCallback_233)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_233(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_233(const chip::app::DataModel::Nullable & nullableInt32u) - { - VerifyOrReturn(CheckValueNull("nullableInt32u", nullableInt32u)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt32uNullValueRange_234() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_234, OnFailureCallback_234)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_234(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_234(const chip::app::DataModel::Nullable & nullableInt32u) - { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt32u", nullableInt32u, 4294967294UL)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt32uNullValueNot_235() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_235, OnFailureCallback_235)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_235(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_235(const chip::app::DataModel::Nullable & nullableInt32u) - { - VerifyOrReturn(CheckConstraintNotValue("nullableInt32u", nullableInt32u, 4294967294UL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt32uValue_236() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt32uArgument; - nullableInt32uArgument.SetNonNull() = 2147483647UL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt32uArgument, this, OnSuccessCallback_236, OnFailureCallback_236)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_236(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_236() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt32uValueInRange_237() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_237, OnFailureCallback_237)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_237(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_237(const chip::app::DataModel::Nullable & nullableInt32u) - { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt32u", nullableInt32u, 4294967294UL)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt32uNotValueOk_238() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_238, OnFailureCallback_238)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_238(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_238(const chip::app::DataModel::Nullable & nullableInt32u) - { - VerifyOrReturn(CheckConstraintNotValue("nullableInt32u", nullableInt32u, 2147483648UL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt64uMinValue_239() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt64uArgument; - nullableInt64uArgument.SetNonNull() = 0ULL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt64uArgument, this, OnSuccessCallback_239, OnFailureCallback_239)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_239(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_239() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt64uMinValue_240() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_240, OnFailureCallback_240)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_240(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_240(const chip::app::DataModel::Nullable & nullableInt64u) - { - VerifyOrReturn(CheckValueNonNull("nullableInt64u", nullableInt64u)); - VerifyOrReturn(CheckValue("nullableInt64u.Value()", nullableInt64u.Value(), 0ULL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt64uMaxValue_241() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt64uArgument; - nullableInt64uArgument.SetNonNull() = 18446744073709551614ULL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt64uArgument, this, OnSuccessCallback_241, OnFailureCallback_241)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_241(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_241() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt64uMaxValue_242() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_242, OnFailureCallback_242)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_242(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_242(const chip::app::DataModel::Nullable & nullableInt64u) - { - VerifyOrReturn(CheckValueNonNull("nullableInt64u", nullableInt64u)); - VerifyOrReturn(CheckValue("nullableInt64u.Value()", nullableInt64u.Value(), 18446744073709551614ULL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt64uInvalidValue_243() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt64uArgument; - nullableInt64uArgument.SetNonNull() = 18446744073709551615ULL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt64uArgument, this, OnSuccessCallback_243, OnFailureCallback_243)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_243(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_243() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeNullableInt64uUnchangedValue_244() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_244, OnFailureCallback_244)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_244(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_244(const chip::app::DataModel::Nullable & nullableInt64u) - { - VerifyOrReturn(CheckValueNonNull("nullableInt64u", nullableInt64u)); - VerifyOrReturn(CheckValue("nullableInt64u.Value()", nullableInt64u.Value(), 18446744073709551614ULL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt64uNullValue_245() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt64uArgument; - nullableInt64uArgument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt64uArgument, this, OnSuccessCallback_245, OnFailureCallback_245)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_245(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_245() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt64uNullValue_246() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_246, OnFailureCallback_246)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_246(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_246(const chip::app::DataModel::Nullable & nullableInt64u) - { - VerifyOrReturn(CheckValueNull("nullableInt64u", nullableInt64u)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt64uNullValueRange_247() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_247, OnFailureCallback_247)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_247(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_247(const chip::app::DataModel::Nullable & nullableInt64u) - { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt64u", nullableInt64u, 18446744073709551614ULL)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt64uNullValueNot_248() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_248, OnFailureCallback_248)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_248(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_248(const chip::app::DataModel::Nullable & nullableInt64u) - { - VerifyOrReturn(CheckConstraintNotValue("nullableInt64u", nullableInt64u, 18446744073709551614ULL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt64uValue_249() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt64uArgument; - nullableInt64uArgument.SetNonNull() = 18000000000000000000ULL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt64uArgument, this, OnSuccessCallback_249, OnFailureCallback_249)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_249(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_249() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt64uValueInRange_250() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_250, OnFailureCallback_250)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_250(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_250(const chip::app::DataModel::Nullable & nullableInt64u) - { - VerifyOrReturn(CheckConstraintMaxValue("nullableInt64u", nullableInt64u, 18446744073709551614ULL)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt64uNotValueOk_251() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_251, OnFailureCallback_251)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_251(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_251(const chip::app::DataModel::Nullable & nullableInt64u) - { - VerifyOrReturn(CheckConstraintNotValue("nullableInt64u", nullableInt64u, 18000000000000000001ULL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt8sMinValue_252() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt8sArgument; - nullableInt8sArgument.SetNonNull() = -127; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt8sArgument, this, OnSuccessCallback_252, OnFailureCallback_252)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_252(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_252() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt8sMinValue_253() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_253, OnFailureCallback_253)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_253(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_253(const chip::app::DataModel::Nullable & nullableInt8s) - { - VerifyOrReturn(CheckValueNonNull("nullableInt8s", nullableInt8s)); - VerifyOrReturn(CheckValue("nullableInt8s.Value()", nullableInt8s.Value(), -127)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt8sInvalidValue_254() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt8sArgument; - nullableInt8sArgument.SetNonNull() = -128; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt8sArgument, this, OnSuccessCallback_254, OnFailureCallback_254)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_254(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_254() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeNullableInt8sUnchangedValue_255() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_255, OnFailureCallback_255)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_255(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_255(const chip::app::DataModel::Nullable & nullableInt8s) - { - VerifyOrReturn(CheckValueNonNull("nullableInt8s", nullableInt8s)); - VerifyOrReturn(CheckValue("nullableInt8s.Value()", nullableInt8s.Value(), -127)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt8sNullValue_256() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt8sArgument; - nullableInt8sArgument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt8sArgument, this, OnSuccessCallback_256, OnFailureCallback_256)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_256(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_256() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt8sNullValue_257() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_257, OnFailureCallback_257)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_257(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_257(const chip::app::DataModel::Nullable & nullableInt8s) - { - VerifyOrReturn(CheckValueNull("nullableInt8s", nullableInt8s)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt8sNullValueRange_258() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_258, OnFailureCallback_258)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_258(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_258(const chip::app::DataModel::Nullable & nullableInt8s) - { - VerifyOrReturn(CheckConstraintMinValue("nullableInt8s", nullableInt8s, -127)); - VerifyOrReturn(CheckConstraintMaxValue("nullableInt8s", nullableInt8s, 127)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt8sNullValueNot_259() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_259, OnFailureCallback_259)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_259(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_259(const chip::app::DataModel::Nullable & nullableInt8s) - { - VerifyOrReturn(CheckConstraintNotValue("nullableInt8s", nullableInt8s, -127)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt8sValue_260() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt8sArgument; - nullableInt8sArgument.SetNonNull() = -127; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt8sArgument, this, OnSuccessCallback_260, OnFailureCallback_260)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_260(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_260() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt8sValueInRange_261() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_261, OnFailureCallback_261)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_261(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_261(const chip::app::DataModel::Nullable & nullableInt8s) - { - VerifyOrReturn(CheckConstraintMinValue("nullableInt8s", nullableInt8s, -127)); - VerifyOrReturn(CheckConstraintMaxValue("nullableInt8s", nullableInt8s, 127)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt8sNotValueOk_262() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_262, OnFailureCallback_262)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_262(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_262(const chip::app::DataModel::Nullable & nullableInt8s) - { - VerifyOrReturn(CheckConstraintNotValue("nullableInt8s", nullableInt8s, -126)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt16sMinValue_263() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt16sArgument; - nullableInt16sArgument.SetNonNull() = -32767; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt16sArgument, this, OnSuccessCallback_263, OnFailureCallback_263)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_263(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_263() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt16sMinValue_264() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_264, OnFailureCallback_264)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_264(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_264(const chip::app::DataModel::Nullable & nullableInt16s) - { - VerifyOrReturn(CheckValueNonNull("nullableInt16s", nullableInt16s)); - VerifyOrReturn(CheckValue("nullableInt16s.Value()", nullableInt16s.Value(), -32767)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt16sInvalidValue_265() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt16sArgument; - nullableInt16sArgument.SetNonNull() = -32768; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt16sArgument, this, OnSuccessCallback_265, OnFailureCallback_265)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_265(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_265() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeNullableInt16sUnchangedValue_266() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_266, OnFailureCallback_266)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_266(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_266(const chip::app::DataModel::Nullable & nullableInt16s) - { - VerifyOrReturn(CheckValueNonNull("nullableInt16s", nullableInt16s)); - VerifyOrReturn(CheckValue("nullableInt16s.Value()", nullableInt16s.Value(), -32767)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt16sNullValue_267() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt16sArgument; - nullableInt16sArgument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt16sArgument, this, OnSuccessCallback_267, OnFailureCallback_267)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_267(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_267() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt16sNullValue_268() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_268, OnFailureCallback_268)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_268(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_268(const chip::app::DataModel::Nullable & nullableInt16s) - { - VerifyOrReturn(CheckValueNull("nullableInt16s", nullableInt16s)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt16sNullValueRange_269() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_269, OnFailureCallback_269)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_269(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_269(const chip::app::DataModel::Nullable & nullableInt16s) - { - VerifyOrReturn(CheckConstraintMinValue("nullableInt16s", nullableInt16s, -32767)); - VerifyOrReturn(CheckConstraintMaxValue("nullableInt16s", nullableInt16s, 32767)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt16sNullValueNot_270() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_270, OnFailureCallback_270)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_270(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_270(const chip::app::DataModel::Nullable & nullableInt16s) - { - VerifyOrReturn(CheckConstraintNotValue("nullableInt16s", nullableInt16s, -32767)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt16sValue_271() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt16sArgument; - nullableInt16sArgument.SetNonNull() = -32767; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt16sArgument, this, OnSuccessCallback_271, OnFailureCallback_271)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_271(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_271() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt16sValueInRange_272() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_272, OnFailureCallback_272)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_272(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_272(const chip::app::DataModel::Nullable & nullableInt16s) - { - VerifyOrReturn(CheckConstraintMinValue("nullableInt16s", nullableInt16s, -32767)); - VerifyOrReturn(CheckConstraintMaxValue("nullableInt16s", nullableInt16s, 32767)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt16sNotValueOk_273() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_273, OnFailureCallback_273)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_273(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_273(const chip::app::DataModel::Nullable & nullableInt16s) - { - VerifyOrReturn(CheckConstraintNotValue("nullableInt16s", nullableInt16s, -32766)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt32sMinValue_274() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt32sArgument; - nullableInt32sArgument.SetNonNull() = -2147483647L; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt32sArgument, this, OnSuccessCallback_274, OnFailureCallback_274)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_274(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_274() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt32sMinValue_275() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_275, OnFailureCallback_275)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_275(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_275(const chip::app::DataModel::Nullable & nullableInt32s) - { - VerifyOrReturn(CheckValueNonNull("nullableInt32s", nullableInt32s)); - VerifyOrReturn(CheckValue("nullableInt32s.Value()", nullableInt32s.Value(), -2147483647L)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt32sInvalidValue_276() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt32sArgument; - nullableInt32sArgument.SetNonNull() = -2147483648L; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt32sArgument, this, OnSuccessCallback_276, OnFailureCallback_276)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_276(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_276() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeNullableInt32sUnchangedValue_277() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_277, OnFailureCallback_277)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_277(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_277(const chip::app::DataModel::Nullable & nullableInt32s) - { - VerifyOrReturn(CheckValueNonNull("nullableInt32s", nullableInt32s)); - VerifyOrReturn(CheckValue("nullableInt32s.Value()", nullableInt32s.Value(), -2147483647L)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt32sNullValue_278() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt32sArgument; - nullableInt32sArgument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt32sArgument, this, OnSuccessCallback_278, OnFailureCallback_278)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_278(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_278() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt32sNullValue_279() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_279, OnFailureCallback_279)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_279(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_279(const chip::app::DataModel::Nullable & nullableInt32s) - { - VerifyOrReturn(CheckValueNull("nullableInt32s", nullableInt32s)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt32sNullValueRange_280() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_280, OnFailureCallback_280)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_280(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_280(const chip::app::DataModel::Nullable & nullableInt32s) - { - VerifyOrReturn(CheckConstraintMinValue("nullableInt32s", nullableInt32s, -2147483647L)); - VerifyOrReturn(CheckConstraintMaxValue("nullableInt32s", nullableInt32s, 2147483647L)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt32sNullValueNot_281() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_281, OnFailureCallback_281)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_281(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_281(const chip::app::DataModel::Nullable & nullableInt32s) - { - VerifyOrReturn(CheckConstraintNotValue("nullableInt32s", nullableInt32s, -2147483647L)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt32sValue_282() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt32sArgument; - nullableInt32sArgument.SetNonNull() = -2147483647L; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt32sArgument, this, OnSuccessCallback_282, OnFailureCallback_282)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_282(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_282() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt32sValueInRange_283() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_283, OnFailureCallback_283)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_283(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_283(const chip::app::DataModel::Nullable & nullableInt32s) - { - VerifyOrReturn(CheckConstraintMinValue("nullableInt32s", nullableInt32s, -2147483647L)); - VerifyOrReturn(CheckConstraintMaxValue("nullableInt32s", nullableInt32s, 2147483647L)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt32sNotValueOk_284() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_284, OnFailureCallback_284)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_284(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_284(const chip::app::DataModel::Nullable & nullableInt32s) - { - VerifyOrReturn(CheckConstraintNotValue("nullableInt32s", nullableInt32s, -2147483646L)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt64sMinValue_285() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt64sArgument; - nullableInt64sArgument.SetNonNull() = -9223372036854775807LL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt64sArgument, this, OnSuccessCallback_285, OnFailureCallback_285)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_285(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_285() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt64sMinValue_286() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_286, OnFailureCallback_286)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_286(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_286(const chip::app::DataModel::Nullable & nullableInt64s) - { - VerifyOrReturn(CheckValueNonNull("nullableInt64s", nullableInt64s)); - VerifyOrReturn(CheckValue("nullableInt64s.Value()", nullableInt64s.Value(), -9223372036854775807LL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt64sInvalidValue_287() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt64sArgument; - nullableInt64sArgument.SetNonNull() = -9223372036854775807LL - 1; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt64sArgument, this, OnSuccessCallback_287, OnFailureCallback_287)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_287(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_287() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeNullableInt64sUnchangedValue_288() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_288, OnFailureCallback_288)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_288(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_288(const chip::app::DataModel::Nullable & nullableInt64s) - { - VerifyOrReturn(CheckValueNonNull("nullableInt64s", nullableInt64s)); - VerifyOrReturn(CheckValue("nullableInt64s.Value()", nullableInt64s.Value(), -9223372036854775807LL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt64sNullValue_289() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt64sArgument; - nullableInt64sArgument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt64sArgument, this, OnSuccessCallback_289, OnFailureCallback_289)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_289(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_289() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt64sNullValue_290() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_290, OnFailureCallback_290)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_290(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_290(const chip::app::DataModel::Nullable & nullableInt64s) - { - VerifyOrReturn(CheckValueNull("nullableInt64s", nullableInt64s)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt64sNullValueRange_291() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_291, OnFailureCallback_291)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_291(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_291(const chip::app::DataModel::Nullable & nullableInt64s) - { - VerifyOrReturn(CheckConstraintMinValue("nullableInt64s", nullableInt64s, -9223372036854775807LL)); - VerifyOrReturn(CheckConstraintMaxValue("nullableInt64s", nullableInt64s, 9223372036854775807LL)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt64sNullValueNot_292() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_292, OnFailureCallback_292)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_292(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_292(const chip::app::DataModel::Nullable & nullableInt64s) - { - VerifyOrReturn(CheckConstraintNotValue("nullableInt64s", nullableInt64s, -9223372036854775807LL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableInt64sValue_293() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableInt64sArgument; - nullableInt64sArgument.SetNonNull() = -9223372036854775807LL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt64sArgument, this, OnSuccessCallback_293, OnFailureCallback_293)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_293(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_293() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableInt64sValueInRange_294() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_294, OnFailureCallback_294)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_294(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_294(const chip::app::DataModel::Nullable & nullableInt64s) - { - VerifyOrReturn(CheckConstraintMinValue("nullableInt64s", nullableInt64s, -9223372036854775807LL)); - VerifyOrReturn(CheckConstraintMaxValue("nullableInt64s", nullableInt64s, 9223372036854775807LL)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableInt64sNotValueOk_295() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_295, OnFailureCallback_295)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_295(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_295(const chip::app::DataModel::Nullable & nullableInt64s) - { - VerifyOrReturn(CheckConstraintNotValue("nullableInt64s", nullableInt64s, -9223372036854775806LL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableSingleMediumValue_296() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableFloatSingleArgument; - nullableFloatSingleArgument.SetNonNull() = 0.1f; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableFloatSingleArgument, this, OnSuccessCallback_296, OnFailureCallback_296)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_296(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_296() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableSingleMediumValue_297() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_297, OnFailureCallback_297)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_297(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_297(const chip::app::DataModel::Nullable & nullableFloatSingle) - { - VerifyOrReturn(CheckValueNonNull("nullableFloatSingle", nullableFloatSingle)); - VerifyOrReturn(CheckValue("nullableFloatSingle.Value()", nullableFloatSingle.Value(), 0.1f)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableSingleLargestValue_298() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableFloatSingleArgument; - nullableFloatSingleArgument.SetNonNull() = INFINITY; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableFloatSingleArgument, this, OnSuccessCallback_298, OnFailureCallback_298)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_298(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_298() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableSingleLargestValue_299() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_299, OnFailureCallback_299)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_299(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_299(const chip::app::DataModel::Nullable & nullableFloatSingle) - { - VerifyOrReturn(CheckValueNonNull("nullableFloatSingle", nullableFloatSingle)); - VerifyOrReturn(CheckValue("nullableFloatSingle.Value()", nullableFloatSingle.Value(), INFINITY)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableSingleSmallestValue_300() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableFloatSingleArgument; - nullableFloatSingleArgument.SetNonNull() = -INFINITY; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableFloatSingleArgument, this, OnSuccessCallback_300, OnFailureCallback_300)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_300(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_300() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableSingleSmallestValue_301() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_301, OnFailureCallback_301)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_301(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_301(const chip::app::DataModel::Nullable & nullableFloatSingle) - { - VerifyOrReturn(CheckValueNonNull("nullableFloatSingle", nullableFloatSingle)); - VerifyOrReturn(CheckValue("nullableFloatSingle.Value()", nullableFloatSingle.Value(), -INFINITY)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableSingleNullValue_302() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableFloatSingleArgument; - nullableFloatSingleArgument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableFloatSingleArgument, this, OnSuccessCallback_302, OnFailureCallback_302)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_302(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_302() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableSingleNullValue_303() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_303, OnFailureCallback_303)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_303(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_303(const chip::app::DataModel::Nullable & nullableFloatSingle) - { - VerifyOrReturn(CheckValueNull("nullableFloatSingle", nullableFloatSingle)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableSingle0Value_304() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableFloatSingleArgument; - nullableFloatSingleArgument.SetNonNull() = 0.0f; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableFloatSingleArgument, this, OnSuccessCallback_304, OnFailureCallback_304)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_304(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_304() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableSingle0Value_305() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_305, OnFailureCallback_305)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_305(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_305(const chip::app::DataModel::Nullable & nullableFloatSingle) - { - VerifyOrReturn(CheckValueNonNull("nullableFloatSingle", nullableFloatSingle)); - VerifyOrReturn(CheckValue("nullableFloatSingle.Value()", nullableFloatSingle.Value(), 0.0f)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableDoubleMediumValue_306() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableFloatDoubleArgument; - nullableFloatDoubleArgument.SetNonNull() = 0.1234567890123; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableFloatDoubleArgument, this, OnSuccessCallback_306, OnFailureCallback_306)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_306(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_306() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableDoubleMediumValue_307() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_307, OnFailureCallback_307)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_307(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_307(const chip::app::DataModel::Nullable & nullableFloatDouble) - { - VerifyOrReturn(CheckValueNonNull("nullableFloatDouble", nullableFloatDouble)); - VerifyOrReturn(CheckValue("nullableFloatDouble.Value()", nullableFloatDouble.Value(), 0.1234567890123)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableDoubleLargestValue_308() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableFloatDoubleArgument; - nullableFloatDoubleArgument.SetNonNull() = INFINITY; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableFloatDoubleArgument, this, OnSuccessCallback_308, OnFailureCallback_308)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_308(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_308() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableDoubleLargestValue_309() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_309, OnFailureCallback_309)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_309(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_309(const chip::app::DataModel::Nullable & nullableFloatDouble) - { - VerifyOrReturn(CheckValueNonNull("nullableFloatDouble", nullableFloatDouble)); - VerifyOrReturn(CheckValue("nullableFloatDouble.Value()", nullableFloatDouble.Value(), INFINITY)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableDoubleSmallestValue_310() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableFloatDoubleArgument; - nullableFloatDoubleArgument.SetNonNull() = -INFINITY; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableFloatDoubleArgument, this, OnSuccessCallback_310, OnFailureCallback_310)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_310(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_310() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableDoubleSmallestValue_311() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_311, OnFailureCallback_311)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_311(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_311(const chip::app::DataModel::Nullable & nullableFloatDouble) - { - VerifyOrReturn(CheckValueNonNull("nullableFloatDouble", nullableFloatDouble)); - VerifyOrReturn(CheckValue("nullableFloatDouble.Value()", nullableFloatDouble.Value(), -INFINITY)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableDoubleNullValue_312() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableFloatDoubleArgument; - nullableFloatDoubleArgument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableFloatDoubleArgument, this, OnSuccessCallback_312, OnFailureCallback_312)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_312(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_312() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableDoubleNullValue_313() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_313, OnFailureCallback_313)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_313(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_313(const chip::app::DataModel::Nullable & nullableFloatDouble) - { - VerifyOrReturn(CheckValueNull("nullableFloatDouble", nullableFloatDouble)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableDouble0Value_314() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableFloatDoubleArgument; - nullableFloatDoubleArgument.SetNonNull() = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableFloatDoubleArgument, this, OnSuccessCallback_314, OnFailureCallback_314)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_314(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_314() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableDouble0Value_315() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_315, OnFailureCallback_315)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_315(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_315(const chip::app::DataModel::Nullable & nullableFloatDouble) - { - VerifyOrReturn(CheckValueNonNull("nullableFloatDouble", nullableFloatDouble)); - VerifyOrReturn(CheckValue("nullableFloatDouble.Value()", nullableFloatDouble.Value(), 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableEnum8MinValue_316() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableEnum8Argument; - nullableEnum8Argument.SetNonNull() = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableEnum8Argument, this, OnSuccessCallback_316, OnFailureCallback_316)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_316(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_316() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableEnum8MinValue_317() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_317, OnFailureCallback_317)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_317(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_317(const chip::app::DataModel::Nullable & nullableEnum8) - { - VerifyOrReturn(CheckValueNonNull("nullableEnum8", nullableEnum8)); - VerifyOrReturn(CheckValue("nullableEnum8.Value()", nullableEnum8.Value(), 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableEnum8MaxValue_318() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableEnum8Argument; - nullableEnum8Argument.SetNonNull() = 254; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableEnum8Argument, this, OnSuccessCallback_318, OnFailureCallback_318)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_318(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_318() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableEnum8MaxValue_319() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_319, OnFailureCallback_319)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_319(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_319(const chip::app::DataModel::Nullable & nullableEnum8) - { - VerifyOrReturn(CheckValueNonNull("nullableEnum8", nullableEnum8)); - VerifyOrReturn(CheckValue("nullableEnum8.Value()", nullableEnum8.Value(), 254)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableEnum8InvalidValue_320() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableEnum8Argument; - nullableEnum8Argument.SetNonNull() = 255; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableEnum8Argument, this, OnSuccessCallback_320, OnFailureCallback_320)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_320(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_320() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeNullableEnum8UnchangedValue_321() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_321, OnFailureCallback_321)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_321(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_321(const chip::app::DataModel::Nullable & nullableEnum8) - { - VerifyOrReturn(CheckValueNonNull("nullableEnum8", nullableEnum8)); - VerifyOrReturn(CheckValue("nullableEnum8.Value()", nullableEnum8.Value(), 254)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableEnum8NullValue_322() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableEnum8Argument; - nullableEnum8Argument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableEnum8Argument, this, OnSuccessCallback_322, OnFailureCallback_322)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_322(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_322() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableEnum8NullValue_323() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_323, OnFailureCallback_323)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_323(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_323(const chip::app::DataModel::Nullable & nullableEnum8) - { - VerifyOrReturn(CheckValueNull("nullableEnum8", nullableEnum8)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableEnum16MinValue_324() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableEnum16Argument; - nullableEnum16Argument.SetNonNull() = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableEnum16Argument, this, OnSuccessCallback_324, OnFailureCallback_324)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_324(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_324() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableEnum16MinValue_325() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_325, OnFailureCallback_325)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_325(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_325(const chip::app::DataModel::Nullable & nullableEnum16) - { - VerifyOrReturn(CheckValueNonNull("nullableEnum16", nullableEnum16)); - VerifyOrReturn(CheckValue("nullableEnum16.Value()", nullableEnum16.Value(), 0U)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableEnum16MaxValue_326() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableEnum16Argument; - nullableEnum16Argument.SetNonNull() = 65534U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableEnum16Argument, this, OnSuccessCallback_326, OnFailureCallback_326)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_326(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_326() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableEnum16MaxValue_327() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_327, OnFailureCallback_327)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_327(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_327(const chip::app::DataModel::Nullable & nullableEnum16) - { - VerifyOrReturn(CheckValueNonNull("nullableEnum16", nullableEnum16)); - VerifyOrReturn(CheckValue("nullableEnum16.Value()", nullableEnum16.Value(), 65534U)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableEnum16InvalidValue_328() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableEnum16Argument; - nullableEnum16Argument.SetNonNull() = 65535U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableEnum16Argument, this, OnSuccessCallback_328, OnFailureCallback_328)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_328(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_328() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeNullableEnum16UnchangedValue_329() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_329, OnFailureCallback_329)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_329(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_329(const chip::app::DataModel::Nullable & nullableEnum16) - { - VerifyOrReturn(CheckValueNonNull("nullableEnum16", nullableEnum16)); - VerifyOrReturn(CheckValue("nullableEnum16.Value()", nullableEnum16.Value(), 65534U)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableEnum16NullValue_330() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableEnum16Argument; - nullableEnum16Argument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableEnum16Argument, this, OnSuccessCallback_330, OnFailureCallback_330)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_330(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_330() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableEnum16NullValue_331() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_331, OnFailureCallback_331)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_331(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_331(const chip::app::DataModel::Nullable & nullableEnum16) - { - VerifyOrReturn(CheckValueNull("nullableEnum16", nullableEnum16)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableSimpleEnumMinValue_332() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableEnumAttrArgument; - nullableEnumAttrArgument.SetNonNull() = static_cast(0); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableEnumAttrArgument, this, OnSuccessCallback_332, OnFailureCallback_332)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_332(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_332() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableSimpleEnumMinValue_333() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_333, OnFailureCallback_333)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_333(EmberAfStatus status) { ThrowFailureResponse(); } - - void - OnSuccessResponse_333(const chip::app::DataModel::Nullable & nullableEnumAttr) - { - VerifyOrReturn(CheckValueNonNull("nullableEnumAttr", nullableEnumAttr)); - VerifyOrReturn(CheckValue("nullableEnumAttr.Value()", nullableEnumAttr.Value(), 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableSimpleEnumMaxValue_334() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableEnumAttrArgument; - nullableEnumAttrArgument.SetNonNull() = static_cast(254); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableEnumAttrArgument, this, OnSuccessCallback_334, OnFailureCallback_334)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_334(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_334() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableSimpleEnumMaxValue_335() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_335, OnFailureCallback_335)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_335(EmberAfStatus status) { ThrowFailureResponse(); } - - void - OnSuccessResponse_335(const chip::app::DataModel::Nullable & nullableEnumAttr) - { - VerifyOrReturn(CheckValueNonNull("nullableEnumAttr", nullableEnumAttr)); - VerifyOrReturn(CheckValue("nullableEnumAttr.Value()", nullableEnumAttr.Value(), 254)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableSimpleEnumInvalidValue_336() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableEnumAttrArgument; - nullableEnumAttrArgument.SetNonNull() = static_cast(255); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableEnumAttrArgument, this, OnSuccessCallback_336, OnFailureCallback_336)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_336(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_336() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeNullableSimpleEnumUnchangedValue_337() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_337, OnFailureCallback_337)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_337(EmberAfStatus status) { ThrowFailureResponse(); } - - void - OnSuccessResponse_337(const chip::app::DataModel::Nullable & nullableEnumAttr) - { - VerifyOrReturn(CheckValueNonNull("nullableEnumAttr", nullableEnumAttr)); - VerifyOrReturn(CheckValue("nullableEnumAttr.Value()", nullableEnumAttr.Value(), 254)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableSimpleEnumNullValue_338() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableEnumAttrArgument; - nullableEnumAttrArgument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableEnumAttrArgument, this, OnSuccessCallback_338, OnFailureCallback_338)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_338(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_338() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableSimpleEnumNullValue_339() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_339, OnFailureCallback_339)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_339(EmberAfStatus status) { ThrowFailureResponse(); } - - void - OnSuccessResponse_339(const chip::app::DataModel::Nullable & nullableEnumAttr) - { - VerifyOrReturn(CheckValueNull("nullableEnumAttr", nullableEnumAttr)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableOctetStringDefaultValue_340() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_340, OnFailureCallback_340)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_340(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_340(const chip::app::DataModel::Nullable & nullableOctetString) - { - VerifyOrReturn(CheckValueNonNull("nullableOctetString", nullableOctetString)); - VerifyOrReturn(CheckValueAsString("nullableOctetString.Value()", nullableOctetString.Value(), - chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableOctetString_341() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableOctetStringArgument; - nullableOctetStringArgument.SetNonNull() = - chip::ByteSpan(chip::Uint8::from_const_char("TestValuegarbage: not in length on purpose"), 9); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableOctetStringArgument, this, OnSuccessCallback_341, OnFailureCallback_341)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_341(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_341() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableOctetString_342() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_342, OnFailureCallback_342)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_342(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_342(const chip::app::DataModel::Nullable & nullableOctetString) - { - VerifyOrReturn(CheckValueNonNull("nullableOctetString", nullableOctetString)); - VerifyOrReturn(CheckValueAsString("nullableOctetString.Value()", nullableOctetString.Value(), - chip::ByteSpan(chip::Uint8::from_const_char("TestValue"), 9))); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableOctetString_343() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableOctetStringArgument; - nullableOctetStringArgument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableOctetStringArgument, this, OnSuccessCallback_343, OnFailureCallback_343)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_343(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_343() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableOctetString_344() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_344, OnFailureCallback_344)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_344(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_344(const chip::app::DataModel::Nullable & nullableOctetString) - { - VerifyOrReturn(CheckValueNull("nullableOctetString", nullableOctetString)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableOctetString_345() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableOctetStringArgument; - nullableOctetStringArgument.SetNonNull() = - chip::ByteSpan(chip::Uint8::from_const_char("garbage: not in length on purpose"), 0); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableOctetStringArgument, this, OnSuccessCallback_345, OnFailureCallback_345)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_345(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_345() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableOctetString_346() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_346, OnFailureCallback_346)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_346(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_346(const chip::app::DataModel::Nullable & nullableOctetString) - { - VerifyOrReturn(CheckValueNonNull("nullableOctetString", nullableOctetString)); - VerifyOrReturn(CheckValueAsString("nullableOctetString.Value()", nullableOctetString.Value(), - chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeNullableCharStringDefaultValue_347() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_347, OnFailureCallback_347)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_347(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_347(const chip::app::DataModel::Nullable & nullableCharString) - { - VerifyOrReturn(CheckValueNonNull("nullableCharString", nullableCharString)); - VerifyOrReturn(CheckValueAsString("nullableCharString.Value()", nullableCharString.Value(), chip::CharSpan("", 0))); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableCharString_348() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableCharStringArgument; - nullableCharStringArgument.SetNonNull() = chip::Span("☉T☉garbage: not in length on purpose", 7); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableCharStringArgument, this, OnSuccessCallback_348, OnFailureCallback_348)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_348(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_348() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableCharString_349() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_349, OnFailureCallback_349)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_349(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_349(const chip::app::DataModel::Nullable & nullableCharString) - { - VerifyOrReturn(CheckValueNonNull("nullableCharString", nullableCharString)); - VerifyOrReturn(CheckValueAsString("nullableCharString.Value()", nullableCharString.Value(), chip::CharSpan("☉T☉", 7))); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableCharStringValueTooLong_350() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableCharStringArgument; - nullableCharStringArgument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableCharStringArgument, this, OnSuccessCallback_350, OnFailureCallback_350)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_350(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_350() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableCharString_351() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_351, OnFailureCallback_351)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_351(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_351(const chip::app::DataModel::Nullable & nullableCharString) - { - VerifyOrReturn(CheckValueNull("nullableCharString", nullableCharString)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeNullableCharStringEmpty_352() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableCharStringArgument; - nullableCharStringArgument.SetNonNull() = chip::Span("garbage: not in length on purpose", 0); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableCharStringArgument, this, OnSuccessCallback_352, OnFailureCallback_352)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_352(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_352() { NextTest(); } - - CHIP_ERROR TestReadAttributeNullableCharString_353() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_353, OnFailureCallback_353)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_353(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_353(const chip::app::DataModel::Nullable & nullableCharString) - { - VerifyOrReturn(CheckValueNonNull("nullableCharString", nullableCharString)); - VerifyOrReturn(CheckValueAsString("nullableCharString.Value()", nullableCharString.Value(), chip::CharSpan("", 0))); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeFromNonexistentEndpoint_354() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 200; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_354, OnFailureCallback_354)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_354(EmberAfStatus status) - { - VerifyOrReturn(CheckConstraintNotValue("status", status, 0)); - NextTest(); - } - - void OnSuccessResponse_354(const chip::app::DataModel::DecodableList & listInt8u) { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeFromNonexistentCluster_355() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_355, OnFailureCallback_355)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_355(EmberAfStatus status) - { - VerifyOrReturn(CheckConstraintNotValue("status", status, 0)); - NextTest(); - } - - void OnSuccessResponse_355(const chip::app::DataModel::DecodableList & listInt8u) { ThrowSuccessResponse(); } - - CHIP_ERROR TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_356() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestSimpleOptionalArgumentRequest::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_356(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_356(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_356(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_INVALID_VALUE)); - NextTest(); - } - - void OnSuccessResponse_356() { ThrowSuccessResponse(); } - - CHIP_ERROR TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_357() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestSimpleOptionalArgumentRequest::Type; - - RequestType request; - request.arg1.Emplace() = 1; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_357(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_357(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_357(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_357() { NextTest(); } - - CHIP_ERROR TestReportSubscribeToListAttribute_358() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - mTest_TestCluster_list_int8u_Reported = OnSuccessCallback_358; - return WaitForMs(0); - } - - void OnFailureResponse_358(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_358(const chip::app::DataModel::DecodableList & listInt8u) - { - mReceivedReport_358 = true; - - auto iter = listInt8u.begin(); - VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 0)); - VerifyOrReturn(CheckValue("listInt8u[0]", iter.GetValue(), 1)); - VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 1)); - VerifyOrReturn(CheckValue("listInt8u[1]", iter.GetValue(), 2)); - VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 2)); - VerifyOrReturn(CheckValue("listInt8u[2]", iter.GetValue(), 3)); - VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 3)); - VerifyOrReturn(CheckValue("listInt8u[3]", iter.GetValue(), 4)); - VerifyOrReturn(CheckNoMoreListItems("listInt8u", iter, 4)); - } - - CHIP_ERROR TestSubscribeToListAttribute_359() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t minIntervalArgument; - minIntervalArgument = 2U; - uint16_t maxIntervalArgument; - maxIntervalArgument = 10U; - - ReturnErrorOnFailure(cluster.SubscribeAttribute( - this, OnSuccessCallback_359, OnFailureCallback_359, minIntervalArgument, maxIntervalArgument, - OnSubscriptionEstablished_359)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_359(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_359(const chip::app::DataModel::DecodableList & value) - { - if (mTest_TestCluster_list_int8u_Reported) - { - auto callback = mTest_TestCluster_list_int8u_Reported; - mTest_TestCluster_list_int8u_Reported = nullptr; - callback(this, value); - } - } - - void OnSubscriptionEstablishedResponse_359() - { - VerifyOrReturn(mReceivedReport_358, Exit("Initial report not received!")); - NextTest(); - } - - CHIP_ERROR TestWriteSubscribedToListAttribute_360() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::List listInt8uArgument; - - uint8_t listInt8uList[4]; - listInt8uList[0] = 5; - listInt8uList[1] = 6; - listInt8uList[2] = 7; - listInt8uList[3] = 8; - listInt8uArgument = listInt8uList; - - ReturnErrorOnFailure(cluster.WriteAttribute( - listInt8uArgument, this, OnSuccessCallback_360, OnFailureCallback_360)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_360(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_360() { NextTest(); } - - CHIP_ERROR TestCheckForListAttributeReport_361() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - mTest_TestCluster_list_int8u_Reported = OnSuccessCallback_361; - return CHIP_NO_ERROR; - } - - void OnFailureResponse_361(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_361(const chip::app::DataModel::DecodableList & listInt8u) - { - mReceivedReport_361 = true; - - auto iter = listInt8u.begin(); - VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 0)); - VerifyOrReturn(CheckValue("listInt8u[0]", iter.GetValue(), 5)); - VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 1)); - VerifyOrReturn(CheckValue("listInt8u[1]", iter.GetValue(), 6)); - VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 2)); - VerifyOrReturn(CheckValue("listInt8u[2]", iter.GetValue(), 7)); - VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 3)); - VerifyOrReturn(CheckValue("listInt8u[3]", iter.GetValue(), 8)); - VerifyOrReturn(CheckNoMoreListItems("listInt8u", iter, 4)); - - NextTest(); - } - - CHIP_ERROR TestReadRangeRestrictedUnsigned8BitInteger_362() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_362, OnFailureCallback_362)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_362(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_362(uint8_t rangeRestrictedInt8u) - { - VerifyOrReturn(CheckValue("rangeRestrictedInt8u", rangeRestrictedInt8u, 70)); - - NextTest(); - } - - CHIP_ERROR TestWriteMinValueToARangeRestrictedUnsigned8BitInteger_363() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = 0; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt8uArgument, this, OnSuccessCallback_363, OnFailureCallback_363)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_363(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_363() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedUnsigned8BitInteger_364() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = 19; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt8uArgument, this, OnSuccessCallback_364, OnFailureCallback_364)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_364(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_364() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedUnsigned8BitInteger_365() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = 101; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt8uArgument, this, OnSuccessCallback_365, OnFailureCallback_365)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_365(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_365() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteMaxValueToARangeRestrictedUnsigned8BitInteger_366() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = 255; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt8uArgument, this, OnSuccessCallback_366, OnFailureCallback_366)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_366(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_366() { ThrowSuccessResponse(); } - - CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_367() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_367, OnFailureCallback_367)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_367(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_367(uint8_t rangeRestrictedInt8u) - { - VerifyOrReturn(CheckValue("rangeRestrictedInt8u", rangeRestrictedInt8u, 70)); - - NextTest(); - } - - CHIP_ERROR TestWriteMinValidValueToARangeRestrictedUnsigned8BitInteger_368() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = 20; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt8uArgument, this, OnSuccessCallback_368, OnFailureCallback_368)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_368(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_368() { NextTest(); } - - CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_369() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_369, OnFailureCallback_369)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_369(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_369(uint8_t rangeRestrictedInt8u) - { - VerifyOrReturn(CheckValue("rangeRestrictedInt8u", rangeRestrictedInt8u, 20)); - - NextTest(); - } - - CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedUnsigned8BitInteger_370() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = 100; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt8uArgument, this, OnSuccessCallback_370, OnFailureCallback_370)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_370(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_370() { NextTest(); } - - CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_371() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_371, OnFailureCallback_371)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_371(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_371(uint8_t rangeRestrictedInt8u) - { - VerifyOrReturn(CheckValue("rangeRestrictedInt8u", rangeRestrictedInt8u, 100)); - - NextTest(); - } - - CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedUnsigned8BitInteger_372() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t rangeRestrictedInt8uArgument; - rangeRestrictedInt8uArgument = 50; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt8uArgument, this, OnSuccessCallback_372, OnFailureCallback_372)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_372(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_372() { NextTest(); } - - CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_373() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_373, OnFailureCallback_373)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_373(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_373(uint8_t rangeRestrictedInt8u) - { - VerifyOrReturn(CheckValue("rangeRestrictedInt8u", rangeRestrictedInt8u, 50)); - - NextTest(); - } - - CHIP_ERROR TestReadRangeRestrictedUnsigned16BitInteger_374() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_374, OnFailureCallback_374)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_374(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_374(uint16_t rangeRestrictedInt16u) - { - VerifyOrReturn(CheckValue("rangeRestrictedInt16u", rangeRestrictedInt16u, 200U)); - - NextTest(); - } - - CHIP_ERROR TestWriteMinValueToARangeRestrictedUnsigned16BitInteger_375() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = 0U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt16uArgument, this, OnSuccessCallback_375, OnFailureCallback_375)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_375(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_375() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedUnsigned16BitInteger_376() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = 99U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt16uArgument, this, OnSuccessCallback_376, OnFailureCallback_376)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_376(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_376() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedUnsigned16BitInteger_377() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = 1001U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt16uArgument, this, OnSuccessCallback_377, OnFailureCallback_377)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_377(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_377() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteMaxValueToARangeRestrictedUnsigned16BitInteger_378() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = 65535U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt16uArgument, this, OnSuccessCallback_378, OnFailureCallback_378)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_378(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_378() { ThrowSuccessResponse(); } - - CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_379() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_379, OnFailureCallback_379)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_379(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_379(uint16_t rangeRestrictedInt16u) - { - VerifyOrReturn(CheckValue("rangeRestrictedInt16u", rangeRestrictedInt16u, 200U)); - - NextTest(); - } - - CHIP_ERROR TestWriteMinValidValueToARangeRestrictedUnsigned16BitInteger_380() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = 100U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt16uArgument, this, OnSuccessCallback_380, OnFailureCallback_380)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_380(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_380() { NextTest(); } - - CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_381() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_381, OnFailureCallback_381)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_381(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_381(uint16_t rangeRestrictedInt16u) - { - VerifyOrReturn(CheckValue("rangeRestrictedInt16u", rangeRestrictedInt16u, 100U)); - - NextTest(); - } - - CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedUnsigned16BitInteger_382() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = 1000U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt16uArgument, this, OnSuccessCallback_382, OnFailureCallback_382)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_382(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_382() { NextTest(); } - - CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_383() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_383, OnFailureCallback_383)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_383(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_383(uint16_t rangeRestrictedInt16u) - { - VerifyOrReturn(CheckValue("rangeRestrictedInt16u", rangeRestrictedInt16u, 1000U)); - - NextTest(); - } - - CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedUnsigned16BitInteger_384() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t rangeRestrictedInt16uArgument; - rangeRestrictedInt16uArgument = 500U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt16uArgument, this, OnSuccessCallback_384, OnFailureCallback_384)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_384(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_384() { NextTest(); } - - CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_385() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_385, OnFailureCallback_385)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_385(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_385(uint16_t rangeRestrictedInt16u) - { - VerifyOrReturn(CheckValue("rangeRestrictedInt16u", rangeRestrictedInt16u, 500U)); - - NextTest(); - } - - CHIP_ERROR TestReadRangeRestrictedSigned8BitInteger_386() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_386, OnFailureCallback_386)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_386(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_386(int8_t rangeRestrictedInt8s) - { - VerifyOrReturn(CheckValue("rangeRestrictedInt8s", rangeRestrictedInt8s, 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteMinValueToARangeRestrictedSigned8BitInteger_387() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int8_t rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = -128; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt8sArgument, this, OnSuccessCallback_387, OnFailureCallback_387)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_387(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_387() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedSigned8BitInteger_388() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int8_t rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = -41; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt8sArgument, this, OnSuccessCallback_388, OnFailureCallback_388)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_388(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_388() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedSigned8BitInteger_389() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int8_t rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = 51; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt8sArgument, this, OnSuccessCallback_389, OnFailureCallback_389)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_389(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_389() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteMaxValueToARangeRestrictedSigned8BitInteger_390() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int8_t rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = 127; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt8sArgument, this, OnSuccessCallback_390, OnFailureCallback_390)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_390(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_390() { ThrowSuccessResponse(); } - - CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueHasNotChanged_391() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_391, OnFailureCallback_391)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_391(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_391(int8_t rangeRestrictedInt8s) - { - VerifyOrReturn(CheckValue("rangeRestrictedInt8s", rangeRestrictedInt8s, 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteMinValidValueToARangeRestrictedSigned8BitInteger_392() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int8_t rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = -40; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt8sArgument, this, OnSuccessCallback_392, OnFailureCallback_392)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_392(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_392() { NextTest(); } - - CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMinValid_393() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_393, OnFailureCallback_393)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_393(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_393(int8_t rangeRestrictedInt8s) - { - VerifyOrReturn(CheckValue("rangeRestrictedInt8s", rangeRestrictedInt8s, -40)); - - NextTest(); - } - - CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedSigned8BitInteger_394() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int8_t rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = 50; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt8sArgument, this, OnSuccessCallback_394, OnFailureCallback_394)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_394(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_394() { NextTest(); } - - CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_395() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_395, OnFailureCallback_395)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_395(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_395(int8_t rangeRestrictedInt8s) - { - VerifyOrReturn(CheckValue("rangeRestrictedInt8s", rangeRestrictedInt8s, 50)); - - NextTest(); - } - - CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedSigned8BitInteger_396() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int8_t rangeRestrictedInt8sArgument; - rangeRestrictedInt8sArgument = 6; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt8sArgument, this, OnSuccessCallback_396, OnFailureCallback_396)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_396(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_396() { NextTest(); } - - CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMidValid_397() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_397, OnFailureCallback_397)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_397(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_397(int8_t rangeRestrictedInt8s) - { - VerifyOrReturn(CheckValue("rangeRestrictedInt8s", rangeRestrictedInt8s, 6)); - - NextTest(); - } - - CHIP_ERROR TestReadRangeRestrictedSigned16BitInteger_398() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_398, OnFailureCallback_398)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_398(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_398(int16_t rangeRestrictedInt16s) - { - VerifyOrReturn(CheckValue("rangeRestrictedInt16s", rangeRestrictedInt16s, 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteMinValueToARangeRestrictedSigned16BitInteger_399() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = -32768; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt16sArgument, this, OnSuccessCallback_399, OnFailureCallback_399)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_399(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_399() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedSigned16BitInteger_400() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = -151; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt16sArgument, this, OnSuccessCallback_400, OnFailureCallback_400)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_400(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_400() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedSigned16BitInteger_401() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = 201; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt16sArgument, this, OnSuccessCallback_401, OnFailureCallback_401)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_401(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_401() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteMaxValueToARangeRestrictedSigned16BitInteger_402() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = 32767; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt16sArgument, this, OnSuccessCallback_402, OnFailureCallback_402)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_402(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_402() { ThrowSuccessResponse(); } - - CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueHasNotChanged_403() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_403, OnFailureCallback_403)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_403(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_403(int16_t rangeRestrictedInt16s) - { - VerifyOrReturn(CheckValue("rangeRestrictedInt16s", rangeRestrictedInt16s, 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteMinValidValueToARangeRestrictedSigned16BitInteger_404() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = -150; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt16sArgument, this, OnSuccessCallback_404, OnFailureCallback_404)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_404(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_404() { NextTest(); } - - CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMinValid_405() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_405, OnFailureCallback_405)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_405(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_405(int16_t rangeRestrictedInt16s) - { - VerifyOrReturn(CheckValue("rangeRestrictedInt16s", rangeRestrictedInt16s, -150)); - - NextTest(); - } - - CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedSigned16BitInteger_406() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = 200; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt16sArgument, this, OnSuccessCallback_406, OnFailureCallback_406)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_406(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_406() { NextTest(); } - - CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_407() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_407, OnFailureCallback_407)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_407(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_407(int16_t rangeRestrictedInt16s) - { - VerifyOrReturn(CheckValue("rangeRestrictedInt16s", rangeRestrictedInt16s, 200)); - - NextTest(); - } - - CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedSigned16BitInteger_408() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t rangeRestrictedInt16sArgument; - rangeRestrictedInt16sArgument = 7; - - ReturnErrorOnFailure(cluster.WriteAttribute( - rangeRestrictedInt16sArgument, this, OnSuccessCallback_408, OnFailureCallback_408)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_408(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_408() { NextTest(); } - - CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMidValid_409() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_409, OnFailureCallback_409)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_409(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_409(int16_t rangeRestrictedInt16s) - { - VerifyOrReturn(CheckValue("rangeRestrictedInt16s", rangeRestrictedInt16s, 7)); - - NextTest(); - } - - CHIP_ERROR TestReadNullableRangeRestrictedUnsigned8BitInteger_410() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_410, OnFailureCallback_410)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_410(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_410(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) - { - VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8u", nullableRangeRestrictedInt8u)); - VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8u.Value()", nullableRangeRestrictedInt8u.Value(), 70)); - - NextTest(); - } - - CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedUnsigned8BitInteger_411() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument.SetNonNull() = 0; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt8uArgument, this, OnSuccessCallback_411, OnFailureCallback_411)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_411(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_411() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned8BitInteger_412() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument.SetNonNull() = 19; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt8uArgument, this, OnSuccessCallback_412, OnFailureCallback_412)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_412(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_412() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned8BitInteger_413() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument.SetNonNull() = 101; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt8uArgument, this, OnSuccessCallback_413, OnFailureCallback_413)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_413(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_413() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedUnsigned8BitInteger_414() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument.SetNonNull() = 254; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt8uArgument, this, OnSuccessCallback_414, OnFailureCallback_414)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_414(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_414() { ThrowSuccessResponse(); } - - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_415() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_415, OnFailureCallback_415)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_415(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_415(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) - { - VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8u", nullableRangeRestrictedInt8u)); - VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8u.Value()", nullableRangeRestrictedInt8u.Value(), 70)); - - NextTest(); - } - - CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedUnsigned8BitInteger_416() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument.SetNonNull() = 20; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt8uArgument, this, OnSuccessCallback_416, OnFailureCallback_416)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_416(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_416() { NextTest(); } - - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_417() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_417, OnFailureCallback_417)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_417(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_417(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) - { - VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8u", nullableRangeRestrictedInt8u)); - VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8u.Value()", nullableRangeRestrictedInt8u.Value(), 20)); - - NextTest(); - } - - CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedUnsigned8BitInteger_418() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument.SetNonNull() = 100; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt8uArgument, this, OnSuccessCallback_418, OnFailureCallback_418)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_418(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_418() { NextTest(); } - - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_419() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_419, OnFailureCallback_419)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_419(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_419(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) - { - VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8u", nullableRangeRestrictedInt8u)); - VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8u.Value()", nullableRangeRestrictedInt8u.Value(), 100)); - - NextTest(); - } - - CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned8BitInteger_420() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument.SetNonNull() = 50; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt8uArgument, this, OnSuccessCallback_420, OnFailureCallback_420)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_420(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_420() { NextTest(); } - - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_421() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_421, OnFailureCallback_421)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_421(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_421(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) - { - VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8u", nullableRangeRestrictedInt8u)); - VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8u.Value()", nullableRangeRestrictedInt8u.Value(), 50)); - - NextTest(); - } - - CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedUnsigned8BitInteger_422() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt8uArgument; - nullableRangeRestrictedInt8uArgument.SetNull(); - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt8uArgument, this, OnSuccessCallback_422, OnFailureCallback_422)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_422(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_422() { NextTest(); } - - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsNull_423() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_423, OnFailureCallback_423)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_423(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_423(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) - { - VerifyOrReturn(CheckValueNull("nullableRangeRestrictedInt8u", nullableRangeRestrictedInt8u)); - - NextTest(); - } - - CHIP_ERROR TestReadNullableRangeRestrictedUnsigned16BitInteger_424() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_424, OnFailureCallback_424)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_424(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_424(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) - { - VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16u", nullableRangeRestrictedInt16u)); - VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16u.Value()", nullableRangeRestrictedInt16u.Value(), 200U)); - - NextTest(); - } - - CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedUnsigned16BitInteger_425() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument.SetNonNull() = 0U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt16uArgument, this, OnSuccessCallback_425, OnFailureCallback_425)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_425(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_425() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned16BitInteger_426() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument.SetNonNull() = 99U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt16uArgument, this, OnSuccessCallback_426, OnFailureCallback_426)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_426(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_426() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned16BitInteger_427() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument.SetNonNull() = 1001U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt16uArgument, this, OnSuccessCallback_427, OnFailureCallback_427)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_427(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_427() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedUnsigned16BitInteger_428() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument.SetNonNull() = 65534U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt16uArgument, this, OnSuccessCallback_428, OnFailureCallback_428)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_428(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_428() { ThrowSuccessResponse(); } - - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_429() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_429, OnFailureCallback_429)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_429(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_429(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) - { - VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16u", nullableRangeRestrictedInt16u)); - VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16u.Value()", nullableRangeRestrictedInt16u.Value(), 200U)); - - NextTest(); - } - - CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedUnsigned16BitInteger_430() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument.SetNonNull() = 100U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt16uArgument, this, OnSuccessCallback_430, OnFailureCallback_430)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_430(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_430() { NextTest(); } - - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_431() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_431, OnFailureCallback_431)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_431(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_431(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) - { - VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16u", nullableRangeRestrictedInt16u)); - VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16u.Value()", nullableRangeRestrictedInt16u.Value(), 100U)); - - NextTest(); - } - - CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedUnsigned16BitInteger_432() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument.SetNonNull() = 1000U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt16uArgument, this, OnSuccessCallback_432, OnFailureCallback_432)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_432(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_432() { NextTest(); } - - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_433() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_433, OnFailureCallback_433)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_433(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_433(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) - { - VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16u", nullableRangeRestrictedInt16u)); - VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16u.Value()", nullableRangeRestrictedInt16u.Value(), 1000U)); - - NextTest(); - } - - CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned16BitInteger_434() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument.SetNonNull() = 500U; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt16uArgument, this, OnSuccessCallback_434, OnFailureCallback_434)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_434(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_434() { NextTest(); } - - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_435() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_435, OnFailureCallback_435)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_435(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_435(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) - { - VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16u", nullableRangeRestrictedInt16u)); - VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16u.Value()", nullableRangeRestrictedInt16u.Value(), 500U)); - - NextTest(); - } - - CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedUnsigned16BitInteger_436() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt16uArgument; - nullableRangeRestrictedInt16uArgument.SetNull(); - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt16uArgument, this, OnSuccessCallback_436, OnFailureCallback_436)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_436(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_436() { NextTest(); } - - CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsNull_437() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_437, OnFailureCallback_437)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_437(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_437(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) - { - VerifyOrReturn(CheckValueNull("nullableRangeRestrictedInt16u", nullableRangeRestrictedInt16u)); - - NextTest(); - } - - CHIP_ERROR TestReadNullableRangeRestrictedSigned8BitInteger_438() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_438, OnFailureCallback_438)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_438(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_438(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) - { - VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8s", nullableRangeRestrictedInt8s)); - VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8s.Value()", nullableRangeRestrictedInt8s.Value(), 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedSigned8BitInteger_439() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument.SetNonNull() = -127; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt8sArgument, this, OnSuccessCallback_439, OnFailureCallback_439)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_439(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_439() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned8BitInteger_440() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument.SetNonNull() = -41; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt8sArgument, this, OnSuccessCallback_440, OnFailureCallback_440)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_440(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_440() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned8BitInteger_441() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument.SetNonNull() = 51; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt8sArgument, this, OnSuccessCallback_441, OnFailureCallback_441)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_441(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_441() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedSigned8BitInteger_442() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument.SetNonNull() = 127; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt8sArgument, this, OnSuccessCallback_442, OnFailureCallback_442)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_442(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_442() { ThrowSuccessResponse(); } - - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueHasNotChanged_443() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_443, OnFailureCallback_443)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_443(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_443(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) - { - VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8s", nullableRangeRestrictedInt8s)); - VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8s.Value()", nullableRangeRestrictedInt8s.Value(), 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedSigned8BitInteger_444() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument.SetNonNull() = -40; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt8sArgument, this, OnSuccessCallback_444, OnFailureCallback_444)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_444(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_444() { NextTest(); } - - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMinValid_445() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_445, OnFailureCallback_445)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_445(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_445(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) - { - VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8s", nullableRangeRestrictedInt8s)); - VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8s.Value()", nullableRangeRestrictedInt8s.Value(), -40)); - - NextTest(); - } - - CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedSigned8BitInteger_446() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument.SetNonNull() = 50; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt8sArgument, this, OnSuccessCallback_446, OnFailureCallback_446)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_446(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_446() { NextTest(); } - - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_447() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_447, OnFailureCallback_447)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_447(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_447(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) - { - VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8s", nullableRangeRestrictedInt8s)); - VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8s.Value()", nullableRangeRestrictedInt8s.Value(), 50)); - - NextTest(); - } - - CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedSigned8BitInteger_448() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument.SetNonNull() = 6; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt8sArgument, this, OnSuccessCallback_448, OnFailureCallback_448)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_448(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_448() { NextTest(); } - - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMidValid_449() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_449, OnFailureCallback_449)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_449(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_449(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) - { - VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8s", nullableRangeRestrictedInt8s)); - VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8s.Value()", nullableRangeRestrictedInt8s.Value(), 6)); - - NextTest(); - } - - CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedSigned8BitInteger_450() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt8sArgument; - nullableRangeRestrictedInt8sArgument.SetNull(); - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt8sArgument, this, OnSuccessCallback_450, OnFailureCallback_450)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_450(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_450() { NextTest(); } - - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtNull_451() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_451, OnFailureCallback_451)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_451(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_451(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) - { - VerifyOrReturn(CheckValueNull("nullableRangeRestrictedInt8s", nullableRangeRestrictedInt8s)); - - NextTest(); - } - - CHIP_ERROR TestReadNullableRangeRestrictedSigned16BitInteger_452() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_452, OnFailureCallback_452)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_452(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_452(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) - { - VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16s", nullableRangeRestrictedInt16s)); - VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16s.Value()", nullableRangeRestrictedInt16s.Value(), 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedSigned16BitInteger_453() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument.SetNonNull() = -32767; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt16sArgument, this, OnSuccessCallback_453, OnFailureCallback_453)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_453(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_453() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned16BitInteger_454() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument.SetNonNull() = -151; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt16sArgument, this, OnSuccessCallback_454, OnFailureCallback_454)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_454(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_454() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned16BitInteger_455() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument.SetNonNull() = 201; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt16sArgument, this, OnSuccessCallback_455, OnFailureCallback_455)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_455(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_455() { ThrowSuccessResponse(); } - - CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedSigned16BitInteger_456() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument.SetNonNull() = 32767; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt16sArgument, this, OnSuccessCallback_456, OnFailureCallback_456)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_456(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_456() { ThrowSuccessResponse(); } - - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueHasNotChanged_457() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_457, OnFailureCallback_457)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_457(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_457(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) - { - VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16s", nullableRangeRestrictedInt16s)); - VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16s.Value()", nullableRangeRestrictedInt16s.Value(), 0)); - - NextTest(); - } - - CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedSigned16BitInteger_458() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument.SetNonNull() = -150; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt16sArgument, this, OnSuccessCallback_458, OnFailureCallback_458)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_458(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_458() { NextTest(); } - - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMinValid_459() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_459, OnFailureCallback_459)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_459(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_459(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) - { - VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16s", nullableRangeRestrictedInt16s)); - VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16s.Value()", nullableRangeRestrictedInt16s.Value(), -150)); - - NextTest(); - } - - CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedSigned16BitInteger_460() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument.SetNonNull() = 200; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt16sArgument, this, OnSuccessCallback_460, OnFailureCallback_460)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_460(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_460() { NextTest(); } - - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_461() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_461, OnFailureCallback_461)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_461(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_461(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) - { - VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16s", nullableRangeRestrictedInt16s)); - VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16s.Value()", nullableRangeRestrictedInt16s.Value(), 200)); - - NextTest(); - } - - CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedSigned16BitInteger_462() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument.SetNonNull() = 7; - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt16sArgument, this, OnSuccessCallback_462, OnFailureCallback_462)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_462(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_462() { NextTest(); } - - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMidValid_463() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_463, OnFailureCallback_463)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_463(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_463(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) - { - VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16s", nullableRangeRestrictedInt16s)); - VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16s.Value()", nullableRangeRestrictedInt16s.Value(), 7)); - - NextTest(); - } - - CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedSigned16BitInteger_464() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::DataModel::Nullable nullableRangeRestrictedInt16sArgument; - nullableRangeRestrictedInt16sArgument.SetNull(); - - ReturnErrorOnFailure( - cluster.WriteAttribute( - nullableRangeRestrictedInt16sArgument, this, OnSuccessCallback_464, OnFailureCallback_464)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_464(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_464() { NextTest(); } - - CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsNull_465() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_465, OnFailureCallback_465)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_465(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_465(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) - { - VerifyOrReturn(CheckValueNull("nullableRangeRestrictedInt16s", nullableRangeRestrictedInt16s)); - - NextTest(); - } -}; - -class TestClusterComplexTypes : public TestCommand -{ -public: - TestClusterComplexTypes() : TestCommand("TestClusterComplexTypes"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: TestClusterComplexTypes\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: TestClusterComplexTypes\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 Command with optional arg set to null.\n"); - err = TestSendTestCommandWithOptionalArgSetToNull_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Send command that needs timed invoke without a timeout value\n"); - err = TestSendCommandThatNeedsTimedInvokeWithoutATimeoutValue_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Send command that needs timed invoke with a long timeout value\n"); - err = TestSendCommandThatNeedsTimedInvokeWithALongTimeoutValue_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Send command that needs timed invoke with a too-short timeout value\n"); - err = TestSendCommandThatNeedsTimedInvokeWithATooShortTimeoutValue_4(); - break; - case 5: - ChipLogProgress(chipTool, - " ***** Test Step 5 : Send command that does not need timed invoke with a long timeout value\n"); - err = TestSendCommandThatDoesNotNeedTimedInvokeWithALongTimeoutValue_5(); - break; - case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : Send command that does not need timed invoke with a too-short timeout value\n"); - err = TestSendCommandThatDoesNotNeedTimedInvokeWithATooShortTimeoutValue_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read attribute that needs timed write initial state\n"); - err = TestReadAttributeThatNeedsTimedWriteInitialState_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Write attribute that needs timed write without a timeout value\n"); - err = TestWriteAttributeThatNeedsTimedWriteWithoutATimeoutValue_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read attribute that needs timed write state unchanged 1\n"); - err = TestReadAttributeThatNeedsTimedWriteStateUnchanged1_9(); - break; - case 10: - ChipLogProgress(chipTool, - " ***** Test Step 10 : Write attribute that needs timed write with a too-short timeout value\n"); - err = TestWriteAttributeThatNeedsTimedWriteWithATooShortTimeoutValue_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Read attribute that needs timed write state unchanged 2\n"); - err = TestReadAttributeThatNeedsTimedWriteStateUnchanged2_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Write attribute that needs timed write with a long timeout value\n"); - err = TestWriteAttributeThatNeedsTimedWriteWithALongTimeoutValue_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Read attribute that needs timed write state changed\n"); - err = TestReadAttributeThatNeedsTimedWriteStateChanged_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Write attribute that needs timed write reset to default\n"); - err = TestWriteAttributeThatNeedsTimedWriteResetToDefault_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Read attribute that does not need timed write initial value\n"); - err = TestReadAttributeThatDoesNotNeedTimedWriteInitialValue_15(); - break; - case 16: - ChipLogProgress( - chipTool, " ***** Test Step 16 : Write attribute that does not need timed write with a too-short timeout value\n"); - err = TestWriteAttributeThatDoesNotNeedTimedWriteWithATooShortTimeoutValue_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Read attribute that does not need timed write unchanged value\n"); - err = TestReadAttributeThatDoesNotNeedTimedWriteUnchangedValue_17(); - break; - case 18: - ChipLogProgress(chipTool, - " ***** Test Step 18 : Write attribute that does not need timed write with a long timeout value\n"); - err = TestWriteAttributeThatDoesNotNeedTimedWriteWithALongTimeoutValue_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Read attribute that does not need timed write changed value\n"); - err = TestReadAttributeThatDoesNotNeedTimedWriteChangedValue_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Write attribute that does not need timed write reset to default\n"); - err = TestWriteAttributeThatDoesNotNeedTimedWriteResetToDefault_20(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 21; - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, bool timedWriteBoolean) - { - (static_cast(context))->OnSuccessResponse_7(timedWriteBoolean); - } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } - - static void OnFailureCallback_9(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context, bool timedWriteBoolean) - { - (static_cast(context))->OnSuccessResponse_9(timedWriteBoolean); - } - - static void OnFailureCallback_10(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_10(status); - } - - static void OnSuccessCallback_10(void * context) { (static_cast(context))->OnSuccessResponse_10(); } - - static void OnFailureCallback_11(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_11(status); - } - - static void OnSuccessCallback_11(void * context, bool timedWriteBoolean) - { - (static_cast(context))->OnSuccessResponse_11(timedWriteBoolean); - } - - static void OnFailureCallback_12(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_12(status); - } - - static void OnSuccessCallback_12(void * context) { (static_cast(context))->OnSuccessResponse_12(); } - - static void OnFailureCallback_13(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_13(status); - } - - static void OnSuccessCallback_13(void * context, bool timedWriteBoolean) - { - (static_cast(context))->OnSuccessResponse_13(timedWriteBoolean); - } - - static void OnFailureCallback_14(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_14(status); - } - - static void OnSuccessCallback_14(void * context) { (static_cast(context))->OnSuccessResponse_14(); } - - static void OnFailureCallback_15(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_15(status); - } - - static void OnSuccessCallback_15(void * context, bool boolean) - { - (static_cast(context))->OnSuccessResponse_15(boolean); - } - - static void OnFailureCallback_16(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_16(status); - } - - static void OnSuccessCallback_16(void * context) { (static_cast(context))->OnSuccessResponse_16(); } - - static void OnFailureCallback_17(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_17(status); - } - - static void OnSuccessCallback_17(void * context, bool boolean) - { - (static_cast(context))->OnSuccessResponse_17(boolean); - } - - static void OnFailureCallback_18(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_18(status); - } - - static void OnSuccessCallback_18(void * context) { (static_cast(context))->OnSuccessResponse_18(); } - - static void OnFailureCallback_19(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_19(status); - } - - static void OnSuccessCallback_19(void * context, bool boolean) - { - (static_cast(context))->OnSuccessResponse_19(boolean); - } - - static void OnFailureCallback_20(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_20(status); - } - - static void OnSuccessCallback_20(void * context) { (static_cast(context))->OnSuccessResponse_20(); } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestSendTestCommandWithOptionalArgSetToNull_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type; - - RequestType request; - request.arg1.Emplace().SetNull(); - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context)) - ->OnSuccessResponse_1(data.wasPresent, data.wasNull, data.value, data.originalValue); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(bool wasPresent, const chip::Optional & wasNull, const chip::Optional & value, - const chip::Optional> & originalValue) - { - VerifyOrReturn(CheckValue("wasPresent", wasPresent, true)); - - VerifyOrReturn(CheckValuePresent("wasNull", wasNull)); - VerifyOrReturn(CheckValue("wasNull.Value()", wasNull.Value(), true)); - - VerifyOrReturn(CheckValuePresent("originalValue", originalValue)); - VerifyOrReturn(CheckValueNull("originalValue.Value()", originalValue.Value())); - - NextTest(); - } - - CHIP_ERROR TestSendCommandThatNeedsTimedInvokeWithoutATimeoutValue_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TimedInvokeRequest::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_2(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_2(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request, - chip::NullOptional)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_NEEDS_TIMED_INTERACTION)); - NextTest(); - } - - void OnSuccessResponse_2() { ThrowSuccessResponse(); } - - CHIP_ERROR TestSendCommandThatNeedsTimedInvokeWithALongTimeoutValue_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TimedInvokeRequest::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure( - chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request, 10000)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestSendCommandThatNeedsTimedInvokeWithATooShortTimeoutValue_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TimedInvokeRequest::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure( - chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request, 1)); - { - using namespace chip::System::Clock::Literals; - // Busy-wait for 100 milliseconds. - auto & clock = chip::System::SystemClock(); - auto start = clock.GetMonotonicTimestamp(); - while (clock.GetMonotonicTimestamp() - start < 100_ms) - ; - } - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); - NextTest(); - } - - void OnSuccessResponse_4() { ThrowSuccessResponse(); } - - CHIP_ERROR TestSendCommandThatDoesNotNeedTimedInvokeWithALongTimeoutValue_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::Test::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_5(status); - }; - - ReturnErrorOnFailure( - chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request, 10000)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestSendCommandThatDoesNotNeedTimedInvokeWithATooShortTimeoutValue_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::Test::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_6(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_6(status); - }; - - ReturnErrorOnFailure( - chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request, 1)); - { - using namespace chip::System::Clock::Literals; - // Busy-wait for 100 milliseconds. - auto & clock = chip::System::SystemClock(); - auto start = clock.GetMonotonicTimestamp(); - while (clock.GetMonotonicTimestamp() - start < 100_ms) - ; - } - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); - NextTest(); - } - - void OnSuccessResponse_6() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeThatNeedsTimedWriteInitialState_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(bool timedWriteBoolean) - { - VerifyOrReturn(CheckValue("timedWriteBoolean", timedWriteBoolean, false)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeThatNeedsTimedWriteWithoutATimeoutValue_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - bool timedWriteBooleanArgument; - timedWriteBooleanArgument = true; - - ReturnErrorOnFailure(cluster.WriteAttribute( - timedWriteBooleanArgument, this, OnSuccessCallback_8, OnFailureCallback_8, chip::NullOptional)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_NEEDS_TIMED_INTERACTION)); - NextTest(); - } - - void OnSuccessResponse_8() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeThatNeedsTimedWriteStateUnchanged1_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9(bool timedWriteBoolean) - { - VerifyOrReturn(CheckValue("timedWriteBoolean", timedWriteBoolean, false)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeThatNeedsTimedWriteWithATooShortTimeoutValue_10() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - bool timedWriteBooleanArgument; - timedWriteBooleanArgument = true; - - ReturnErrorOnFailure(cluster.WriteAttribute( - timedWriteBooleanArgument, this, OnSuccessCallback_10, OnFailureCallback_10, 1)); - { - using namespace chip::System::Clock::Literals; - // Busy-wait for 100 milliseconds. - auto & clock = chip::System::SystemClock(); - auto start = clock.GetMonotonicTimestamp(); - while (clock.GetMonotonicTimestamp() - start < 100_ms) - ; - } - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); - NextTest(); - } - - void OnSuccessResponse_10() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeThatNeedsTimedWriteStateUnchanged2_11() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_11, OnFailureCallback_11)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_11(bool timedWriteBoolean) - { - VerifyOrReturn(CheckValue("timedWriteBoolean", timedWriteBoolean, false)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeThatNeedsTimedWriteWithALongTimeoutValue_12() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - bool timedWriteBooleanArgument; - timedWriteBooleanArgument = true; - - ReturnErrorOnFailure(cluster.WriteAttribute( - timedWriteBooleanArgument, this, OnSuccessCallback_12, OnFailureCallback_12, 10000)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_12(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_12() { NextTest(); } - - CHIP_ERROR TestReadAttributeThatNeedsTimedWriteStateChanged_13() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_13, OnFailureCallback_13)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_13(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_13(bool timedWriteBoolean) - { - VerifyOrReturn(CheckValue("timedWriteBoolean", timedWriteBoolean, true)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeThatNeedsTimedWriteResetToDefault_14() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - bool timedWriteBooleanArgument; - timedWriteBooleanArgument = false; - - ReturnErrorOnFailure(cluster.WriteAttribute( - timedWriteBooleanArgument, this, OnSuccessCallback_14, OnFailureCallback_14, 10000)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_14(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_14() { NextTest(); } - - CHIP_ERROR TestReadAttributeThatDoesNotNeedTimedWriteInitialValue_15() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_15, OnFailureCallback_15)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_15(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_15(bool boolean) - { - VerifyOrReturn(CheckValue("boolean", boolean, false)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeThatDoesNotNeedTimedWriteWithATooShortTimeoutValue_16() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - bool booleanArgument; - booleanArgument = true; - - ReturnErrorOnFailure(cluster.WriteAttribute( - booleanArgument, this, OnSuccessCallback_16, OnFailureCallback_16, 1)); - { - using namespace chip::System::Clock::Literals; - // Busy-wait for 100 milliseconds. - auto & clock = chip::System::SystemClock(); - auto start = clock.GetMonotonicTimestamp(); - while (clock.GetMonotonicTimestamp() - start < 100_ms) - ; - } - return CHIP_NO_ERROR; - } - - void OnFailureResponse_16(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); - NextTest(); - } - - void OnSuccessResponse_16() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeThatDoesNotNeedTimedWriteUnchangedValue_17() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_17, OnFailureCallback_17)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_17(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_17(bool boolean) - { - VerifyOrReturn(CheckValue("boolean", boolean, false)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeThatDoesNotNeedTimedWriteWithALongTimeoutValue_18() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - bool booleanArgument; - booleanArgument = true; - - ReturnErrorOnFailure(cluster.WriteAttribute( - booleanArgument, this, OnSuccessCallback_18, OnFailureCallback_18, 10000)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_18(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_18() { NextTest(); } - - CHIP_ERROR TestReadAttributeThatDoesNotNeedTimedWriteChangedValue_19() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_19, OnFailureCallback_19)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_19(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_19(bool boolean) - { - VerifyOrReturn(CheckValue("boolean", boolean, true)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeThatDoesNotNeedTimedWriteResetToDefault_20() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - bool booleanArgument; - booleanArgument = false; - - ReturnErrorOnFailure(cluster.WriteAttribute( - booleanArgument, this, OnSuccessCallback_20, OnFailureCallback_20)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_20(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_20() { NextTest(); } -}; - -class TestConstraints : public TestCommand -{ -public: - TestConstraints() : TestCommand("TestConstraints"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: TestConstraints\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: TestConstraints\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 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 Back to Default Value\n"); - err = TestWriteAttributeCharStringValueBackToDefaultValue_11(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 12; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint32_t int32u) - { - (static_cast(context))->OnSuccessResponse_2(int32u); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, uint32_t int32u) - { - (static_cast(context))->OnSuccessResponse_3(int32u); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, uint32_t int32u) - { - (static_cast(context))->OnSuccessResponse_4(int32u); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, chip::CharSpan charString) - { - (static_cast(context))->OnSuccessResponse_7(charString); - } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context, chip::CharSpan charString) - { - (static_cast(context))->OnSuccessResponse_8(charString); - } - - static void OnFailureCallback_9(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context, chip::CharSpan charString) - { - (static_cast(context))->OnSuccessResponse_9(charString); - } - - static void OnFailureCallback_10(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_10(status); - } - - static void OnSuccessCallback_10(void * context, chip::CharSpan charString) - { - (static_cast(context))->OnSuccessResponse_10(charString); - } - - static void OnFailureCallback_11(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_11(status); - } - - static void OnSuccessCallback_11(void * context) { (static_cast(context))->OnSuccessResponse_11(); } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestWriteAttributeInt32uValue_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint32_t int32uArgument; - int32uArgument = 5UL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int32uArgument, this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt32uValueMinValueConstraints_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint32_t int32u) - { - VerifyOrReturn(CheckConstraintMinValue("int32u", int32u, 5UL)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeInt32uValueMaxValueConstraints_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(uint32_t int32u) - { - VerifyOrReturn(CheckConstraintMaxValue("int32u", int32u, 5UL)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeInt32uValueNotValueConstraints_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint32_t int32u) - { - VerifyOrReturn(CheckConstraintNotValue("int32u", int32u, 6UL)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt32uValueBackToDefaultValue_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint32_t int32uArgument; - int32uArgument = 0UL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int32uArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestWriteAttributeCharStringValue_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::CharSpan charStringArgument; - charStringArgument = chip::Span("** Test **garbage: not in length on purpose", 10); - - ReturnErrorOnFailure(cluster.WriteAttribute( - charStringArgument, this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6() { NextTest(); } - - CHIP_ERROR TestReadAttributeCharStringValueMinLengthConstraints_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(chip::CharSpan charString) - { - VerifyOrReturn(CheckConstraintMinLength("charString", charString.size(), 5)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeCharStringValueMaxLengthConstraints_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8(chip::CharSpan charString) - { - VerifyOrReturn(CheckConstraintMaxLength("charString", charString.size(), 20)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeCharStringValueStartsWithConstraints_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9(chip::CharSpan charString) - { - VerifyOrReturn(CheckConstraintStartsWith("charString", charString, "**")); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeCharStringValueEndsWithConstraints_10() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_10, OnFailureCallback_10)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10(chip::CharSpan charString) - { - VerifyOrReturn(CheckConstraintEndsWith("charString", charString, "**")); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeCharStringValueBackToDefaultValue_11() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::CharSpan charStringArgument; - charStringArgument = chip::Span("garbage: not in length on purpose", 0); - - ReturnErrorOnFailure(cluster.WriteAttribute( - charStringArgument, this, OnSuccessCallback_11, OnFailureCallback_11)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_11() { NextTest(); } -}; - -class TestDelayCommands : public TestCommand -{ -public: - TestDelayCommands() : TestCommand("TestDelayCommands"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: TestDelayCommands\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: TestDelayCommands\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 : Wait 100ms\n"); - err = TestWait100ms_1(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestWait100ms_1() - { - SetIdentity(kIdentityAlpha); - return WaitForMs(100); - } -}; - -class TestLogCommands : public TestCommand -{ -public: - TestLogCommands() : TestCommand("TestLogCommands"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: TestLogCommands\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: TestLogCommands\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 : 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); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestLogASimpleMessage_1() - { - SetIdentity(kIdentityAlpha); - return Log("This is a simple message"); - } - - CHIP_ERROR TestDoASimpleUserPromptMessage_2() - { - SetIdentity(kIdentityAlpha); - return UserPrompt("This is a simple message"); - } -}; - -class TestSaveAs : public TestCommand -{ -public: - TestSaveAs() : TestCommand("TestSaveAs"), mTestIndex(0) {} - - /////////// 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; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 94; - - uint8_t TestAddArgumentDefaultValue; - bool readAttributeBooleanDefaultValue; - uint8_t readAttributeBitmap8DefaultValue; - uint16_t readAttributeBitmap16DefaultValue; - uint32_t readAttributeBitmap32DefaultValue; - uint64_t readAttributeBitmap64DefaultValue; - uint8_t readAttributeInt8uDefaultValue; - uint16_t readAttributeInt16uDefaultValue; - uint32_t readAttributeInt32uDefaultValue; - uint64_t readAttributeInt64uDefaultValue; - int8_t readAttributeInt8sDefaultValue; - int16_t readAttributeInt16sDefaultValue; - int32_t readAttributeInt32sDefaultValue; - int64_t readAttributeInt64sDefaultValue; - uint8_t readAttributeEnum8DefaultValue; - uint16_t readAttributeEnum16DefaultValue; - uint64_t readAttributeEpochUSDefaultValue; - uint32_t readAttributeEpochSDefaultValue; - chip::VendorId readAttributeVendorIdDefaultValue; - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, bool boolean) - { - (static_cast(context))->OnSuccessResponse_4(boolean); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } - - static void OnFailureCallback_6(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_6(status); - } - - static void OnSuccessCallback_6(void * context, bool boolean) - { - (static_cast(context))->OnSuccessResponse_6(boolean); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } - - static void OnFailureCallback_8(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_8(status); - } - - static void OnSuccessCallback_8(void * context, bool boolean) - { - (static_cast(context))->OnSuccessResponse_8(boolean); - } - - static void OnFailureCallback_9(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context, uint8_t bitmap8) - { - (static_cast(context))->OnSuccessResponse_9(bitmap8); - } - - static void OnFailureCallback_10(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_10(status); - } - - static void OnSuccessCallback_10(void * context) { (static_cast(context))->OnSuccessResponse_10(); } - - static void OnFailureCallback_11(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_11(status); - } - - static void OnSuccessCallback_11(void * context, uint8_t bitmap8) - { - (static_cast(context))->OnSuccessResponse_11(bitmap8); - } - - static void OnFailureCallback_12(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_12(status); - } - - static void OnSuccessCallback_12(void * context) { (static_cast(context))->OnSuccessResponse_12(); } - - static void OnFailureCallback_13(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_13(status); - } - - static void OnSuccessCallback_13(void * context, uint8_t bitmap8) - { - (static_cast(context))->OnSuccessResponse_13(bitmap8); - } - - static void OnFailureCallback_14(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_14(status); - } - - static void OnSuccessCallback_14(void * context, uint16_t bitmap16) - { - (static_cast(context))->OnSuccessResponse_14(bitmap16); - } - - static void OnFailureCallback_15(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_15(status); - } - - static void OnSuccessCallback_15(void * context) { (static_cast(context))->OnSuccessResponse_15(); } - - static void OnFailureCallback_16(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_16(status); - } - - static void OnSuccessCallback_16(void * context, uint16_t bitmap16) - { - (static_cast(context))->OnSuccessResponse_16(bitmap16); - } - - static void OnFailureCallback_17(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_17(status); - } - - static void OnSuccessCallback_17(void * context) { (static_cast(context))->OnSuccessResponse_17(); } - - static void OnFailureCallback_18(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_18(status); - } - - static void OnSuccessCallback_18(void * context, uint16_t bitmap16) - { - (static_cast(context))->OnSuccessResponse_18(bitmap16); - } - - static void OnFailureCallback_19(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_19(status); - } - - static void OnSuccessCallback_19(void * context, uint32_t bitmap32) - { - (static_cast(context))->OnSuccessResponse_19(bitmap32); - } - - static void OnFailureCallback_20(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_20(status); - } - - static void OnSuccessCallback_20(void * context) { (static_cast(context))->OnSuccessResponse_20(); } - - static void OnFailureCallback_21(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_21(status); - } - - static void OnSuccessCallback_21(void * context, uint32_t bitmap32) - { - (static_cast(context))->OnSuccessResponse_21(bitmap32); - } - - static void OnFailureCallback_22(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_22(status); - } - - static void OnSuccessCallback_22(void * context) { (static_cast(context))->OnSuccessResponse_22(); } - - static void OnFailureCallback_23(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_23(status); - } - - static void OnSuccessCallback_23(void * context, uint32_t bitmap32) - { - (static_cast(context))->OnSuccessResponse_23(bitmap32); - } - - static void OnFailureCallback_24(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_24(status); - } - - static void OnSuccessCallback_24(void * context, uint64_t bitmap64) - { - (static_cast(context))->OnSuccessResponse_24(bitmap64); - } - - static void OnFailureCallback_25(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_25(status); - } - - static void OnSuccessCallback_25(void * context) { (static_cast(context))->OnSuccessResponse_25(); } - - static void OnFailureCallback_26(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_26(status); - } - - static void OnSuccessCallback_26(void * context, uint64_t bitmap64) - { - (static_cast(context))->OnSuccessResponse_26(bitmap64); - } - - static void OnFailureCallback_27(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_27(status); - } - - static void OnSuccessCallback_27(void * context) { (static_cast(context))->OnSuccessResponse_27(); } - - static void OnFailureCallback_28(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_28(status); - } - - static void OnSuccessCallback_28(void * context, uint64_t bitmap64) - { - (static_cast(context))->OnSuccessResponse_28(bitmap64); - } - - static void OnFailureCallback_29(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_29(status); - } - - static void OnSuccessCallback_29(void * context, uint8_t int8u) - { - (static_cast(context))->OnSuccessResponse_29(int8u); - } - - static void OnFailureCallback_30(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_30(status); - } - - static void OnSuccessCallback_30(void * context) { (static_cast(context))->OnSuccessResponse_30(); } - - static void OnFailureCallback_31(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_31(status); - } - - static void OnSuccessCallback_31(void * context, uint8_t int8u) - { - (static_cast(context))->OnSuccessResponse_31(int8u); - } - - static void OnFailureCallback_32(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_32(status); - } - - static void OnSuccessCallback_32(void * context) { (static_cast(context))->OnSuccessResponse_32(); } - - static void OnFailureCallback_33(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_33(status); - } - - static void OnSuccessCallback_33(void * context, uint8_t int8u) - { - (static_cast(context))->OnSuccessResponse_33(int8u); - } - - static void OnFailureCallback_34(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_34(status); - } - - static void OnSuccessCallback_34(void * context, uint16_t int16u) - { - (static_cast(context))->OnSuccessResponse_34(int16u); - } - - static void OnFailureCallback_35(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_35(status); - } - - static void OnSuccessCallback_35(void * context) { (static_cast(context))->OnSuccessResponse_35(); } - - static void OnFailureCallback_36(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_36(status); - } - - static void OnSuccessCallback_36(void * context, uint16_t int16u) - { - (static_cast(context))->OnSuccessResponse_36(int16u); - } - - static void OnFailureCallback_37(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_37(status); - } - - static void OnSuccessCallback_37(void * context) { (static_cast(context))->OnSuccessResponse_37(); } - - static void OnFailureCallback_38(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_38(status); - } - - static void OnSuccessCallback_38(void * context, uint16_t int16u) - { - (static_cast(context))->OnSuccessResponse_38(int16u); - } - - static void OnFailureCallback_39(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_39(status); - } - - static void OnSuccessCallback_39(void * context, uint32_t int32u) - { - (static_cast(context))->OnSuccessResponse_39(int32u); - } - - static void OnFailureCallback_40(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_40(status); - } - - static void OnSuccessCallback_40(void * context) { (static_cast(context))->OnSuccessResponse_40(); } - - static void OnFailureCallback_41(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_41(status); - } - - static void OnSuccessCallback_41(void * context, uint32_t int32u) - { - (static_cast(context))->OnSuccessResponse_41(int32u); - } - - static void OnFailureCallback_42(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_42(status); - } - - static void OnSuccessCallback_42(void * context) { (static_cast(context))->OnSuccessResponse_42(); } - - static void OnFailureCallback_43(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_43(status); - } - - static void OnSuccessCallback_43(void * context, uint32_t int32u) - { - (static_cast(context))->OnSuccessResponse_43(int32u); - } - - static void OnFailureCallback_44(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_44(status); - } - - static void OnSuccessCallback_44(void * context, uint64_t int64u) - { - (static_cast(context))->OnSuccessResponse_44(int64u); - } - - static void OnFailureCallback_45(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_45(status); - } - - static void OnSuccessCallback_45(void * context) { (static_cast(context))->OnSuccessResponse_45(); } - - static void OnFailureCallback_46(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_46(status); - } - - static void OnSuccessCallback_46(void * context, uint64_t int64u) - { - (static_cast(context))->OnSuccessResponse_46(int64u); - } - - static void OnFailureCallback_47(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_47(status); - } - - static void OnSuccessCallback_47(void * context) { (static_cast(context))->OnSuccessResponse_47(); } - - static void OnFailureCallback_48(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_48(status); - } - - static void OnSuccessCallback_48(void * context, uint64_t int64u) - { - (static_cast(context))->OnSuccessResponse_48(int64u); - } - - static void OnFailureCallback_49(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_49(status); - } - - static void OnSuccessCallback_49(void * context, int8_t int8s) - { - (static_cast(context))->OnSuccessResponse_49(int8s); - } - - static void OnFailureCallback_50(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_50(status); - } - - static void OnSuccessCallback_50(void * context) { (static_cast(context))->OnSuccessResponse_50(); } - - static void OnFailureCallback_51(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_51(status); - } - - static void OnSuccessCallback_51(void * context, int8_t int8s) - { - (static_cast(context))->OnSuccessResponse_51(int8s); - } - - static void OnFailureCallback_52(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_52(status); - } - - static void OnSuccessCallback_52(void * context) { (static_cast(context))->OnSuccessResponse_52(); } - - static void OnFailureCallback_53(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_53(status); - } - - static void OnSuccessCallback_53(void * context, int8_t int8s) - { - (static_cast(context))->OnSuccessResponse_53(int8s); - } - - static void OnFailureCallback_54(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_54(status); - } - - static void OnSuccessCallback_54(void * context, int16_t int16s) - { - (static_cast(context))->OnSuccessResponse_54(int16s); - } - - static void OnFailureCallback_55(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_55(status); - } - - static void OnSuccessCallback_55(void * context) { (static_cast(context))->OnSuccessResponse_55(); } - - static void OnFailureCallback_56(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_56(status); - } - - static void OnSuccessCallback_56(void * context, int16_t int16s) - { - (static_cast(context))->OnSuccessResponse_56(int16s); - } - - static void OnFailureCallback_57(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_57(status); - } - - static void OnSuccessCallback_57(void * context) { (static_cast(context))->OnSuccessResponse_57(); } - - static void OnFailureCallback_58(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_58(status); - } - - static void OnSuccessCallback_58(void * context, int16_t int16s) - { - (static_cast(context))->OnSuccessResponse_58(int16s); - } - - static void OnFailureCallback_59(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_59(status); - } - - static void OnSuccessCallback_59(void * context, int32_t int32s) - { - (static_cast(context))->OnSuccessResponse_59(int32s); - } - - static void OnFailureCallback_60(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_60(status); - } - - static void OnSuccessCallback_60(void * context) { (static_cast(context))->OnSuccessResponse_60(); } - - static void OnFailureCallback_61(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_61(status); - } - - static void OnSuccessCallback_61(void * context, int32_t int32s) - { - (static_cast(context))->OnSuccessResponse_61(int32s); - } - - static void OnFailureCallback_62(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_62(status); - } - - static void OnSuccessCallback_62(void * context) { (static_cast(context))->OnSuccessResponse_62(); } - - static void OnFailureCallback_63(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_63(status); - } - - static void OnSuccessCallback_63(void * context, int32_t int32s) - { - (static_cast(context))->OnSuccessResponse_63(int32s); - } - - static void OnFailureCallback_64(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_64(status); - } - - static void OnSuccessCallback_64(void * context, int64_t int64s) - { - (static_cast(context))->OnSuccessResponse_64(int64s); - } - - static void OnFailureCallback_65(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_65(status); - } - - static void OnSuccessCallback_65(void * context) { (static_cast(context))->OnSuccessResponse_65(); } - - static void OnFailureCallback_66(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_66(status); - } - - static void OnSuccessCallback_66(void * context, int64_t int64s) - { - (static_cast(context))->OnSuccessResponse_66(int64s); - } - - static void OnFailureCallback_67(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_67(status); - } - - static void OnSuccessCallback_67(void * context) { (static_cast(context))->OnSuccessResponse_67(); } - - static void OnFailureCallback_68(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_68(status); - } - - static void OnSuccessCallback_68(void * context, int64_t int64s) - { - (static_cast(context))->OnSuccessResponse_68(int64s); - } - - static void OnFailureCallback_69(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_69(status); - } - - static void OnSuccessCallback_69(void * context, uint8_t enum8) - { - (static_cast(context))->OnSuccessResponse_69(enum8); - } - - static void OnFailureCallback_70(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_70(status); - } - - static void OnSuccessCallback_70(void * context) { (static_cast(context))->OnSuccessResponse_70(); } - - static void OnFailureCallback_71(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_71(status); - } - - static void OnSuccessCallback_71(void * context, uint8_t enum8) - { - (static_cast(context))->OnSuccessResponse_71(enum8); - } - - static void OnFailureCallback_72(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_72(status); - } - - static void OnSuccessCallback_72(void * context) { (static_cast(context))->OnSuccessResponse_72(); } - - static void OnFailureCallback_73(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_73(status); - } - - static void OnSuccessCallback_73(void * context, uint8_t enum8) - { - (static_cast(context))->OnSuccessResponse_73(enum8); - } - - static void OnFailureCallback_74(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_74(status); - } - - static void OnSuccessCallback_74(void * context, uint16_t enum16) - { - (static_cast(context))->OnSuccessResponse_74(enum16); - } - - static void OnFailureCallback_75(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_75(status); - } - - static void OnSuccessCallback_75(void * context) { (static_cast(context))->OnSuccessResponse_75(); } - - static void OnFailureCallback_76(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_76(status); - } - - static void OnSuccessCallback_76(void * context, uint16_t enum16) - { - (static_cast(context))->OnSuccessResponse_76(enum16); - } - - static void OnFailureCallback_77(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_77(status); - } - - static void OnSuccessCallback_77(void * context) { (static_cast(context))->OnSuccessResponse_77(); } - - static void OnFailureCallback_78(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_78(status); - } - - static void OnSuccessCallback_78(void * context, uint16_t enum16) - { - (static_cast(context))->OnSuccessResponse_78(enum16); - } - - static void OnFailureCallback_79(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_79(status); - } - - static void OnSuccessCallback_79(void * context, uint64_t epochUs) - { - (static_cast(context))->OnSuccessResponse_79(epochUs); - } - - static void OnFailureCallback_80(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_80(status); - } - - static void OnSuccessCallback_80(void * context) { (static_cast(context))->OnSuccessResponse_80(); } - - static void OnFailureCallback_81(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_81(status); - } - - static void OnSuccessCallback_81(void * context, uint64_t epochUs) - { - (static_cast(context))->OnSuccessResponse_81(epochUs); - } - - static void OnFailureCallback_82(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_82(status); - } - - static void OnSuccessCallback_82(void * context) { (static_cast(context))->OnSuccessResponse_82(); } - - static void OnFailureCallback_83(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_83(status); - } - - static void OnSuccessCallback_83(void * context, uint64_t epochUs) - { - (static_cast(context))->OnSuccessResponse_83(epochUs); - } - - static void OnFailureCallback_84(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_84(status); - } - - static void OnSuccessCallback_84(void * context, uint32_t epochS) - { - (static_cast(context))->OnSuccessResponse_84(epochS); - } - - static void OnFailureCallback_85(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_85(status); - } - - static void OnSuccessCallback_85(void * context) { (static_cast(context))->OnSuccessResponse_85(); } - - static void OnFailureCallback_86(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_86(status); - } - - static void OnSuccessCallback_86(void * context, uint32_t epochS) - { - (static_cast(context))->OnSuccessResponse_86(epochS); - } - - static void OnFailureCallback_87(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_87(status); - } - - static void OnSuccessCallback_87(void * context) { (static_cast(context))->OnSuccessResponse_87(); } - - static void OnFailureCallback_88(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_88(status); - } - - static void OnSuccessCallback_88(void * context, uint32_t epochS) - { - (static_cast(context))->OnSuccessResponse_88(epochS); - } - - static void OnFailureCallback_89(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_89(status); - } - - static void OnSuccessCallback_89(void * context, chip::VendorId vendorId) - { - (static_cast(context))->OnSuccessResponse_89(vendorId); - } - - static void OnFailureCallback_90(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_90(status); - } - - static void OnSuccessCallback_90(void * context) { (static_cast(context))->OnSuccessResponse_90(); } - - static void OnFailureCallback_91(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_91(status); - } - - static void OnSuccessCallback_91(void * context, chip::VendorId vendorId) - { - (static_cast(context))->OnSuccessResponse_91(vendorId); - } - - static void OnFailureCallback_92(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_92(status); - } - - static void OnSuccessCallback_92(void * context) { (static_cast(context))->OnSuccessResponse_92(); } - - static void OnFailureCallback_93(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_93(status); - } - - static void OnSuccessCallback_93(void * context, chip::VendorId vendorId) - { - (static_cast(context))->OnSuccessResponse_93(vendorId); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestSendTestAddArgumentsCommand_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestAddArguments::Type; - - RequestType request; - request.arg1 = 3; - request.arg2 = 17; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(data.returnValue); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint8_t returnValue) - { - VerifyOrReturn(CheckValue("returnValue", returnValue, 20)); - - TestAddArgumentDefaultValue = returnValue; - NextTest(); - } - - CHIP_ERROR TestSendTestAddArgumentsCommand_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestAddArguments::Type; - - RequestType request; - request.arg1 = 3; - request.arg2 = 17; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_2(data.returnValue); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_2(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint8_t returnValue) - { - VerifyOrReturn(CheckValue("returnValue", returnValue, TestAddArgumentDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestSendTestAddArgumentsCommand_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestAddArguments::Type; - - RequestType request; - request.arg1 = 3; - request.arg2 = TestAddArgumentDefaultValue; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(data.returnValue); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(uint8_t returnValue) - { - VerifyOrReturn(CheckConstraintNotValue("returnValue", returnValue, TestAddArgumentDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeBooleanDefaultValue_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(bool boolean) - { - VerifyOrReturn(CheckValue("boolean", boolean, 0)); - - readAttributeBooleanDefaultValue = boolean; - NextTest(); - } - - CHIP_ERROR TestWriteAttributeBooleanNotDefaultValue_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - bool booleanArgument; - booleanArgument = 1; - - ReturnErrorOnFailure(cluster.WriteAttribute( - booleanArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5() { NextTest(); } - - CHIP_ERROR TestReadAttributeBooleanNotDefaultValue_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(bool boolean) - { - VerifyOrReturn(CheckConstraintNotValue("boolean", boolean, readAttributeBooleanDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeBooleanDefaultValue_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - bool booleanArgument; - booleanArgument = readAttributeBooleanDefaultValue; - - ReturnErrorOnFailure(cluster.WriteAttribute( - booleanArgument, this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7() { NextTest(); } - - CHIP_ERROR TestReadAttributeBooleanFalse_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8(bool boolean) - { - VerifyOrReturn(CheckValue("boolean", boolean, readAttributeBooleanDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeBitmap8DefaultValue_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9(uint8_t bitmap8) - { - VerifyOrReturn(CheckValue("bitmap8", bitmap8, 0)); - - readAttributeBitmap8DefaultValue = bitmap8; - NextTest(); - } - - CHIP_ERROR TestWriteAttributeBitmap8NotDefaultValue_10() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t bitmap8Argument; - bitmap8Argument = 1; - - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap8Argument, this, OnSuccessCallback_10, OnFailureCallback_10)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10() { NextTest(); } - - CHIP_ERROR TestReadAttributeBitmap8NotDefaultValue_11() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_11, OnFailureCallback_11)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_11(uint8_t bitmap8) - { - VerifyOrReturn(CheckConstraintNotValue("bitmap8", bitmap8, readAttributeBitmap8DefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeBitmap8DefaultValue_12() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t bitmap8Argument; - bitmap8Argument = readAttributeBitmap8DefaultValue; - - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap8Argument, this, OnSuccessCallback_12, OnFailureCallback_12)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_12(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_12() { NextTest(); } - - CHIP_ERROR TestReadAttributeBitmap8DefaultValue_13() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_13, OnFailureCallback_13)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_13(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_13(uint8_t bitmap8) - { - VerifyOrReturn(CheckValue("bitmap8", bitmap8, readAttributeBitmap8DefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeBitmap16DefaultValue_14() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_14, OnFailureCallback_14)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_14(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_14(uint16_t bitmap16) - { - VerifyOrReturn(CheckValue("bitmap16", bitmap16, 0U)); - - readAttributeBitmap16DefaultValue = bitmap16; - NextTest(); - } - - CHIP_ERROR TestWriteAttributeBitmap16NotDefaultValue_15() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t bitmap16Argument; - bitmap16Argument = 1U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap16Argument, this, OnSuccessCallback_15, OnFailureCallback_15)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_15(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_15() { NextTest(); } - - CHIP_ERROR TestReadAttributeBitmap16NotDefaultValue_16() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_16, OnFailureCallback_16)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_16(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_16(uint16_t bitmap16) - { - VerifyOrReturn(CheckConstraintNotValue("bitmap16", bitmap16, readAttributeBitmap16DefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeBitmap16DefaultValue_17() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t bitmap16Argument; - bitmap16Argument = readAttributeBitmap16DefaultValue; - - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap16Argument, this, OnSuccessCallback_17, OnFailureCallback_17)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_17(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_17() { NextTest(); } - - CHIP_ERROR TestReadAttributeBitmap16DefaultValue_18() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_18, OnFailureCallback_18)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_18(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_18(uint16_t bitmap16) - { - VerifyOrReturn(CheckValue("bitmap16", bitmap16, readAttributeBitmap16DefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeBitmap32DefaultValue_19() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_19, OnFailureCallback_19)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_19(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_19(uint32_t bitmap32) - { - VerifyOrReturn(CheckValue("bitmap32", bitmap32, 0UL)); - - readAttributeBitmap32DefaultValue = bitmap32; - NextTest(); - } - - CHIP_ERROR TestWriteAttributeBitmap32NotDefaultValue_20() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint32_t bitmap32Argument; - bitmap32Argument = 1UL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap32Argument, this, OnSuccessCallback_20, OnFailureCallback_20)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_20(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_20() { NextTest(); } - - CHIP_ERROR TestReadAttributeBitmap32NotDefaultValue_21() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_21, OnFailureCallback_21)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_21(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_21(uint32_t bitmap32) - { - VerifyOrReturn(CheckConstraintNotValue("bitmap32", bitmap32, readAttributeBitmap32DefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeBitmap32DefaultValue_22() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint32_t bitmap32Argument; - bitmap32Argument = readAttributeBitmap32DefaultValue; - - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap32Argument, this, OnSuccessCallback_22, OnFailureCallback_22)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_22(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_22() { NextTest(); } - - CHIP_ERROR TestReadAttributeBitmap32DefaultValue_23() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_23, OnFailureCallback_23)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_23(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_23(uint32_t bitmap32) - { - VerifyOrReturn(CheckValue("bitmap32", bitmap32, readAttributeBitmap32DefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeBitmap64DefaultValue_24() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_24, OnFailureCallback_24)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_24(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_24(uint64_t bitmap64) - { - VerifyOrReturn(CheckValue("bitmap64", bitmap64, 0ULL)); - - readAttributeBitmap64DefaultValue = bitmap64; - NextTest(); - } - - CHIP_ERROR TestWriteAttributeBitmap64NotDefaultValue_25() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint64_t bitmap64Argument; - bitmap64Argument = 1ULL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap64Argument, this, OnSuccessCallback_25, OnFailureCallback_25)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_25(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_25() { NextTest(); } - - CHIP_ERROR TestReadAttributeBitmap64DefaultValue_26() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_26, OnFailureCallback_26)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_26(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_26(uint64_t bitmap64) - { - VerifyOrReturn(CheckConstraintNotValue("bitmap64", bitmap64, readAttributeBitmap64DefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeBitmap64DefaultValue_27() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint64_t bitmap64Argument; - bitmap64Argument = readAttributeBitmap64DefaultValue; - - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap64Argument, this, OnSuccessCallback_27, OnFailureCallback_27)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_27(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_27() { NextTest(); } - - CHIP_ERROR TestReadAttributeBitmap64DefaultValue_28() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_28, OnFailureCallback_28)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_28(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_28(uint64_t bitmap64) - { - VerifyOrReturn(CheckValue("bitmap64", bitmap64, readAttributeBitmap64DefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeInt8uDefaultValue_29() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_29, OnFailureCallback_29)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_29(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_29(uint8_t int8u) - { - VerifyOrReturn(CheckValue("int8u", int8u, 0)); - - readAttributeInt8uDefaultValue = int8u; - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt8uNotDefaultValue_30() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t int8uArgument; - int8uArgument = 1; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int8uArgument, this, OnSuccessCallback_30, OnFailureCallback_30)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_30(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_30() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt8uNotDefaultValue_31() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_31, OnFailureCallback_31)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_31(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_31(uint8_t int8u) - { - VerifyOrReturn(CheckConstraintNotValue("int8u", int8u, readAttributeInt8uDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt8uDefaultValue_32() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t int8uArgument; - int8uArgument = readAttributeInt8uDefaultValue; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int8uArgument, this, OnSuccessCallback_32, OnFailureCallback_32)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_32(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_32() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt8uDefaultValue_33() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_33, OnFailureCallback_33)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_33(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_33(uint8_t int8u) - { - VerifyOrReturn(CheckValue("int8u", int8u, readAttributeInt8uDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeInt16uDefaultValue_34() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_34, OnFailureCallback_34)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_34(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_34(uint16_t int16u) - { - VerifyOrReturn(CheckValue("int16u", int16u, 0U)); - - readAttributeInt16uDefaultValue = int16u; - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt16uNotDefaultValue_35() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t int16uArgument; - int16uArgument = 1U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int16uArgument, this, OnSuccessCallback_35, OnFailureCallback_35)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_35(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_35() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt16uNotDefaultValue_36() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_36, OnFailureCallback_36)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_36(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_36(uint16_t int16u) - { - VerifyOrReturn(CheckConstraintNotValue("int16u", int16u, readAttributeInt16uDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt16uDefaultValue_37() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t int16uArgument; - int16uArgument = readAttributeInt16uDefaultValue; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int16uArgument, this, OnSuccessCallback_37, OnFailureCallback_37)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_37(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_37() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt16uDefaultValue_38() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_38, OnFailureCallback_38)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_38(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_38(uint16_t int16u) - { - VerifyOrReturn(CheckValue("int16u", int16u, readAttributeInt16uDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeInt32uDefaultValue_39() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_39, OnFailureCallback_39)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_39(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_39(uint32_t int32u) - { - VerifyOrReturn(CheckValue("int32u", int32u, 0UL)); - - readAttributeInt32uDefaultValue = int32u; - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt32uNotDefaultValue_40() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint32_t int32uArgument; - int32uArgument = 1UL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int32uArgument, this, OnSuccessCallback_40, OnFailureCallback_40)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_40(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_40() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt32uNotDefaultValue_41() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_41, OnFailureCallback_41)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_41(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_41(uint32_t int32u) - { - VerifyOrReturn(CheckConstraintNotValue("int32u", int32u, readAttributeInt32uDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt32uDefaultValue_42() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint32_t int32uArgument; - int32uArgument = readAttributeInt32uDefaultValue; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int32uArgument, this, OnSuccessCallback_42, OnFailureCallback_42)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_42(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_42() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt32uDefaultValue_43() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_43, OnFailureCallback_43)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_43(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_43(uint32_t int32u) - { - VerifyOrReturn(CheckValue("int32u", int32u, readAttributeInt32uDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeInt64uDefaultValue_44() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_44, OnFailureCallback_44)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_44(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_44(uint64_t int64u) - { - VerifyOrReturn(CheckValue("int64u", int64u, 0ULL)); - - readAttributeInt64uDefaultValue = int64u; - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt64uNotDefaultValue_45() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint64_t int64uArgument; - int64uArgument = 1ULL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int64uArgument, this, OnSuccessCallback_45, OnFailureCallback_45)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_45(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_45() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt64uNotDefaultValue_46() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_46, OnFailureCallback_46)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_46(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_46(uint64_t int64u) - { - VerifyOrReturn(CheckConstraintNotValue("int64u", int64u, readAttributeInt64uDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt64uDefaultValue_47() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint64_t int64uArgument; - int64uArgument = readAttributeInt64uDefaultValue; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int64uArgument, this, OnSuccessCallback_47, OnFailureCallback_47)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_47(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_47() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt64uDefaultValue_48() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_48, OnFailureCallback_48)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_48(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_48(uint64_t int64u) - { - VerifyOrReturn(CheckValue("int64u", int64u, readAttributeInt64uDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeInt8sDefaultValue_49() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_49, OnFailureCallback_49)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_49(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_49(int8_t int8s) - { - VerifyOrReturn(CheckValue("int8s", int8s, 0)); - - readAttributeInt8sDefaultValue = int8s; - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt8sNotDefaultValue_50() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int8_t int8sArgument; - int8sArgument = 1; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int8sArgument, this, OnSuccessCallback_50, OnFailureCallback_50)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_50(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_50() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt8sNotDefaultValue_51() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_51, OnFailureCallback_51)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_51(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_51(int8_t int8s) - { - VerifyOrReturn(CheckConstraintNotValue("int8s", int8s, readAttributeInt8sDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt8sDefaultValue_52() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int8_t int8sArgument; - int8sArgument = readAttributeInt8sDefaultValue; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int8sArgument, this, OnSuccessCallback_52, OnFailureCallback_52)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_52(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_52() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt8sDefaultValue_53() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_53, OnFailureCallback_53)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_53(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_53(int8_t int8s) - { - VerifyOrReturn(CheckValue("int8s", int8s, readAttributeInt8sDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeInt16sDefaultValue_54() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_54, OnFailureCallback_54)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_54(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_54(int16_t int16s) - { - VerifyOrReturn(CheckValue("int16s", int16s, 0)); - - readAttributeInt16sDefaultValue = int16s; - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt16sNotDefaultValue_55() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t int16sArgument; - int16sArgument = 1; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int16sArgument, this, OnSuccessCallback_55, OnFailureCallback_55)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_55(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_55() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt16sNotDefaultValue_56() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_56, OnFailureCallback_56)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_56(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_56(int16_t int16s) - { - VerifyOrReturn(CheckConstraintNotValue("int16s", int16s, readAttributeInt16sDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt16sDefaultValue_57() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int16_t int16sArgument; - int16sArgument = readAttributeInt16sDefaultValue; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int16sArgument, this, OnSuccessCallback_57, OnFailureCallback_57)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_57(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_57() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt16sDefaultValue_58() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_58, OnFailureCallback_58)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_58(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_58(int16_t int16s) - { - VerifyOrReturn(CheckValue("int16s", int16s, readAttributeInt16sDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeInt32sDefaultValue_59() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_59, OnFailureCallback_59)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_59(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_59(int32_t int32s) - { - VerifyOrReturn(CheckValue("int32s", int32s, 0L)); - - readAttributeInt32sDefaultValue = int32s; - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt32sNotDefaultValue_60() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int32_t int32sArgument; - int32sArgument = 1L; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int32sArgument, this, OnSuccessCallback_60, OnFailureCallback_60)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_60(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_60() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt32sNotDefaultValue_61() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_61, OnFailureCallback_61)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_61(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_61(int32_t int32s) - { - VerifyOrReturn(CheckConstraintNotValue("int32s", int32s, readAttributeInt32sDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt32sDefaultValue_62() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int32_t int32sArgument; - int32sArgument = readAttributeInt32sDefaultValue; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int32sArgument, this, OnSuccessCallback_62, OnFailureCallback_62)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_62(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_62() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt32sDefaultValue_63() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_63, OnFailureCallback_63)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_63(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_63(int32_t int32s) - { - VerifyOrReturn(CheckValue("int32s", int32s, readAttributeInt32sDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeInt64sDefaultValue_64() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_64, OnFailureCallback_64)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_64(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_64(int64_t int64s) - { - VerifyOrReturn(CheckValue("int64s", int64s, 0LL)); - - readAttributeInt64sDefaultValue = int64s; - NextTest(); - } - - CHIP_ERROR TestWriteAttributeIntsNotDefaultValue_65() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int64_t int64sArgument; - int64sArgument = 1LL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int64sArgument, this, OnSuccessCallback_65, OnFailureCallback_65)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_65(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_65() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt64sNotDefaultValue_66() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_66, OnFailureCallback_66)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_66(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_66(int64_t int64s) - { - VerifyOrReturn(CheckConstraintNotValue("int64s", int64s, readAttributeInt64sDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeInt64sDefaultValue_67() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int64_t int64sArgument; - int64sArgument = readAttributeInt64sDefaultValue; - - ReturnErrorOnFailure(cluster.WriteAttribute( - int64sArgument, this, OnSuccessCallback_67, OnFailureCallback_67)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_67(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_67() { NextTest(); } - - CHIP_ERROR TestReadAttributeInt64sDefaultValue_68() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_68, OnFailureCallback_68)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_68(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_68(int64_t int64s) - { - VerifyOrReturn(CheckValue("int64s", int64s, readAttributeInt64sDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeEnum8DefaultValue_69() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_69, OnFailureCallback_69)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_69(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_69(uint8_t enum8) - { - VerifyOrReturn(CheckValue("enum8", enum8, 0)); - - readAttributeEnum8DefaultValue = enum8; - NextTest(); - } - - CHIP_ERROR TestWriteAttributeEnum8NotDefaultValue_70() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t enum8Argument; - enum8Argument = 1; - - ReturnErrorOnFailure(cluster.WriteAttribute( - enum8Argument, this, OnSuccessCallback_70, OnFailureCallback_70)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_70(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_70() { NextTest(); } - - CHIP_ERROR TestReadAttributeEnum8NotDefaultValue_71() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_71, OnFailureCallback_71)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_71(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_71(uint8_t enum8) - { - VerifyOrReturn(CheckConstraintNotValue("enum8", enum8, readAttributeEnum8DefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeEnum8DefaultValue_72() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t enum8Argument; - enum8Argument = readAttributeEnum8DefaultValue; - - ReturnErrorOnFailure(cluster.WriteAttribute( - enum8Argument, this, OnSuccessCallback_72, OnFailureCallback_72)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_72(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_72() { NextTest(); } - - CHIP_ERROR TestReadAttributeEnum8DefaultValue_73() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_73, OnFailureCallback_73)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_73(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_73(uint8_t enum8) - { - VerifyOrReturn(CheckValue("enum8", enum8, readAttributeEnum8DefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeEnum16DefaultValue_74() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_74, OnFailureCallback_74)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_74(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_74(uint16_t enum16) - { - VerifyOrReturn(CheckValue("enum16", enum16, 0U)); - - readAttributeEnum16DefaultValue = enum16; - NextTest(); - } - - CHIP_ERROR TestWriteAttributeEnum16NotDefaultValue_75() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t enum16Argument; - enum16Argument = 1U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - enum16Argument, this, OnSuccessCallback_75, OnFailureCallback_75)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_75(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_75() { NextTest(); } - - CHIP_ERROR TestReadAttributeEnum16NotDefaultValue_76() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_76, OnFailureCallback_76)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_76(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_76(uint16_t enum16) - { - VerifyOrReturn(CheckConstraintNotValue("enum16", enum16, readAttributeEnum16DefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeEnum16DefaultValue_77() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t enum16Argument; - enum16Argument = readAttributeEnum16DefaultValue; - - ReturnErrorOnFailure(cluster.WriteAttribute( - enum16Argument, this, OnSuccessCallback_77, OnFailureCallback_77)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_77(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_77() { NextTest(); } - - CHIP_ERROR TestReadAttributeEnum16DefaultValue_78() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_78, OnFailureCallback_78)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_78(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_78(uint16_t enum16) - { - VerifyOrReturn(CheckValue("enum16", enum16, readAttributeEnum16DefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeEpochUsDefaultValue_79() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_79, OnFailureCallback_79)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_79(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_79(uint64_t epochUs) - { - VerifyOrReturn(CheckValue("epochUs", epochUs, 0ULL)); - - readAttributeEpochUSDefaultValue = epochUs; - NextTest(); - } - - CHIP_ERROR TestWriteAttributeEpochUsNotDefaultValue_80() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint64_t epochUsArgument; - epochUsArgument = 1ULL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - epochUsArgument, this, OnSuccessCallback_80, OnFailureCallback_80)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_80(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_80() { NextTest(); } - - CHIP_ERROR TestReadAttributeEpochUsNotDefaultValue_81() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_81, OnFailureCallback_81)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_81(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_81(uint64_t epochUs) - { - VerifyOrReturn(CheckConstraintNotValue("epochUs", epochUs, readAttributeEpochUSDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeEpochUsDefaultValue_82() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint64_t epochUsArgument; - epochUsArgument = readAttributeEpochUSDefaultValue; - - ReturnErrorOnFailure(cluster.WriteAttribute( - epochUsArgument, this, OnSuccessCallback_82, OnFailureCallback_82)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_82(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_82() { NextTest(); } - - CHIP_ERROR TestReadAttributeEpochUsDefaultValue_83() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_83, OnFailureCallback_83)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_83(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_83(uint64_t epochUs) - { - VerifyOrReturn(CheckValue("epochUs", epochUs, readAttributeEpochUSDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeEpochSDefaultValue_84() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_84, OnFailureCallback_84)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_84(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_84(uint32_t epochS) - { - VerifyOrReturn(CheckValue("epochS", epochS, 0UL)); - - readAttributeEpochSDefaultValue = epochS; - NextTest(); - } - - CHIP_ERROR TestWriteAttributeEpochSNotDefaultValue_85() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint32_t epochSArgument; - epochSArgument = 1UL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - epochSArgument, this, OnSuccessCallback_85, OnFailureCallback_85)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_85(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_85() { NextTest(); } - - CHIP_ERROR TestReadAttributeEpochSNotDefaultValue_86() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_86, OnFailureCallback_86)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_86(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_86(uint32_t epochS) - { - VerifyOrReturn(CheckConstraintNotValue("epochS", epochS, readAttributeEpochSDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeEpochSDefaultValue_87() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint32_t epochSArgument; - epochSArgument = readAttributeEpochSDefaultValue; - - ReturnErrorOnFailure(cluster.WriteAttribute( - epochSArgument, this, OnSuccessCallback_87, OnFailureCallback_87)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_87(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_87() { NextTest(); } - - CHIP_ERROR TestReadAttributeEpochSDefaultValue_88() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_88, OnFailureCallback_88)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_88(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_88(uint32_t epochS) - { - VerifyOrReturn(CheckValue("epochS", epochS, readAttributeEpochSDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeVendorIdDefaultValue_89() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_89, OnFailureCallback_89)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_89(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_89(chip::VendorId vendorId) - { - VerifyOrReturn(CheckValue("vendorId", vendorId, 0U)); - - readAttributeVendorIdDefaultValue = vendorId; - NextTest(); - } - - CHIP_ERROR TestWriteAttributeVendorIdNotDefaultValue_90() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::VendorId vendorIdArgument; - vendorIdArgument = static_cast(1); - - ReturnErrorOnFailure(cluster.WriteAttribute( - vendorIdArgument, this, OnSuccessCallback_90, OnFailureCallback_90)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_90(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_90() { NextTest(); } - - CHIP_ERROR TestReadAttributeVendorIdNotDefaultValue_91() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_91, OnFailureCallback_91)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_91(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_91(chip::VendorId vendorId) - { - VerifyOrReturn(CheckConstraintNotValue("vendorId", vendorId, readAttributeVendorIdDefaultValue)); - - NextTest(); - } - - CHIP_ERROR TestWriteAttributeVendorIdDefaultValue_92() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::VendorId vendorIdArgument; - vendorIdArgument = static_cast(readAttributeVendorIdDefaultValue); - - ReturnErrorOnFailure(cluster.WriteAttribute( - vendorIdArgument, this, OnSuccessCallback_92, OnFailureCallback_92)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_92(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_92() { NextTest(); } - - CHIP_ERROR TestReadAttributeVendorIdDefaultValue_93() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_93, OnFailureCallback_93)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_93(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_93(chip::VendorId vendorId) - { - VerifyOrReturn(CheckValue("vendorId", vendorId, readAttributeVendorIdDefaultValue)); - - NextTest(); - } -}; - -class TestDescriptorCluster : public TestCommand -{ -public: - TestDescriptorCluster() : TestCommand("TestDescriptorCluster"), mTestIndex(0) {} - - /////////// 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); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1( - void * context, - const chip::app::DataModel::DecodableList & deviceList) - { - (static_cast(context))->OnSuccessResponse_1(deviceList); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, const chip::app::DataModel::DecodableList & serverList) - { - (static_cast(context))->OnSuccessResponse_2(serverList); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & clientList) - { - (static_cast(context))->OnSuccessResponse_3(clientList); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, const chip::app::DataModel::DecodableList & partsList) - { - (static_cast(context))->OnSuccessResponse_4(partsList); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadAttributeDeviceList_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::DescriptorClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1( - const chip::app::DataModel::DecodableList & deviceList) - { - auto iter = deviceList.begin(); - VerifyOrReturn(CheckNextListItemDecodes("deviceList", iter, 0)); - VerifyOrReturn(CheckValue("deviceList[0].type", iter.GetValue().type, 22UL)); - VerifyOrReturn(CheckValue("deviceList[0].revision", iter.GetValue().revision, 1U)); - VerifyOrReturn(CheckNoMoreListItems("deviceList", iter, 1)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeServerList_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::DescriptorClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(const chip::app::DataModel::DecodableList & serverList) - { - auto iter = serverList.begin(); - VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 0)); - VerifyOrReturn(CheckValue("serverList[0]", iter.GetValue(), 3UL)); - VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 1)); - VerifyOrReturn(CheckValue("serverList[1]", iter.GetValue(), 4UL)); - VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 2)); - VerifyOrReturn(CheckValue("serverList[2]", iter.GetValue(), 29UL)); - VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 3)); - VerifyOrReturn(CheckValue("serverList[3]", iter.GetValue(), 30UL)); - VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 4)); - VerifyOrReturn(CheckValue("serverList[4]", iter.GetValue(), 31UL)); - VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 5)); - VerifyOrReturn(CheckValue("serverList[5]", iter.GetValue(), 40UL)); - VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 6)); - VerifyOrReturn(CheckValue("serverList[6]", iter.GetValue(), 41UL)); - VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 7)); - VerifyOrReturn(CheckValue("serverList[7]", iter.GetValue(), 42UL)); - VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 8)); - VerifyOrReturn(CheckValue("serverList[8]", iter.GetValue(), 46UL)); - VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 9)); - VerifyOrReturn(CheckValue("serverList[9]", iter.GetValue(), 48UL)); - VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 10)); - VerifyOrReturn(CheckValue("serverList[10]", iter.GetValue(), 49UL)); - VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 11)); - VerifyOrReturn(CheckValue("serverList[11]", iter.GetValue(), 50UL)); - VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 12)); - VerifyOrReturn(CheckValue("serverList[12]", iter.GetValue(), 51UL)); - VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 13)); - VerifyOrReturn(CheckValue("serverList[13]", iter.GetValue(), 52UL)); - VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 14)); - VerifyOrReturn(CheckValue("serverList[14]", iter.GetValue(), 53UL)); - VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 15)); - VerifyOrReturn(CheckValue("serverList[15]", iter.GetValue(), 54UL)); - VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 16)); - VerifyOrReturn(CheckValue("serverList[16]", iter.GetValue(), 55UL)); - VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 17)); - VerifyOrReturn(CheckValue("serverList[17]", iter.GetValue(), 60UL)); - VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 18)); - VerifyOrReturn(CheckValue("serverList[18]", iter.GetValue(), 62UL)); - VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 19)); - VerifyOrReturn(CheckValue("serverList[19]", iter.GetValue(), 63UL)); - VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 20)); - VerifyOrReturn(CheckValue("serverList[20]", iter.GetValue(), 64UL)); - VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 21)); - VerifyOrReturn(CheckValue("serverList[21]", iter.GetValue(), 65UL)); - VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 22)); - VerifyOrReturn(CheckValue("serverList[22]", iter.GetValue(), 1029UL)); - VerifyOrReturn(CheckNoMoreListItems("serverList", iter, 23)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributeClientList_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::DescriptorClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & clientList) - { - auto iter = clientList.begin(); - VerifyOrReturn(CheckNoMoreListItems("clientList", iter, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadAttributePartsList_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::DescriptorClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(const chip::app::DataModel::DecodableList & partsList) - { - auto iter = partsList.begin(); - VerifyOrReturn(CheckNextListItemDecodes("partsList", iter, 0)); - VerifyOrReturn(CheckValue("partsList[0]", iter.GetValue(), 1U)); - VerifyOrReturn(CheckNextListItemDecodes("partsList", iter, 1)); - VerifyOrReturn(CheckValue("partsList[1]", iter.GetValue(), 2U)); - VerifyOrReturn(CheckNoMoreListItems("partsList", iter, 2)); - - NextTest(); - } -}; - -class TestBasicInformation : public TestCommand -{ -public: - TestBasicInformation() : TestCommand("TestBasicInformation"), mTestIndex(0) {} - - /////////// 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 : Write location\n"); - err = TestWriteLocation_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Restore initial location value\n"); - err = TestRestoreInitialLocationValue_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read AttributeList value\n"); - err = TestReadAttributeListValue_3(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) - { - (static_cast(context))->OnSuccessResponse_3(attributeList); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestWriteLocation_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::CharSpan locationArgument; - locationArgument = chip::Span("usgarbage: not in length on purpose", 2); - - ReturnErrorOnFailure(cluster.WriteAttribute( - locationArgument, this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestRestoreInitialLocationValue_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::CharSpan locationArgument; - locationArgument = chip::Span("garbage: not in length on purpose", 0); - - ReturnErrorOnFailure(cluster.WriteAttribute( - locationArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2() { NextTest(); } - - CHIP_ERROR TestReadAttributeListValue_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & attributeList) - { - auto iter = attributeList.begin(); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter, 0)); - VerifyOrReturn(CheckValue("attributeList[0]", iter.GetValue(), 0UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter, 1)); - VerifyOrReturn(CheckValue("attributeList[1]", iter.GetValue(), 1UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter, 2)); - VerifyOrReturn(CheckValue("attributeList[2]", iter.GetValue(), 2UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter, 3)); - VerifyOrReturn(CheckValue("attributeList[3]", iter.GetValue(), 3UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter, 4)); - VerifyOrReturn(CheckValue("attributeList[4]", iter.GetValue(), 4UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter, 5)); - VerifyOrReturn(CheckValue("attributeList[5]", iter.GetValue(), 5UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter, 6)); - VerifyOrReturn(CheckValue("attributeList[6]", iter.GetValue(), 6UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter, 7)); - VerifyOrReturn(CheckValue("attributeList[7]", iter.GetValue(), 7UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter, 8)); - VerifyOrReturn(CheckValue("attributeList[8]", iter.GetValue(), 8UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter, 9)); - VerifyOrReturn(CheckValue("attributeList[9]", iter.GetValue(), 9UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter, 10)); - VerifyOrReturn(CheckValue("attributeList[10]", iter.GetValue(), 10UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter, 11)); - VerifyOrReturn(CheckValue("attributeList[11]", iter.GetValue(), 11UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter, 12)); - VerifyOrReturn(CheckValue("attributeList[12]", iter.GetValue(), 12UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter, 13)); - VerifyOrReturn(CheckValue("attributeList[13]", iter.GetValue(), 13UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter, 14)); - VerifyOrReturn(CheckValue("attributeList[14]", iter.GetValue(), 14UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter, 15)); - VerifyOrReturn(CheckValue("attributeList[15]", iter.GetValue(), 15UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter, 16)); - VerifyOrReturn(CheckValue("attributeList[16]", iter.GetValue(), 16UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter, 17)); - VerifyOrReturn(CheckValue("attributeList[17]", iter.GetValue(), 17UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter, 18)); - VerifyOrReturn(CheckValue("attributeList[18]", iter.GetValue(), 18UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter, 19)); - VerifyOrReturn(CheckValue("attributeList[19]", iter.GetValue(), 65531UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter, 20)); - VerifyOrReturn(CheckValue("attributeList[20]", iter.GetValue(), 65533UL)); - VerifyOrReturn(CheckNoMoreListItems("attributeList", iter, 21)); - - NextTest(); - } -}; - -class TestIdentifyCluster : public TestCommand -{ -public: - TestIdentifyCluster() : TestCommand("TestIdentifyCluster"), mTestIndex(0) {} - - /////////// 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); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestSendIdentifyCommandAndExpectSuccessResponse_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - using RequestType = chip::app::Clusters::Identify::Commands::Identify::Type; - - RequestType request; - request.identifyTime = 0U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } -}; - -class TestGroupsCluster : public TestCommand -{ -public: - TestGroupsCluster() : TestCommand("TestGroupsCluster"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: TestGroupsCluster\n"); - } - - if (mTestCount == mTestIndex) - { - 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 : 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 : Add Group 2 (new)\n"); - err = TestAddGroup2New_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : View Group 2 (new)\n"); - err = TestViewGroup2New_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : View Group 3 (not found)\n"); - err = TestViewGroup3NotFound_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Add Group 3 (new)\n"); - err = TestAddGroup3New_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : View Group 1 (existing)\n"); - err = TestViewGroup1Existing_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : View Group 2 (existing)\n"); - err = TestViewGroup2Existing_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Get Group Membership 2\n"); - err = TestGetGroupMembership2_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : View Group 3 (new)\n"); - err = TestViewGroup3New_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Remove Group 0 (invalid)\n"); - err = TestRemoveGroup0Invalid_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Remove Group 4 (not found)\n"); - err = TestRemoveGroup4NotFound_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Remove Group 2 (existing)\n"); - err = TestRemoveGroup2Existing_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : View Group 1 (not removed)\n"); - err = TestViewGroup1NotRemoved_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : View Group 2 (removed)\n"); - err = TestViewGroup2Removed_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : View Group 3 (not removed)\n"); - err = TestViewGroup3NotRemoved_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Get Group Membership 3\n"); - err = TestGetGroupMembership3_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Remove All\n"); - err = TestRemoveAll_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : View Group 1 (removed)\n"); - err = TestViewGroup1Removed_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : View Group 2 (still removed)\n"); - err = TestViewGroup2StillRemoved_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : View Group 3 (removed)\n"); - err = TestViewGroup3Removed_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Get Group Membership 4\n"); - err = TestGetGroupMembership4_26(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 27; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestViewGroup0Invalid_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; - - RequestType request; - request.groupId = 0U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(data.status, data.groupId, data.groupName); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint8_t status, uint16_t groupId, chip::CharSpan groupName) - { - VerifyOrReturn(CheckValue("status", status, 135)); - - VerifyOrReturn(CheckValue("groupId", groupId, 0U)); - - NextTest(); - } - - CHIP_ERROR TestViewGroup1NotFound_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; - - RequestType request; - request.groupId = 1U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_2(data.status, data.groupId, data.groupName); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_2(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint8_t status, uint16_t groupId, chip::CharSpan groupName) - { - VerifyOrReturn(CheckValue("status", status, 139)); - - VerifyOrReturn(CheckValue("groupId", groupId, 1U)); - - NextTest(); - } - - CHIP_ERROR TestAddGroup1New_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::AddGroup::Type; - - RequestType request; - request.groupId = 1U; - request.groupName = chip::Span("Group #1garbage: not in length on purpose", 8); - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(data.status, data.groupId); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(uint8_t status, uint16_t groupId) - { - VerifyOrReturn(CheckValue("status", status, 0)); - - VerifyOrReturn(CheckValue("groupId", groupId, 1U)); - - NextTest(); - } - - CHIP_ERROR TestViewGroup1New_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; - - RequestType request; - request.groupId = 1U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(data.status, data.groupId, data.groupName); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint8_t status, uint16_t groupId, chip::CharSpan groupName) - { - VerifyOrReturn(CheckValue("status", status, 0)); - - VerifyOrReturn(CheckValue("groupId", groupId, 1U)); - - VerifyOrReturn(CheckValueAsString("groupName", groupName, chip::CharSpan("Group #1", 8))); - - NextTest(); - } - - CHIP_ERROR TestViewGroup2NotFound_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; - - RequestType request; - request.groupId = 4369U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(data.status, data.groupId, data.groupName); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_5(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(uint8_t status, uint16_t groupId, chip::CharSpan groupName) - { - VerifyOrReturn(CheckValue("status", status, 139)); - - VerifyOrReturn(CheckValue("groupId", groupId, 4369U)); - - NextTest(); - } - - CHIP_ERROR TestGetGroupMembership1All_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::GetGroupMembership::Type; - - RequestType request; - - request.groupList = chip::app::DataModel::List(); - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_6(data.capacity, data.groupList); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_6(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(uint8_t capacity, const chip::app::DataModel::DecodableList & groupList) - { - VerifyOrReturn(CheckValue("capacity", capacity, 255)); - - auto iter = groupList.begin(); - VerifyOrReturn(CheckNextListItemDecodes("groupList", iter, 0)); - VerifyOrReturn(CheckValue("groupList[0]", iter.GetValue(), 1U)); - VerifyOrReturn(CheckNoMoreListItems("groupList", iter, 1)); - - NextTest(); - } - - CHIP_ERROR TestAddGroup2New_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::AddGroup::Type; - - RequestType request; - request.groupId = 4369U; - request.groupName = chip::Span("Group #2garbage: not in length on purpose", 8); - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_7(data.status, data.groupId); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_7(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(uint8_t status, uint16_t groupId) - { - VerifyOrReturn(CheckValue("status", status, 0)); - - VerifyOrReturn(CheckValue("groupId", groupId, 4369U)); - - NextTest(); - } - - CHIP_ERROR TestViewGroup2New_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; - - RequestType request; - request.groupId = 4369U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_8(data.status, data.groupId, data.groupName); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_8(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8(uint8_t status, uint16_t groupId, chip::CharSpan groupName) - { - VerifyOrReturn(CheckValue("status", status, 0)); - - VerifyOrReturn(CheckValue("groupId", groupId, 4369U)); - - VerifyOrReturn(CheckValueAsString("groupName", groupName, chip::CharSpan("Group #2", 8))); - - NextTest(); - } - - CHIP_ERROR TestViewGroup3NotFound_9() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; - - RequestType request; - request.groupId = 32767U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_9(data.status, data.groupId, data.groupName); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_9(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9(uint8_t status, uint16_t groupId, chip::CharSpan groupName) - { - VerifyOrReturn(CheckValue("status", status, 139)); - - VerifyOrReturn(CheckValue("groupId", groupId, 32767U)); - - NextTest(); - } - - CHIP_ERROR TestAddGroup3New_10() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::AddGroup::Type; - - RequestType request; - request.groupId = 32767U; - request.groupName = chip::Span("Group #3garbage: not in length on purpose", 8); - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_10(data.status, data.groupId); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_10(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10(uint8_t status, uint16_t groupId) - { - VerifyOrReturn(CheckValue("status", status, 0)); - - VerifyOrReturn(CheckValue("groupId", groupId, 32767U)); - - NextTest(); - } - - CHIP_ERROR TestViewGroup1Existing_11() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; - - RequestType request; - request.groupId = 1U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_11(data.status, data.groupId, data.groupName); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_11(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_11(uint8_t status, uint16_t groupId, chip::CharSpan groupName) - { - VerifyOrReturn(CheckValue("status", status, 0)); - - VerifyOrReturn(CheckValue("groupId", groupId, 1U)); - - VerifyOrReturn(CheckValueAsString("groupName", groupName, chip::CharSpan("Group #1", 8))); - - NextTest(); - } - - CHIP_ERROR TestViewGroup2Existing_12() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; - - RequestType request; - request.groupId = 4369U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_12(data.status, data.groupId, data.groupName); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_12(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_12(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_12(uint8_t status, uint16_t groupId, chip::CharSpan groupName) - { - VerifyOrReturn(CheckValue("status", status, 0)); - - VerifyOrReturn(CheckValue("groupId", groupId, 4369U)); - - VerifyOrReturn(CheckValueAsString("groupName", groupName, chip::CharSpan("Group #2", 8))); - - NextTest(); - } - - CHIP_ERROR TestGetGroupMembership2_13() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::GetGroupMembership::Type; - - RequestType request; - - uint16_t groupListList[3]; - groupListList[0] = 2U; - groupListList[1] = 3U; - groupListList[2] = 32767U; - request.groupList = groupListList; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_13(data.capacity, data.groupList); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_13(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_13(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_13(uint8_t capacity, const chip::app::DataModel::DecodableList & groupList) - { - VerifyOrReturn(CheckValue("capacity", capacity, 255)); - - auto iter = groupList.begin(); - VerifyOrReturn(CheckNextListItemDecodes("groupList", iter, 0)); - VerifyOrReturn(CheckValue("groupList[0]", iter.GetValue(), 32767U)); - VerifyOrReturn(CheckNoMoreListItems("groupList", iter, 1)); - - NextTest(); - } - - CHIP_ERROR TestViewGroup3New_14() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; - - RequestType request; - request.groupId = 32767U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_14(data.status, data.groupId, data.groupName); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_14(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_14(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_14(uint8_t status, uint16_t groupId, chip::CharSpan groupName) - { - VerifyOrReturn(CheckValue("status", status, 0)); - - VerifyOrReturn(CheckValue("groupId", groupId, 32767U)); - - VerifyOrReturn(CheckValueAsString("groupName", groupName, chip::CharSpan("Group #3", 8))); - - NextTest(); - } - - CHIP_ERROR TestRemoveGroup0Invalid_15() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::RemoveGroup::Type; - - RequestType request; - request.groupId = 0U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_15(data.status, data.groupId); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_15(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_15(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_15(uint8_t status, uint16_t groupId) - { - VerifyOrReturn(CheckValue("status", status, 135)); - - VerifyOrReturn(CheckValue("groupId", groupId, 0U)); - - NextTest(); - } - - CHIP_ERROR TestRemoveGroup4NotFound_16() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::RemoveGroup::Type; - - RequestType request; - request.groupId = 4U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_16(data.status, data.groupId); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_16(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_16(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_16(uint8_t status, uint16_t groupId) - { - VerifyOrReturn(CheckValue("status", status, 139)); - - VerifyOrReturn(CheckValue("groupId", groupId, 4U)); - - NextTest(); - } - - CHIP_ERROR TestRemoveGroup2Existing_17() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::RemoveGroup::Type; - - RequestType request; - request.groupId = 4369U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_17(data.status, data.groupId); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_17(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_17(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_17(uint8_t status, uint16_t groupId) - { - VerifyOrReturn(CheckValue("status", status, 0)); - - VerifyOrReturn(CheckValue("groupId", groupId, 4369U)); - - NextTest(); - } - - CHIP_ERROR TestViewGroup1NotRemoved_18() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; - - RequestType request; - request.groupId = 1U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_18(data.status, data.groupId, data.groupName); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_18(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_18(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_18(uint8_t status, uint16_t groupId, chip::CharSpan groupName) - { - VerifyOrReturn(CheckValue("status", status, 0)); - - VerifyOrReturn(CheckValue("groupId", groupId, 1U)); - - VerifyOrReturn(CheckValueAsString("groupName", groupName, chip::CharSpan("Group #1", 8))); - - NextTest(); - } - - CHIP_ERROR TestViewGroup2Removed_19() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; - - RequestType request; - request.groupId = 4369U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_19(data.status, data.groupId, data.groupName); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_19(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_19(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_19(uint8_t status, uint16_t groupId, chip::CharSpan groupName) - { - VerifyOrReturn(CheckValue("status", status, 139)); - - VerifyOrReturn(CheckValue("groupId", groupId, 4369U)); - - NextTest(); - } - - CHIP_ERROR TestViewGroup3NotRemoved_20() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; - - RequestType request; - request.groupId = 32767U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_20(data.status, data.groupId, data.groupName); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_20(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_20(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_20(uint8_t status, uint16_t groupId, chip::CharSpan groupName) - { - VerifyOrReturn(CheckValue("status", status, 0)); - - VerifyOrReturn(CheckValue("groupId", groupId, 32767U)); - - VerifyOrReturn(CheckValueAsString("groupName", groupName, chip::CharSpan("Group #3", 8))); - - NextTest(); - } - - CHIP_ERROR TestGetGroupMembership3_21() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::GetGroupMembership::Type; - - RequestType request; - - uint16_t groupListList[4]; - groupListList[0] = 1U; - groupListList[1] = 2U; - groupListList[2] = 4369U; - groupListList[3] = 3U; - request.groupList = groupListList; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_21(data.capacity, data.groupList); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_21(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_21(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_21(uint8_t capacity, const chip::app::DataModel::DecodableList & groupList) - { - VerifyOrReturn(CheckValue("capacity", capacity, 255)); - - auto iter = groupList.begin(); - VerifyOrReturn(CheckNextListItemDecodes("groupList", iter, 0)); - VerifyOrReturn(CheckValue("groupList[0]", iter.GetValue(), 1U)); - VerifyOrReturn(CheckNoMoreListItems("groupList", iter, 1)); - - NextTest(); - } - - CHIP_ERROR TestRemoveAll_22() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::RemoveAllGroups::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_22(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_22(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_22(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_22() { NextTest(); } - - CHIP_ERROR TestViewGroup1Removed_23() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; - - RequestType request; - request.groupId = 1U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_23(data.status, data.groupId, data.groupName); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_23(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_23(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_23(uint8_t status, uint16_t groupId, chip::CharSpan groupName) - { - VerifyOrReturn(CheckValue("status", status, 139)); - - VerifyOrReturn(CheckValue("groupId", groupId, 1U)); - - NextTest(); - } - - CHIP_ERROR TestViewGroup2StillRemoved_24() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; - - RequestType request; - request.groupId = 4369U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_24(data.status, data.groupId, data.groupName); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_24(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_24(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_24(uint8_t status, uint16_t groupId, chip::CharSpan groupName) - { - VerifyOrReturn(CheckValue("status", status, 139)); - - VerifyOrReturn(CheckValue("groupId", groupId, 4369U)); - - NextTest(); - } - - CHIP_ERROR TestViewGroup3Removed_25() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; - - RequestType request; - request.groupId = 32767U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_25(data.status, data.groupId, data.groupName); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_25(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_25(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_25(uint8_t status, uint16_t groupId, chip::CharSpan groupName) - { - VerifyOrReturn(CheckValue("status", status, 139)); - - VerifyOrReturn(CheckValue("groupId", groupId, 32767U)); - - NextTest(); - } - - CHIP_ERROR TestGetGroupMembership4_26() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::GetGroupMembership::Type; - - RequestType request; - - uint16_t groupListList[5]; - groupListList[0] = 1U; - groupListList[1] = 2U; - groupListList[2] = 4369U; - groupListList[3] = 3U; - groupListList[4] = 32767U; - request.groupList = groupListList; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_26(data.capacity, data.groupList); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_26(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_26(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_26(uint8_t capacity, const chip::app::DataModel::DecodableList & groupList) - { - VerifyOrReturn(CheckValue("capacity", capacity, 255)); - - auto iter = groupList.begin(); - VerifyOrReturn(CheckNoMoreListItems("groupList", iter, 0)); - - NextTest(); - } -}; - -class TestOperationalCredentialsCluster : public TestCommand -{ -public: - TestOperationalCredentialsCluster() : TestCommand("TestOperationalCredentialsCluster"), mTestIndex(0) {} - - /////////// 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; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint8_t supportedFabrics) - { - (static_cast(context))->OnSuccessResponse_1(supportedFabrics); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint8_t commissionedFabrics) - { - (static_cast(context))->OnSuccessResponse_2(commissionedFabrics); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, chip::FabricIndex currentFabricIndex) - { - (static_cast(context))->OnSuccessResponse_3(currentFabricIndex); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadNumberOfSupportedFabrics_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::OperationalCredentialsClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint8_t supportedFabrics) - { - VerifyOrReturn(CheckConstraintType("supportedFabrics", "", "uint8")); - VerifyOrReturn(CheckConstraintMinValue("supportedFabrics", supportedFabrics, 4)); - - NextTest(); - } - - CHIP_ERROR TestReadNumberOfCommissionedFabrics_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::OperationalCredentialsClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint8_t commissionedFabrics) - { - VerifyOrReturn(CheckConstraintType("commissionedFabrics", "", "uint8")); - VerifyOrReturn(CheckConstraintMinValue("commissionedFabrics", commissionedFabrics, 1)); - - NextTest(); - } - - CHIP_ERROR TestReadCurrentFabricIndex_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::OperationalCredentialsClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(chip::FabricIndex currentFabricIndex) - { - VerifyOrReturn(CheckConstraintType("currentFabricIndex", "", "uint8")); - VerifyOrReturn(CheckConstraintMinValue("currentFabricIndex", currentFabricIndex, 1)); - - NextTest(); - } -}; - -class TestModeSelectCluster : public TestCommand -{ -public: - TestModeSelectCluster() : TestCommand("TestModeSelectCluster"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: TestModeSelectCluster\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: TestModeSelectCluster\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 CurrentMode\n"); - err = TestReadCurrentMode_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read OnMode\n"); - err = TestReadOnMode_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read StartUpMode\n"); - err = TestReadStartUpMode_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read Description\n"); - err = TestReadDescription_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read SupportedModes\n"); - err = TestReadSupportedModes_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Change to Supported Mode\n"); - err = TestChangeToSupportedMode_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Verify Current Mode Change\n"); - err = TestVerifyCurrentModeChange_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Change to Unsupported Mode\n"); - err = TestChangeToUnsupportedMode_8(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint8_t currentMode) - { - (static_cast(context))->OnSuccessResponse_1(currentMode); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint8_t onMode) - { - (static_cast(context))->OnSuccessResponse_2(onMode); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, uint8_t startUpMode) - { - (static_cast(context))->OnSuccessResponse_3(startUpMode); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, chip::CharSpan description) - { - (static_cast(context))->OnSuccessResponse_4(description); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5( - void * context, - const chip::app::DataModel::DecodableList & - supportedModes) - { - (static_cast(context))->OnSuccessResponse_5(supportedModes); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, uint8_t currentMode) - { - (static_cast(context))->OnSuccessResponse_7(currentMode); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadCurrentMode_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ModeSelectClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(uint8_t currentMode) - { - VerifyOrReturn(CheckValue("currentMode", currentMode, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadOnMode_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ModeSelectClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint8_t onMode) - { - VerifyOrReturn(CheckValue("onMode", onMode, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadStartUpMode_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ModeSelectClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(uint8_t startUpMode) - { - VerifyOrReturn(CheckValue("startUpMode", startUpMode, 0)); - - NextTest(); - } - - CHIP_ERROR TestReadDescription_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ModeSelectClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(chip::CharSpan description) - { - VerifyOrReturn(CheckValueAsString("description", description, chip::CharSpan("Coffee", 6))); - - NextTest(); - } - - CHIP_ERROR TestReadSupportedModes_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ModeSelectClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5( - const chip::app::DataModel::DecodableList & - supportedModes) - { - auto iter = supportedModes.begin(); - VerifyOrReturn(CheckNextListItemDecodes("supportedModes", iter, 0)); - VerifyOrReturn(CheckValueAsString("supportedModes[0].label", iter.GetValue().label, chip::CharSpan("Black", 5))); - VerifyOrReturn(CheckValue("supportedModes[0].mode", iter.GetValue().mode, 0)); - VerifyOrReturn(CheckValue("supportedModes[0].semanticTag", iter.GetValue().semanticTag, 0UL)); - VerifyOrReturn(CheckNextListItemDecodes("supportedModes", iter, 1)); - VerifyOrReturn(CheckValueAsString("supportedModes[1].label", iter.GetValue().label, chip::CharSpan("Cappuccino", 10))); - VerifyOrReturn(CheckValue("supportedModes[1].mode", iter.GetValue().mode, 4)); - VerifyOrReturn(CheckValue("supportedModes[1].semanticTag", iter.GetValue().semanticTag, 0UL)); - VerifyOrReturn(CheckNextListItemDecodes("supportedModes", iter, 2)); - VerifyOrReturn(CheckValueAsString("supportedModes[2].label", iter.GetValue().label, chip::CharSpan("Espresso", 8))); - VerifyOrReturn(CheckValue("supportedModes[2].mode", iter.GetValue().mode, 7)); - VerifyOrReturn(CheckValue("supportedModes[2].semanticTag", iter.GetValue().semanticTag, 0UL)); - VerifyOrReturn(CheckNoMoreListItems("supportedModes", iter, 3)); - - NextTest(); - } - - CHIP_ERROR TestChangeToSupportedMode_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type; - - RequestType request; - request.newMode = 4; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_6(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_6(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6() { NextTest(); } - - CHIP_ERROR TestVerifyCurrentModeChange_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::ModeSelectClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(uint8_t currentMode) - { - VerifyOrReturn(CheckValue("currentMode", currentMode, 4)); - - NextTest(); - } - - CHIP_ERROR TestChangeToUnsupportedMode_8() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type; - - RequestType request; - request.newMode = 2; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_8(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_8(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_8(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } - - void OnSuccessResponse_8() { ThrowSuccessResponse(); } -}; - -class TestGroupMessaging : public TestCommand -{ -public: - TestGroupMessaging() : TestCommand("TestGroupMessaging"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: TestGroupMessaging\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: TestGroupMessaging\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 : Group Write Attribute\n"); - err = TestGroupWriteAttribute_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Restore initial location value\n"); - err = TestRestoreInitialLocationValue_2(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - static void OnDoneCallback_1(void * context) { (static_cast(context))->OnDoneResponse_1(); } - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } - - static void OnDoneCallback_2(void * context) { (static_cast(context))->OnDoneResponse_2(); } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestGroupWriteAttribute_1() - { - const chip::GroupId groupId = 1234; - chip::Controller::BasicClusterTest cluster; - cluster.AssociateWithGroup(mDevices[kIdentityAlpha], groupId); - - chip::CharSpan locationArgument; - locationArgument = chip::Span("usgarbage: not in length on purpose", 2); - - ReturnErrorOnFailure(cluster.WriteAttribute( - locationArgument, this, OnSuccessCallback_1, OnFailureCallback_1, OnDoneCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - void OnDoneResponse_1() { NextTest(); } - - CHIP_ERROR TestRestoreInitialLocationValue_2() - { - const chip::GroupId groupId = 1234; - chip::Controller::BasicClusterTest cluster; - cluster.AssociateWithGroup(mDevices[kIdentityAlpha], groupId); - - chip::CharSpan locationArgument; - locationArgument = chip::Span("garbage: not in length on purpose", 0); - - ReturnErrorOnFailure(cluster.WriteAttribute( - locationArgument, this, OnSuccessCallback_2, OnFailureCallback_2, OnDoneCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2() { NextTest(); } - - void OnDoneResponse_2() { NextTest(); } -}; - -class Test_TC_DIAGSW_1_1 : public TestCommand -{ -public: - Test_TC_DIAGSW_1_1() : TestCommand("Test_TC_DIAGSW_1_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DIAGSW_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DIAGSW_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 : Reads CurrentHeapFree non-global attribute value from DUT\n"); - err = TestReadsCurrentHeapFreeNonGlobalAttributeValueFromDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads CurrentHeapUsed non-global attribute value from DUT\n"); - err = ShouldSkip("A_CURRENTHEAPUSED") ? CHIP_NO_ERROR : TestReadsCurrentHeapUsedNonGlobalAttributeValueFromDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentHeapHighWaterMark non-global attribute value from DUT\n"); - err = ShouldSkip("A_CURRENTHEAPHIGHWATERMARK") ? CHIP_NO_ERROR - : TestReadsCurrentHeapHighWaterMarkNonGlobalAttributeValueFromDut_3(); - break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; - - static void OnFailureCallback_1(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_1(status); - } - - static void OnSuccessCallback_1(void * context, uint64_t currentHeapFree) - { - (static_cast(context))->OnSuccessResponse_1(currentHeapFree); - } - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, uint64_t currentHeapUsed) - { - (static_cast(context))->OnSuccessResponse_2(currentHeapUsed); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, uint64_t currentHeapHighWatermark) - { - (static_cast(context))->OnSuccessResponse_3(currentHeapHighWatermark); - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestReadsCurrentHeapFreeNonGlobalAttributeValueFromDut_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::SoftwareDiagnosticsClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) - { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); - } - - void OnSuccessResponse_1(uint64_t currentHeapFree) - { - VerifyOrReturn(CheckConstraintType("currentHeapFree", "", "uint64")); - - NextTest(); - } - - CHIP_ERROR TestReadsCurrentHeapUsedNonGlobalAttributeValueFromDut_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::SoftwareDiagnosticsClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) - { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); - } - - void OnSuccessResponse_2(uint64_t currentHeapUsed) - { - VerifyOrReturn(CheckConstraintType("currentHeapUsed", "", "uint64")); - - NextTest(); - } - - CHIP_ERROR TestReadsCurrentHeapHighWaterMarkNonGlobalAttributeValueFromDut_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::SoftwareDiagnosticsClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure( - cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) - { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); - } - - void OnSuccessResponse_3(uint64_t currentHeapHighWatermark) - { - VerifyOrReturn(CheckConstraintType("currentHeapHighWatermark", "", "uint64")); - - NextTest(); - } -}; - -class Test_TC_DIAGSW_2_1 : public TestCommand -{ -public: - Test_TC_DIAGSW_2_1() : TestCommand("Test_TC_DIAGSW_2_1"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DIAGSW_2_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DIAGSW_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++) - { - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 0; - - // - // Tests methods - // -}; - -class Test_TC_DIAGSW_3_2 : public TestCommand -{ -public: - Test_TC_DIAGSW_3_2() : TestCommand("Test_TC_DIAGSW_3_2"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DIAGSW_3_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DIAGSW_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; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } -}; - -class TestSubscribe_OnOff : public TestCommand -{ -public: - TestSubscribe_OnOff() : TestCommand("TestSubscribe_OnOff"), mTestIndex(0) {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: TestSubscribe_OnOff\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: TestSubscribe_OnOff\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 : 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; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; - - typedef void (*Test_TestSubscribe_OnOff_OnOff_ReportCallback)(void * context, bool value); - Test_TestSubscribe_OnOff_OnOff_ReportCallback mTest_TestSubscribe_OnOff_OnOff_Reported = nullptr; - - static void OnFailureCallback_2(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_2(status); - } - - static void OnSuccessCallback_2(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_2(onOff); - } - - bool mReceivedReport_2 = false; - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_3(onOff); - } - - static void OnSubscriptionEstablished_3(void * context) - { - (static_cast(context))->OnSubscriptionEstablishedResponse_3(); - } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_5(onOff); - } - - bool mReceivedReport_5 = false; - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_7(onOff); - } - - bool mReceivedReport_7 = false; - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); - } - - CHIP_ERROR TestSetOnOffAttributeToFalse_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestReportSubscribeOnOffAttribute_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - mTest_TestSubscribe_OnOff_OnOff_Reported = OnSuccessCallback_2; - return WaitForMs(0); - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(bool onOff) - { - mReceivedReport_2 = true; - - VerifyOrReturn(CheckValue("onOff", onOff, false)); - } - - CHIP_ERROR TestSubscribeOnOffAttribute_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t minIntervalArgument; - minIntervalArgument = 2U; - uint16_t maxIntervalArgument; - maxIntervalArgument = 10U; - - ReturnErrorOnFailure(cluster.SubscribeAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3, minIntervalArgument, maxIntervalArgument, OnSubscriptionEstablished_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(bool value) - { - if (mTest_TestSubscribe_OnOff_OnOff_Reported) - { - auto callback = mTest_TestSubscribe_OnOff_OnOff_Reported; - mTest_TestSubscribe_OnOff_OnOff_Reported = nullptr; - callback(this, value); - } - } - - void OnSubscriptionEstablishedResponse_3() - { - VerifyOrReturn(mReceivedReport_2, Exit("Initial report not received!")); - NextTest(); - } - - CHIP_ERROR TestTurnOnTheLightToSeeAttributeChange_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestCheckForAttributeReport_5() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - mTest_TestSubscribe_OnOff_OnOff_Reported = OnSuccessCallback_5; - return CHIP_NO_ERROR; - } - - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_5(bool onOff) - { - mReceivedReport_5 = true; - - VerifyOrReturn(CheckValue("onOff", onOff, true)); - - NextTest(); - } - - CHIP_ERROR TestTurnOffTheLightToSeeAttributeChange_6() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_6(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_6(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6() { NextTest(); } - - CHIP_ERROR TestCheckForAttributeReport_7() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - mTest_TestSubscribe_OnOff_OnOff_Reported = OnSuccessCallback_7; - return CHIP_NO_ERROR; - } - - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(bool onOff) - { - mReceivedReport_7 = true; - - VerifyOrReturn(CheckValue("onOff", onOff, false)); - - NextTest(); - } -}; - -void registerCommandsTests(Commands & commands) -{ - const char * clusterName = "Tests"; - - commands_list clusterCommands = { - 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(), - 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(), - 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(), - }; - - commands.Register(clusterName, clusterCommands); -} * 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. @@ -87837,7 +29927,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_16(status); } - static void OnSuccessCallback_16(void * context, uint16_t targetPositionLiftPercent100ths) + static void OnSuccessCallback_16(void * context, + const chip::app::DataModel::Nullable & targetPositionLiftPercent100ths) { (static_cast(context))->OnSuccessResponse_16(targetPositionLiftPercent100ths); } @@ -87854,7 +29945,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_18(status); } - static void OnSuccessCallback_18(void * context, uint16_t targetPositionLiftPercent100ths) + static void OnSuccessCallback_18(void * context, + const chip::app::DataModel::Nullable & targetPositionLiftPercent100ths) { (static_cast(context))->OnSuccessResponse_18(targetPositionLiftPercent100ths); } @@ -87864,7 +29956,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_19(status); } - static void OnSuccessCallback_19(void * context, uint16_t targetPositionTiltPercent100ths) + static void OnSuccessCallback_19(void * context, + const chip::app::DataModel::Nullable & targetPositionTiltPercent100ths) { (static_cast(context))->OnSuccessResponse_19(targetPositionTiltPercent100ths); } @@ -87881,7 +29974,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_21(status); } - static void OnSuccessCallback_21(void * context, uint16_t targetPositionTiltPercent100ths) + static void OnSuccessCallback_21(void * context, + const chip::app::DataModel::Nullable & targetPositionTiltPercent100ths) { (static_cast(context))->OnSuccessResponse_21(targetPositionTiltPercent100ths); } @@ -87891,7 +29985,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_22(status); } - static void OnSuccessCallback_22(void * context, uint16_t currentPositionLiftPercent100ths) + static void OnSuccessCallback_22(void * context, + const chip::app::DataModel::Nullable & currentPositionLiftPercent100ths) { (static_cast(context))->OnSuccessResponse_22(currentPositionLiftPercent100ths); } @@ -87908,7 +30003,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_24(status); } - static void OnSuccessCallback_24(void * context, uint16_t currentPositionLiftPercent100ths) + static void OnSuccessCallback_24(void * context, + const chip::app::DataModel::Nullable & currentPositionLiftPercent100ths) { (static_cast(context))->OnSuccessResponse_24(currentPositionLiftPercent100ths); } @@ -87918,7 +30014,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_25(status); } - static void OnSuccessCallback_25(void * context, uint16_t currentPositionTiltPercent100ths) + static void OnSuccessCallback_25(void * context, + const chip::app::DataModel::Nullable & currentPositionTiltPercent100ths) { (static_cast(context))->OnSuccessResponse_25(currentPositionTiltPercent100ths); } @@ -87935,7 +30032,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_27(status); } - static void OnSuccessCallback_27(void * context, uint16_t currentPositionTiltPercent100ths) + static void OnSuccessCallback_27(void * context, + const chip::app::DataModel::Nullable & currentPositionTiltPercent100ths) { (static_cast(context))->OnSuccessResponse_27(currentPositionTiltPercent100ths); } @@ -88080,7 +30178,7 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_43(status); } - static void OnSuccessCallback_43(void * context, uint16_t currentPositionLift) + static void OnSuccessCallback_43(void * context, const chip::app::DataModel::Nullable & currentPositionLift) { (static_cast(context))->OnSuccessResponse_43(currentPositionLift); } @@ -88097,7 +30195,7 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_45(status); } - static void OnSuccessCallback_45(void * context, uint16_t currentPositionLift) + static void OnSuccessCallback_45(void * context, const chip::app::DataModel::Nullable & currentPositionLift) { (static_cast(context))->OnSuccessResponse_45(currentPositionLift); } @@ -88107,7 +30205,7 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_46(status); } - static void OnSuccessCallback_46(void * context, uint16_t currentPositionTilt) + static void OnSuccessCallback_46(void * context, const chip::app::DataModel::Nullable & currentPositionTilt) { (static_cast(context))->OnSuccessResponse_46(currentPositionTilt); } @@ -88124,7 +30222,7 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_48(status); } - static void OnSuccessCallback_48(void * context, uint16_t currentPositionTilt) + static void OnSuccessCallback_48(void * context, const chip::app::DataModel::Nullable & currentPositionTilt) { (static_cast(context))->OnSuccessResponse_48(currentPositionTilt); } @@ -88134,7 +30232,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_49(status); } - static void OnSuccessCallback_49(void * context, uint8_t currentPositionLiftPercentage) + static void OnSuccessCallback_49(void * context, + const chip::app::DataModel::Nullable & currentPositionLiftPercentage) { (static_cast(context))->OnSuccessResponse_49(currentPositionLiftPercentage); } @@ -88151,7 +30250,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_51(status); } - static void OnSuccessCallback_51(void * context, uint8_t currentPositionLiftPercentage) + static void OnSuccessCallback_51(void * context, + const chip::app::DataModel::Nullable & currentPositionLiftPercentage) { (static_cast(context))->OnSuccessResponse_51(currentPositionLiftPercentage); } @@ -88161,7 +30261,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_52(status); } - static void OnSuccessCallback_52(void * context, uint8_t currentPositionTiltPercentage) + static void OnSuccessCallback_52(void * context, + const chip::app::DataModel::Nullable & currentPositionTiltPercentage) { (static_cast(context))->OnSuccessResponse_52(currentPositionTiltPercentage); } @@ -88178,7 +30279,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_54(status); } - static void OnSuccessCallback_54(void * context, uint8_t currentPositionTiltPercentage) + static void OnSuccessCallback_54(void * context, + const chip::app::DataModel::Nullable & currentPositionTiltPercentage) { (static_cast(context))->OnSuccessResponse_54(currentPositionTiltPercentage); } @@ -88522,11 +30624,11 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_16(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_16(uint16_t targetPositionLiftPercent100ths) + void OnSuccessResponse_16(const chip::app::DataModel::Nullable & targetPositionLiftPercent100ths) { - VerifyOrReturn(CheckConstraintType("targetPositionLiftPercent100ths", "", "uint16")); - VerifyOrReturn( - CheckConstraintMaxValue("targetPositionLiftPercent100ths", targetPositionLiftPercent100ths, 10000U)); + VerifyOrReturn(CheckConstraintType("targetPositionLiftPercent100ths", "", "Percent100ths")); + VerifyOrReturn(CheckConstraintMaxValue("targetPositionLiftPercent100ths", + targetPositionLiftPercent100ths, 10000U)); NextTest(); } @@ -88537,8 +30639,8 @@ class Test_TC_WNCV_2_1 : public TestCommand chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint16_t targetPositionLiftPercent100thsArgument; - targetPositionLiftPercent100thsArgument = 20000U; + chip::app::DataModel::Nullable targetPositionLiftPercent100thsArgument; + targetPositionLiftPercent100thsArgument.SetNonNull() = 20000U; ReturnErrorOnFailure( cluster.WriteAttribute( @@ -88568,9 +30670,9 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_18(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_18(uint16_t targetPositionLiftPercent100ths) + void OnSuccessResponse_18(const chip::app::DataModel::Nullable & targetPositionLiftPercent100ths) { - VerifyOrReturn(CheckConstraintType("targetPositionLiftPercent100ths", "", "uint16")); + VerifyOrReturn(CheckConstraintType("targetPositionLiftPercent100ths", "", "Percent100ths")); VerifyOrReturn(CheckConstraintNotValue("targetPositionLiftPercent100ths", targetPositionLiftPercent100ths, 20000U)); NextTest(); @@ -88590,11 +30692,11 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_19(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_19(uint16_t targetPositionTiltPercent100ths) + void OnSuccessResponse_19(const chip::app::DataModel::Nullable & targetPositionTiltPercent100ths) { - VerifyOrReturn(CheckConstraintType("targetPositionTiltPercent100ths", "", "uint16")); - VerifyOrReturn( - CheckConstraintMaxValue("targetPositionTiltPercent100ths", targetPositionTiltPercent100ths, 10000U)); + VerifyOrReturn(CheckConstraintType("targetPositionTiltPercent100ths", "", "Percent100ths")); + VerifyOrReturn(CheckConstraintMaxValue("targetPositionTiltPercent100ths", + targetPositionTiltPercent100ths, 10000U)); NextTest(); } @@ -88605,8 +30707,8 @@ class Test_TC_WNCV_2_1 : public TestCommand chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint16_t targetPositionTiltPercent100thsArgument; - targetPositionTiltPercent100thsArgument = 20000U; + chip::app::DataModel::Nullable targetPositionTiltPercent100thsArgument; + targetPositionTiltPercent100thsArgument.SetNonNull() = 20000U; ReturnErrorOnFailure( cluster.WriteAttribute( @@ -88636,9 +30738,9 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_21(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_21(uint16_t targetPositionTiltPercent100ths) + void OnSuccessResponse_21(const chip::app::DataModel::Nullable & targetPositionTiltPercent100ths) { - VerifyOrReturn(CheckConstraintType("targetPositionTiltPercent100ths", "", "uint16")); + VerifyOrReturn(CheckConstraintType("targetPositionTiltPercent100ths", "", "Percent100ths")); VerifyOrReturn(CheckConstraintNotValue("targetPositionTiltPercent100ths", targetPositionTiltPercent100ths, 20000U)); NextTest(); @@ -88658,11 +30760,11 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_22(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_22(uint16_t currentPositionLiftPercent100ths) + void OnSuccessResponse_22(const chip::app::DataModel::Nullable & currentPositionLiftPercent100ths) { - VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "uint16")); - VerifyOrReturn( - CheckConstraintMaxValue("currentPositionLiftPercent100ths", currentPositionLiftPercent100ths, 10000U)); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "Percent100ths")); + VerifyOrReturn(CheckConstraintMaxValue("currentPositionLiftPercent100ths", + currentPositionLiftPercent100ths, 10000U)); NextTest(); } @@ -88673,8 +30775,8 @@ class Test_TC_WNCV_2_1 : public TestCommand chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint16_t currentPositionLiftPercent100thsArgument; - currentPositionLiftPercent100thsArgument = 20000U; + chip::app::DataModel::Nullable currentPositionLiftPercent100thsArgument; + currentPositionLiftPercent100thsArgument.SetNonNull() = 20000U; ReturnErrorOnFailure( cluster.WriteAttribute( @@ -88704,9 +30806,9 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_24(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_24(uint16_t currentPositionLiftPercent100ths) + void OnSuccessResponse_24(const chip::app::DataModel::Nullable & currentPositionLiftPercent100ths) { - VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "uint16")); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "Percent100ths")); VerifyOrReturn(CheckConstraintNotValue("currentPositionLiftPercent100ths", currentPositionLiftPercent100ths, 20000U)); NextTest(); @@ -88726,11 +30828,11 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_25(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_25(uint16_t currentPositionTiltPercent100ths) + void OnSuccessResponse_25(const chip::app::DataModel::Nullable & currentPositionTiltPercent100ths) { - VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "uint16")); - VerifyOrReturn( - CheckConstraintMaxValue("currentPositionTiltPercent100ths", currentPositionTiltPercent100ths, 10000U)); + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "Percent100ths")); + VerifyOrReturn(CheckConstraintMaxValue("currentPositionTiltPercent100ths", + currentPositionTiltPercent100ths, 10000U)); NextTest(); } @@ -88741,8 +30843,8 @@ class Test_TC_WNCV_2_1 : public TestCommand chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint16_t currentPositionTiltPercent100thsArgument; - currentPositionTiltPercent100thsArgument = 20000U; + chip::app::DataModel::Nullable currentPositionTiltPercent100thsArgument; + currentPositionTiltPercent100thsArgument.SetNonNull() = 20000U; ReturnErrorOnFailure( cluster.WriteAttribute( @@ -88772,9 +30874,9 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_27(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_27(uint16_t currentPositionTiltPercent100ths) + void OnSuccessResponse_27(const chip::app::DataModel::Nullable & currentPositionTiltPercent100ths) { - VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "uint16")); + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "Percent100ths")); VerifyOrReturn(CheckConstraintNotValue("currentPositionTiltPercent100ths", currentPositionTiltPercent100ths, 20000U)); NextTest(); @@ -89125,7 +31227,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_43(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_43(uint16_t currentPositionLift) + void OnSuccessResponse_43(const chip::app::DataModel::Nullable & currentPositionLift) { VerifyOrReturn(CheckConstraintType("currentPositionLift", "", "uint16")); VerifyOrReturn(CheckConstraintMaxValue("currentPositionLift", currentPositionLift, 65535U)); @@ -89139,8 +31241,8 @@ class Test_TC_WNCV_2_1 : public TestCommand chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint16_t currentPositionLiftArgument; - currentPositionLiftArgument = 255U; + chip::app::DataModel::Nullable currentPositionLiftArgument; + currentPositionLiftArgument.SetNonNull() = 255U; ReturnErrorOnFailure(cluster.WriteAttribute( currentPositionLiftArgument, this, OnSuccessCallback_44, OnFailureCallback_44)); @@ -89168,7 +31270,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_45(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_45(uint16_t currentPositionLift) + void OnSuccessResponse_45(const chip::app::DataModel::Nullable & currentPositionLift) { VerifyOrReturn(CheckConstraintType("currentPositionLift", "", "uint16")); VerifyOrReturn(CheckConstraintMaxValue("currentPositionLift", currentPositionLift, 65535U)); @@ -89189,7 +31291,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_46(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_46(uint16_t currentPositionTilt) + void OnSuccessResponse_46(const chip::app::DataModel::Nullable & currentPositionTilt) { VerifyOrReturn(CheckConstraintType("currentPositionTilt", "", "uint16")); VerifyOrReturn(CheckConstraintMaxValue("currentPositionTilt", currentPositionTilt, 65535U)); @@ -89203,8 +31305,8 @@ class Test_TC_WNCV_2_1 : public TestCommand chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint16_t currentPositionTiltArgument; - currentPositionTiltArgument = 255U; + chip::app::DataModel::Nullable currentPositionTiltArgument; + currentPositionTiltArgument.SetNonNull() = 255U; ReturnErrorOnFailure(cluster.WriteAttribute( currentPositionTiltArgument, this, OnSuccessCallback_47, OnFailureCallback_47)); @@ -89232,7 +31334,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_48(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_48(uint16_t currentPositionTilt) + void OnSuccessResponse_48(const chip::app::DataModel::Nullable & currentPositionTilt) { VerifyOrReturn(CheckConstraintType("currentPositionTilt", "", "uint16")); VerifyOrReturn(CheckConstraintMaxValue("currentPositionTilt", currentPositionTilt, 65535U)); @@ -89254,10 +31356,10 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_49(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_49(uint8_t currentPositionLiftPercentage) + void OnSuccessResponse_49(const chip::app::DataModel::Nullable & currentPositionLiftPercentage) { - VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "uint8")); - VerifyOrReturn(CheckConstraintMaxValue("currentPositionLiftPercentage", currentPositionLiftPercentage, 100)); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "Percent")); + VerifyOrReturn(CheckConstraintMaxValue("currentPositionLiftPercentage", currentPositionLiftPercentage, 100)); NextTest(); } @@ -89268,8 +31370,8 @@ class Test_TC_WNCV_2_1 : public TestCommand chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t currentPositionLiftPercentageArgument; - currentPositionLiftPercentageArgument = 200; + chip::app::DataModel::Nullable currentPositionLiftPercentageArgument; + currentPositionLiftPercentageArgument.SetNonNull() = 200; ReturnErrorOnFailure( cluster.WriteAttribute( @@ -89299,9 +31401,9 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_51(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_51(uint8_t currentPositionLiftPercentage) + void OnSuccessResponse_51(const chip::app::DataModel::Nullable & currentPositionLiftPercentage) { - VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "uint8")); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "Percent")); VerifyOrReturn(CheckConstraintNotValue("currentPositionLiftPercentage", currentPositionLiftPercentage, 200)); NextTest(); @@ -89321,10 +31423,10 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_52(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_52(uint8_t currentPositionTiltPercentage) + void OnSuccessResponse_52(const chip::app::DataModel::Nullable & currentPositionTiltPercentage) { - VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "uint8")); - VerifyOrReturn(CheckConstraintMaxValue("currentPositionTiltPercentage", currentPositionTiltPercentage, 100)); + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "Percent")); + VerifyOrReturn(CheckConstraintMaxValue("currentPositionTiltPercentage", currentPositionTiltPercentage, 100)); NextTest(); } @@ -89335,8 +31437,8 @@ class Test_TC_WNCV_2_1 : public TestCommand chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t currentPositionTiltPercentageArgument; - currentPositionTiltPercentageArgument = 200; + chip::app::DataModel::Nullable currentPositionTiltPercentageArgument; + currentPositionTiltPercentageArgument.SetNonNull() = 200; ReturnErrorOnFailure( cluster.WriteAttribute( @@ -89366,9 +31468,9 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_54(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_54(uint8_t currentPositionTiltPercentage) + void OnSuccessResponse_54(const chip::app::DataModel::Nullable & currentPositionTiltPercentage) { - VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "uint8")); + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "Percent")); VerifyOrReturn(CheckConstraintNotValue("currentPositionTiltPercentage", currentPositionTiltPercentage, 200)); NextTest();