diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 2d71e362638858..962b8b5f65b57b 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -4387,32 +4387,6 @@ client cluster TestCluster = 4294048773 { command TestEmitTestEventRequest(TestEmitTestEventRequestRequest): TestEmitTestEventResponse = 20; } -client cluster FaultInjection = 4294048774 { - enum FaultType : ENUM8 { - kUnspecified = 0; - kSystemFault = 1; - kInetFault = 2; - kChipFault = 3; - kCertFault = 4; - } - - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct FailAtFaultRequest { - FaultType type = 0; - INT32U id = 1; - INT32U numCallsToSkip = 2; - INT32U numCallsToFail = 3; - BOOLEAN takeMutex = 4; - } - - command access(invoke: manage) FailAtFault(FailAtFaultRequest): DefaultSuccess = 0; -} - endpoint 1 { device type rootdevice = 22; binding cluster Identify; @@ -4480,7 +4454,6 @@ endpoint 1 { binding cluster AccountLogin; binding cluster ElectricalMeasurement; binding cluster TestCluster; - binding cluster FaultInjection; } diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 88b9b7cc085330..ca5ff6e5217ec9 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -19408,7 +19408,7 @@ "mfgCode": null, "define": "FAULT_INJECTION_CLUSTER", "side": "client", - "enabled": 1, + "enabled": 0, "commands": [ { "name": "FailAtFault", diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index d20ce4a2f36cf0..260e8cd358f8e4 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -19485,118 +19485,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::FaultInjection::Id: { - using namespace app::Clusters::FaultInjection; - switch (aPath.mAttributeId) - { - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); - return value; - } - default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - break; - } - break; - } default: *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; diff --git a/src/controller/java/zap-generated/CHIPCallbackTypes.h b/src/controller/java/zap-generated/CHIPCallbackTypes.h index cf42bf39d28966..be01149ef4bc17 100644 --- a/src/controller/java/zap-generated/CHIPCallbackTypes.h +++ b/src/controller/java/zap-generated/CHIPCallbackTypes.h @@ -1963,14 +1963,3 @@ typedef void (*CHIPTestClusterClusterFeatureMapAttributeCallbackType)( void *, chip::app::Clusters::TestCluster::Attributes::FeatureMap::TypeInfo::DecodableArgType); typedef void (*CHIPTestClusterClusterClusterRevisionAttributeCallbackType)( void *, chip::app::Clusters::TestCluster::Attributes::ClusterRevision::TypeInfo::DecodableArgType); - -typedef void (*CHIPFaultInjectionClusterGeneratedCommandListAttributeCallbackType)( - void *, const chip::app::Clusters::FaultInjection::Attributes::GeneratedCommandList::TypeInfo::DecodableType &); -typedef void (*CHIPFaultInjectionClusterAcceptedCommandListAttributeCallbackType)( - void *, const chip::app::Clusters::FaultInjection::Attributes::AcceptedCommandList::TypeInfo::DecodableType &); -typedef void (*CHIPFaultInjectionClusterAttributeListAttributeCallbackType)( - void *, const chip::app::Clusters::FaultInjection::Attributes::AttributeList::TypeInfo::DecodableType &); -typedef void (*CHIPFaultInjectionClusterFeatureMapAttributeCallbackType)( - void *, chip::app::Clusters::FaultInjection::Attributes::FeatureMap::TypeInfo::DecodableArgType); -typedef void (*CHIPFaultInjectionClusterClusterRevisionAttributeCallbackType)( - void *, chip::app::Clusters::FaultInjection::Attributes::ClusterRevision::TypeInfo::DecodableArgType); diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 411028f4237550..fcdb5b536f65a1 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -3495,16 +3495,6 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } - case app::Clusters::FaultInjection::Id: { - using namespace app::Clusters::FaultInjection; - switch (aPath.mEventId) - { - default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; - break; - } - break; - } default: *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index d6c410be3f605e..a9920f27d7b78a 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -29260,216 +29260,3 @@ void CHIPTestClusterAttributeListAttributeCallback::CallbackFn(void * context, env->ExceptionClear(); env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } - -CHIPFaultInjectionGeneratedCommandListAttributeCallback::CHIPFaultInjectionGeneratedCommandListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } -} - -CHIPFaultInjectionGeneratedCommandListAttributeCallback::~CHIPFaultInjectionGeneratedCommandListAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPFaultInjectionGeneratedCommandListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); - - // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. - javaCallbackRef = cppCallback.get()->javaCallbackRef; - VerifyOrReturn(javaCallbackRef != nullptr, - ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); - - jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - - jobject arrayListObj; - chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - - auto iter_arrayListObj_0 = list.begin(); - while (iter_arrayListObj_0.Next()) - { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), - newElement_0CtorSignature.c_str(), entry_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); - } - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} - -CHIPFaultInjectionAcceptedCommandListAttributeCallback::CHIPFaultInjectionAcceptedCommandListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } -} - -CHIPFaultInjectionAcceptedCommandListAttributeCallback::~CHIPFaultInjectionAcceptedCommandListAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPFaultInjectionAcceptedCommandListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); - - // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. - javaCallbackRef = cppCallback.get()->javaCallbackRef; - VerifyOrReturn(javaCallbackRef != nullptr, - ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); - - jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - - jobject arrayListObj; - chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - - auto iter_arrayListObj_0 = list.begin(); - while (iter_arrayListObj_0.Next()) - { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), - newElement_0CtorSignature.c_str(), entry_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); - } - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} - -CHIPFaultInjectionAttributeListAttributeCallback::CHIPFaultInjectionAttributeListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } -} - -CHIPFaultInjectionAttributeListAttributeCallback::~CHIPFaultInjectionAttributeListAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPFaultInjectionAttributeListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); - - // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. - javaCallbackRef = cppCallback.get()->javaCallbackRef; - VerifyOrReturn(javaCallbackRef != nullptr, - ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); - - jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - - jobject arrayListObj; - chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - - auto iter_arrayListObj_0 = list.begin(); - while (iter_arrayListObj_0.Next()) - { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), - newElement_0CtorSignature.c_str(), entry_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); - } - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.h b/src/controller/java/zap-generated/CHIPReadCallbacks.h index d1a4b63b04c84e..6f80ffb6323ef8 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -12075,93 +12075,3 @@ class CHIPTestClusterAttributeListAttributeCallback jobject javaCallbackRef; bool keepAlive; }; - -class CHIPFaultInjectionGeneratedCommandListAttributeCallback - : public chip::Callback::Callback -{ -public: - CHIPFaultInjectionGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false); - - ~CHIPFaultInjectionGeneratedCommandListAttributeCallback(); - - static void maybeDestroy(CHIPFaultInjectionGeneratedCommandListAttributeCallback * callback) - { - if (!callback->keepAlive) - { - callback->Cancel(); - chip::Platform::Delete(callback); - } - } - - static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); - static void OnSubscriptionEstablished(void * context) - { - CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( - reinterpret_cast(context)->javaCallbackRef); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); - }; - -private: - jobject javaCallbackRef; - bool keepAlive; -}; - -class CHIPFaultInjectionAcceptedCommandListAttributeCallback - : public chip::Callback::Callback -{ -public: - CHIPFaultInjectionAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false); - - ~CHIPFaultInjectionAcceptedCommandListAttributeCallback(); - - static void maybeDestroy(CHIPFaultInjectionAcceptedCommandListAttributeCallback * callback) - { - if (!callback->keepAlive) - { - callback->Cancel(); - chip::Platform::Delete(callback); - } - } - - static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); - static void OnSubscriptionEstablished(void * context) - { - CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( - reinterpret_cast(context)->javaCallbackRef); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); - }; - -private: - jobject javaCallbackRef; - bool keepAlive; -}; - -class CHIPFaultInjectionAttributeListAttributeCallback - : public chip::Callback::Callback -{ -public: - CHIPFaultInjectionAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false); - - ~CHIPFaultInjectionAttributeListAttributeCallback(); - - static void maybeDestroy(CHIPFaultInjectionAttributeListAttributeCallback * callback) - { - if (!callback->keepAlive) - { - callback->Cancel(); - chip::Platform::Delete(callback); - } - } - - static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); - static void OnSubscriptionEstablished(void * context) - { - CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( - reinterpret_cast(context)->javaCallbackRef); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); - }; - -private: - jobject javaCallbackRef; - bool keepAlive; -}; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index bd9914f596dbab..bf07546f55e933 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -25180,163 +25180,4 @@ private native void readClusterRevisionAttribute( private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } - - public static class FaultInjectionCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 4294048774L; - - public FaultInjectionCluster(long devicePtr, int endpointId) { - super(devicePtr, endpointId); - } - - @Override - public native long initWithDevice(long devicePtr, int endpointId); - - public void failAtFault( - DefaultClusterCallback callback, - Integer type, - Long id, - Long numCallsToSkip, - Long numCallsToFail, - Boolean takeMutex) { - failAtFault( - chipClusterPtr, callback, type, id, numCallsToSkip, numCallsToFail, takeMutex, null); - } - - public void failAtFault( - DefaultClusterCallback callback, - Integer type, - Long id, - Long numCallsToSkip, - Long numCallsToFail, - Boolean takeMutex, - int timedInvokeTimeoutMs) { - failAtFault( - chipClusterPtr, - callback, - type, - id, - numCallsToSkip, - numCallsToFail, - takeMutex, - timedInvokeTimeoutMs); - } - - private native void failAtFault( - long chipClusterPtr, - DefaultClusterCallback Callback, - Integer type, - Long id, - Long numCallsToSkip, - Long numCallsToFail, - Boolean takeMutex, - @Nullable Integer timedInvokeTimeoutMs); - - public interface GeneratedCommandListAttributeCallback { - void onSuccess(List valueList); - - void onError(Exception ex); - - default void onSubscriptionEstablished() {} - } - - public interface AcceptedCommandListAttributeCallback { - void onSuccess(List valueList); - - void onError(Exception ex); - - default void onSubscriptionEstablished() {} - } - - public interface AttributeListAttributeCallback { - void onSuccess(List valueList); - - void onError(Exception ex); - - default void onSubscriptionEstablished() {} - } - - public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { - readGeneratedCommandListAttribute(chipClusterPtr, callback); - } - - public void subscribeGeneratedCommandListAttribute( - GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { - subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { - readAcceptedCommandListAttribute(chipClusterPtr, callback); - } - - public void subscribeAcceptedCommandListAttribute( - AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { - subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { - readAttributeListAttribute(chipClusterPtr, callback); - } - - public void subscribeAttributeListAttribute( - AttributeListAttributeCallback callback, int minInterval, int maxInterval) { - subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readFeatureMapAttribute(LongAttributeCallback callback) { - readFeatureMapAttribute(chipClusterPtr, callback); - } - - public void subscribeFeatureMapAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { - subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { - readClusterRevisionAttribute(chipClusterPtr, callback); - } - - public void subscribeClusterRevisionAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - private native void readGeneratedCommandListAttribute( - long chipClusterPtr, GeneratedCommandListAttributeCallback callback); - - private native void subscribeGeneratedCommandListAttribute( - long chipClusterPtr, - GeneratedCommandListAttributeCallback callback, - int minInterval, - int maxInterval); - - private native void readAcceptedCommandListAttribute( - long chipClusterPtr, AcceptedCommandListAttributeCallback callback); - - private native void subscribeAcceptedCommandListAttribute( - long chipClusterPtr, - AcceptedCommandListAttributeCallback callback, - int minInterval, - int maxInterval); - - private native void readAttributeListAttribute( - long chipClusterPtr, AttributeListAttributeCallback callback); - - private native void subscribeAttributeListAttribute( - long chipClusterPtr, - AttributeListAttributeCallback callback, - int minInterval, - int maxInterval); - - private native void readFeatureMapAttribute( - long chipClusterPtr, LongAttributeCallback callback); - - private native void subscribeFeatureMapAttribute( - long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); - - private native void readClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); - - private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); - } } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java index c61f98c598aa61..fddd0ee7c03216 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java @@ -220,9 +220,6 @@ public static String clusterIdToName(long clusterId) { if (clusterId == 4294048773L) { return "TestCluster"; } - if (clusterId == 4294048774L) { - return "FaultInjection"; - } return ""; } @@ -3090,24 +3087,6 @@ public static String attributeIdToName(long clusterId, long attributeId) { } return ""; } - if (clusterId == 4294048774L) { - if (attributeId == 65528L) { - return "GeneratedCommandList"; - } - if (attributeId == 65529L) { - return "AcceptedCommandList"; - } - if (attributeId == 65531L) { - return "AttributeList"; - } - if (attributeId == 65532L) { - return "FeatureMap"; - } - if (attributeId == 65533L) { - return "ClusterRevision"; - } - return ""; - } return ""; } @@ -3482,9 +3461,6 @@ public static String eventIdToName(long clusterId, long eventId) { } return ""; } - if (clusterId == 4294048774L) { - return ""; - } return ""; } } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index 365bee708efccb..955ae30c67da52 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -7131,78 +7131,6 @@ public void onError(Exception ex) { } } - public static class DelegatedFaultInjectionClusterGeneratedCommandListAttributeCallback - implements ChipClusters.FaultInjectionCluster.GeneratedCommandListAttributeCallback, - DelegatedClusterCallback { - private ClusterCommandCallback callback; - - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(List valueList) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - - public static class DelegatedFaultInjectionClusterAcceptedCommandListAttributeCallback - implements ChipClusters.FaultInjectionCluster.AcceptedCommandListAttributeCallback, - DelegatedClusterCallback { - private ClusterCommandCallback callback; - - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(List valueList) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - - public static class DelegatedFaultInjectionClusterAttributeListAttributeCallback - implements ChipClusters.FaultInjectionCluster.AttributeListAttributeCallback, - DelegatedClusterCallback { - private ClusterCommandCallback callback; - - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(List valueList) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - public Map getClusterMap() { Map clusterMap = initializeClusterMap(); Map> commandMap = getCommandMap(); @@ -7542,11 +7470,6 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.TestClusterCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("testCluster", testClusterClusterInfo); - ClusterInfo faultInjectionClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.FaultInjectionCluster(ptr, endpointId), - new HashMap<>()); - clusterMap.put("faultInjection", faultInjectionClusterInfo); return clusterMap; } @@ -7639,7 +7562,6 @@ public void combineCommand( destination.get("accountLogin").combineCommands(source.get("accountLogin")); destination.get("electricalMeasurement").combineCommands(source.get("electricalMeasurement")); destination.get("testCluster").combineCommands(source.get("testCluster")); - destination.get("faultInjection").combineCommands(source.get("faultInjection")); } @SuppressWarnings("unchecked") @@ -12079,51 +12001,6 @@ public Map> getCommandMap() { testClusterClusterInteractionInfoMap.put( "testEmitTestEventRequest", testClustertestEmitTestEventRequestInteractionInfo); commandMap.put("testCluster", testClusterClusterInteractionInfoMap); - Map faultInjectionClusterInteractionInfoMap = new LinkedHashMap<>(); - Map faultInjectionfailAtFaultCommandParams = - new LinkedHashMap(); - CommandParameterInfo faultInjectionfailAtFaulttypeCommandParameterInfo = - new CommandParameterInfo("type", Integer.class, Integer.class); - faultInjectionfailAtFaultCommandParams.put( - "type", faultInjectionfailAtFaulttypeCommandParameterInfo); - - CommandParameterInfo faultInjectionfailAtFaultidCommandParameterInfo = - new CommandParameterInfo("id", Long.class, Long.class); - faultInjectionfailAtFaultCommandParams.put( - "id", faultInjectionfailAtFaultidCommandParameterInfo); - - CommandParameterInfo faultInjectionfailAtFaultnumCallsToSkipCommandParameterInfo = - new CommandParameterInfo("numCallsToSkip", Long.class, Long.class); - faultInjectionfailAtFaultCommandParams.put( - "numCallsToSkip", faultInjectionfailAtFaultnumCallsToSkipCommandParameterInfo); - - CommandParameterInfo faultInjectionfailAtFaultnumCallsToFailCommandParameterInfo = - new CommandParameterInfo("numCallsToFail", Long.class, Long.class); - faultInjectionfailAtFaultCommandParams.put( - "numCallsToFail", faultInjectionfailAtFaultnumCallsToFailCommandParameterInfo); - - CommandParameterInfo faultInjectionfailAtFaulttakeMutexCommandParameterInfo = - new CommandParameterInfo("takeMutex", Boolean.class, Boolean.class); - faultInjectionfailAtFaultCommandParams.put( - "takeMutex", faultInjectionfailAtFaulttakeMutexCommandParameterInfo); - - InteractionInfo faultInjectionfailAtFaultInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.FaultInjectionCluster) cluster) - .failAtFault( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("type"), - (Long) commandArguments.get("id"), - (Long) commandArguments.get("numCallsToSkip"), - (Long) commandArguments.get("numCallsToFail"), - (Boolean) commandArguments.get("takeMutex")); - }, - () -> new DelegatedDefaultClusterCallback(), - faultInjectionfailAtFaultCommandParams); - faultInjectionClusterInteractionInfoMap.put( - "failAtFault", faultInjectionfailAtFaultInteractionInfo); - commandMap.put("faultInjection", faultInjectionClusterInteractionInfoMap); return commandMap; } } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java index a059be7651a3a9..363098e815aa52 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java @@ -12424,81 +12424,6 @@ public Map> getReadAttributeMap() { readTestClusterInteractionInfo.put( "readClusterRevisionAttribute", readTestClusterClusterRevisionAttributeInteractionInfo); readAttributeMap.put("testCluster", readTestClusterInteractionInfo); - Map readFaultInjectionInteractionInfo = new LinkedHashMap<>(); - Map readFaultInjectionGeneratedCommandListCommandParams = - new LinkedHashMap(); - InteractionInfo readFaultInjectionGeneratedCommandListAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.FaultInjectionCluster) cluster) - .readGeneratedCommandListAttribute( - (ChipClusters.FaultInjectionCluster.GeneratedCommandListAttributeCallback) - callback); - }, - () -> - new ClusterInfoMapping - .DelegatedFaultInjectionClusterGeneratedCommandListAttributeCallback(), - readFaultInjectionGeneratedCommandListCommandParams); - readFaultInjectionInteractionInfo.put( - "readGeneratedCommandListAttribute", - readFaultInjectionGeneratedCommandListAttributeInteractionInfo); - Map readFaultInjectionAcceptedCommandListCommandParams = - new LinkedHashMap(); - InteractionInfo readFaultInjectionAcceptedCommandListAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.FaultInjectionCluster) cluster) - .readAcceptedCommandListAttribute( - (ChipClusters.FaultInjectionCluster.AcceptedCommandListAttributeCallback) - callback); - }, - () -> - new ClusterInfoMapping - .DelegatedFaultInjectionClusterAcceptedCommandListAttributeCallback(), - readFaultInjectionAcceptedCommandListCommandParams); - readFaultInjectionInteractionInfo.put( - "readAcceptedCommandListAttribute", - readFaultInjectionAcceptedCommandListAttributeInteractionInfo); - Map readFaultInjectionAttributeListCommandParams = - new LinkedHashMap(); - InteractionInfo readFaultInjectionAttributeListAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.FaultInjectionCluster) cluster) - .readAttributeListAttribute( - (ChipClusters.FaultInjectionCluster.AttributeListAttributeCallback) callback); - }, - () -> - new ClusterInfoMapping - .DelegatedFaultInjectionClusterAttributeListAttributeCallback(), - readFaultInjectionAttributeListCommandParams); - readFaultInjectionInteractionInfo.put( - "readAttributeListAttribute", readFaultInjectionAttributeListAttributeInteractionInfo); - Map readFaultInjectionFeatureMapCommandParams = - new LinkedHashMap(); - InteractionInfo readFaultInjectionFeatureMapAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.FaultInjectionCluster) cluster) - .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readFaultInjectionFeatureMapCommandParams); - readFaultInjectionInteractionInfo.put( - "readFeatureMapAttribute", readFaultInjectionFeatureMapAttributeInteractionInfo); - Map readFaultInjectionClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readFaultInjectionClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.FaultInjectionCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readFaultInjectionClusterRevisionCommandParams); - readFaultInjectionInteractionInfo.put( - "readClusterRevisionAttribute", readFaultInjectionClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("faultInjection", readFaultInjectionInteractionInfo); return readAttributeMap; } } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java index 7a2eb30d7bc107..95414b21f13d0e 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java @@ -2837,8 +2837,6 @@ public Map> getWriteAttributeMap() { "writeNullableRangeRestrictedInt16sAttribute", writeTestClusterNullableRangeRestrictedInt16sAttributeInteractionInfo); writeAttributeMap.put("testCluster", writeTestClusterInteractionInfo); - Map writeFaultInjectionInteractionInfo = new LinkedHashMap<>(); - writeAttributeMap.put("faultInjection", writeFaultInjectionInteractionInfo); return writeAttributeMap; } } diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 474e44c941c097..4513a38a25ae45 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -7502,55 +7502,6 @@ class ChipClusters: }, }, } - _FAULT_INJECTION_CLUSTER_INFO = { - "clusterName": "FaultInjection", - "clusterId": 0xFFF1FC06, - "commands": { - 0x00000000: { - "commandId": 0x00000000, - "commandName": "FailAtFault", - "args": { - "type": "int", - "id": "int", - "numCallsToSkip": "int", - "numCallsToFail": "int", - "takeMutex": "bool", - }, - }, - }, - "attributes": { - 0x0000FFF8: { - "attributeName": "GeneratedCommandList", - "attributeId": 0x0000FFF8, - "type": "int", - "reportable": True, - }, - 0x0000FFF9: { - "attributeName": "AcceptedCommandList", - "attributeId": 0x0000FFF9, - "type": "int", - "reportable": True, - }, - 0x0000FFFB: { - "attributeName": "AttributeList", - "attributeId": 0x0000FFFB, - "type": "int", - "reportable": True, - }, - 0x0000FFFC: { - "attributeName": "FeatureMap", - "attributeId": 0x0000FFFC, - "type": "int", - "reportable": True, - }, - 0x0000FFFD: { - "attributeName": "ClusterRevision", - "attributeId": 0x0000FFFD, - "type": "int", - "reportable": True, - }, - }, - } _CLUSTER_ID_DICT = { 0x00000003: _IDENTIFY_CLUSTER_INFO, @@ -7618,7 +7569,6 @@ class ChipClusters: 0x0000050E: _ACCOUNT_LOGIN_CLUSTER_INFO, 0x00000B04: _ELECTRICAL_MEASUREMENT_CLUSTER_INFO, 0xFFF1FC05: _TEST_CLUSTER_CLUSTER_INFO, - 0xFFF1FC06: _FAULT_INJECTION_CLUSTER_INFO, } _CLUSTER_NAME_DICT = { @@ -7687,7 +7637,6 @@ class ChipClusters: "AccountLogin": _ACCOUNT_LOGIN_CLUSTER_INFO, "ElectricalMeasurement": _ELECTRICAL_MEASUREMENT_CLUSTER_INFO, "TestCluster": _TEST_CLUSTER_CLUSTER_INFO, - "FaultInjection": _FAULT_INJECTION_CLUSTER_INFO, } def __init__(self, chipstack): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 4e215d6702d9b5..064c07e07e814b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -17557,115 +17557,6 @@ id MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader & } break; } - case Clusters::FaultInjection::Id: { - using namespace Clusters::FaultInjection; - switch (aPath.mAttributeId) { - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - break; - } - break; - } default: { *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 90980c2f1a0f2c..32504dbbf5613e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -21986,117 +21986,6 @@ NS_ASSUME_NONNULL_BEGIN @end -/** - * Cluster Fault Injection - * - */ -@interface MTRBaseClusterFaultInjection : MTRCluster - -- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device - endpoint:(uint16_t)endpoint - queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; - -- (void)failAtFaultWithParams:(MTRFaultInjectionClusterFailAtFaultParams *)params - completionHandler:(StatusCompletion)completionHandler; -- (void)failRandomlyAtFaultWithParams:(MTRFaultInjectionClusterFailRandomlyAtFaultParams *)params - completionHandler:(StatusCompletion)completionHandler; - -- (void)readAttributeGeneratedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, - NSError * _Nullable error))completionHandler; -/** - * This API does not support setting autoResubscribe to NO in the - * MTRSubscribeParams. - */ -- (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnull)minInterval - maxInterval:(NSNumber * _Nonnull)maxInterval - params:(MTRSubscribeParams * _Nullable)params - subscriptionEstablished: - (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; -+ (void)readAttributeGeneratedCommandListWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completionHandler: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; - -- (void)readAttributeAcceptedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, - NSError * _Nullable error))completionHandler; -/** - * This API does not support setting autoResubscribe to NO in the - * MTRSubscribeParams. - */ -- (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnull)minInterval - maxInterval:(NSNumber * _Nonnull)maxInterval - params:(MTRSubscribeParams * _Nullable)params - subscriptionEstablished: - (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; -+ (void)readAttributeAcceptedCommandListWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completionHandler: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; - -- (void)readAttributeAttributeListWithCompletionHandler:(void (^)( - NSArray * _Nullable value, NSError * _Nullable error))completionHandler; -/** - * This API does not support setting autoResubscribe to NO in the - * MTRSubscribeParams. - */ -- (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minInterval - maxInterval:(NSNumber * _Nonnull)maxInterval - params:(MTRSubscribeParams * _Nullable)params - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; -+ (void)readAttributeAttributeListWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completionHandler: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; - -- (void)readAttributeFeatureMapWithCompletionHandler:(void (^)( - NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; -/** - * This API does not support setting autoResubscribe to NO in the - * MTRSubscribeParams. - */ -- (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInterval - maxInterval:(NSNumber * _Nonnull)maxInterval - params:(MTRSubscribeParams * _Nullable)params - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; -+ (void)readAttributeFeatureMapWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completionHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; - -- (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completionHandler; -/** - * This API does not support setting autoResubscribe to NO in the - * MTRSubscribeParams. - */ -- (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)minInterval - maxInterval:(NSNumber * _Nonnull)maxInterval - params:(MTRSubscribeParams * _Nullable)params - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; -+ (void)readAttributeClusterRevisionWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completionHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; - -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)new NS_UNAVAILABLE; - -@end - typedef NS_ENUM(uint8_t, MTRIdentifyEffectIdentifier) { MTRIdentifyEffectIdentifierBlink = 0x00, MTRIdentifyEffectIdentifierBreathe = 0x01, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 7bc25323f1a8d8..703b006f8a8353 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -93573,435 +93573,4 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRBaseClusterFaultInjection - -- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue -{ - if (self = [super initWithQueue:queue]) { - if (device == nil) { - return nil; - } - - _device = device; - _endpoint = endpoint; - } - return self; -} - -- (void)failAtFaultWithParams:(MTRFaultInjectionClusterFailAtFaultParams *)params - completionHandler:(StatusCompletion)completionHandler -{ - // Make a copy of params before we go async. - params = [params copy]; - new MTRCommandSuccessCallbackBridge( - self.callbackQueue, self.device, - ^(id _Nullable value, NSError * _Nullable error) { - completionHandler(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { - chip::Optional timedInvokeTimeoutMs; - ListFreer listFreer; - FaultInjection::Commands::FailAtFault::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - } - request.type = static_cast>(params.type.unsignedCharValue); - request.id = params.id.unsignedIntValue; - request.numCallsToSkip = params.numCallsToSkip.unsignedIntValue; - request.numCallsToFail = params.numCallsToFail.unsignedIntValue; - request.takeMutex = params.takeMutex.boolValue; - - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - chip::Controller::FaultInjectionCluster cppCluster(exchangeManager, session, self->_endpoint); - return cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); - }); -} - -- (void)failRandomlyAtFaultWithParams:(MTRFaultInjectionClusterFailRandomlyAtFaultParams *)params - completionHandler:(StatusCompletion)completionHandler -{ - // Make a copy of params before we go async. - params = [params copy]; - new MTRCommandSuccessCallbackBridge( - self.callbackQueue, self.device, - ^(id _Nullable value, NSError * _Nullable error) { - completionHandler(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { - chip::Optional timedInvokeTimeoutMs; - ListFreer listFreer; - FaultInjection::Commands::FailRandomlyAtFault::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - } - request.type = static_cast>(params.type.unsignedCharValue); - request.id = params.id.unsignedIntValue; - request.percentage = params.percentage.unsignedCharValue; - - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - chip::Controller::FaultInjectionCluster cppCluster(exchangeManager, session, self->_endpoint); - return cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); - }); -} - -- (void)readAttributeGeneratedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, - NSError * _Nullable error))completionHandler -{ - new MTRFaultInjectionGeneratedCommandListListAttributeCallbackBridge(self.callbackQueue, self.device, completionHandler, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { - using TypeInfo = FaultInjection::Attributes::GeneratedCommandList::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - chip::Controller::FaultInjectionCluster cppCluster(exchangeManager, session, self->_endpoint); - return cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnull)minInterval - maxInterval:(NSNumber * _Nonnull)maxInterval - params:(MTRSubscribeParams * _Nullable)params - subscriptionEstablished: - (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - // Make a copy of params before we go async. - minInterval = [minInterval copy]; - maxInterval = [maxInterval copy]; - params = [params copy]; - new MTRFaultInjectionGeneratedCommandListListAttributeCallbackSubscriptionBridge( - self.callbackQueue, self.device, reportHandler, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { - if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { - // We don't support disabling auto-resubscribe. - return CHIP_ERROR_INVALID_ARGUMENT; - } - using TypeInfo = FaultInjection::Attributes::GeneratedCommandList::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - - chip::Controller::FaultInjectionCluster cppCluster(exchangeManager, session, self->_endpoint); - return cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, - [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - MTRFaultInjectionGeneratedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, - params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], - params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); - }, - subscriptionEstablishedHandler); -} - -+ (void)readAttributeGeneratedCommandListWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completionHandler: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler -{ - new MTRFaultInjectionGeneratedCommandListListAttributeCallbackBridge( - queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - if (attributeCacheContainer.cppAttributeCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FaultInjection::Attributes::GeneratedCommandList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); - auto successFn = Callback::FromCancelable(success); - if (err == CHIP_NO_ERROR) { - successFn->mCall(successFn->mContext, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -- (void)readAttributeAcceptedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, - NSError * _Nullable error))completionHandler -{ - new MTRFaultInjectionAcceptedCommandListListAttributeCallbackBridge(self.callbackQueue, self.device, completionHandler, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { - using TypeInfo = FaultInjection::Attributes::AcceptedCommandList::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - chip::Controller::FaultInjectionCluster cppCluster(exchangeManager, session, self->_endpoint); - return cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnull)minInterval - maxInterval:(NSNumber * _Nonnull)maxInterval - params:(MTRSubscribeParams * _Nullable)params - subscriptionEstablished: - (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - // Make a copy of params before we go async. - minInterval = [minInterval copy]; - maxInterval = [maxInterval copy]; - params = [params copy]; - new MTRFaultInjectionAcceptedCommandListListAttributeCallbackSubscriptionBridge( - self.callbackQueue, self.device, reportHandler, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { - if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { - // We don't support disabling auto-resubscribe. - return CHIP_ERROR_INVALID_ARGUMENT; - } - using TypeInfo = FaultInjection::Attributes::AcceptedCommandList::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - - chip::Controller::FaultInjectionCluster cppCluster(exchangeManager, session, self->_endpoint); - return cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, - [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - MTRFaultInjectionAcceptedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, - params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], - params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); - }, - subscriptionEstablishedHandler); -} - -+ (void)readAttributeAcceptedCommandListWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completionHandler: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler -{ - new MTRFaultInjectionAcceptedCommandListListAttributeCallbackBridge( - queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - if (attributeCacheContainer.cppAttributeCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FaultInjection::Attributes::AcceptedCommandList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); - auto successFn = Callback::FromCancelable(success); - if (err == CHIP_NO_ERROR) { - successFn->mCall(successFn->mContext, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -- (void)readAttributeAttributeListWithCompletionHandler:(void (^)( - NSArray * _Nullable value, NSError * _Nullable error))completionHandler -{ - new MTRFaultInjectionAttributeListListAttributeCallbackBridge(self.callbackQueue, self.device, completionHandler, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { - using TypeInfo = FaultInjection::Attributes::AttributeList::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - chip::Controller::FaultInjectionCluster cppCluster(exchangeManager, session, self->_endpoint); - return cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minInterval - maxInterval:(NSNumber * _Nonnull)maxInterval - params:(MTRSubscribeParams * _Nullable)params - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - // Make a copy of params before we go async. - minInterval = [minInterval copy]; - maxInterval = [maxInterval copy]; - params = [params copy]; - new MTRFaultInjectionAttributeListListAttributeCallbackSubscriptionBridge( - self.callbackQueue, self.device, reportHandler, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { - if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { - // We don't support disabling auto-resubscribe. - return CHIP_ERROR_INVALID_ARGUMENT; - } - using TypeInfo = FaultInjection::Attributes::AttributeList::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - - chip::Controller::FaultInjectionCluster cppCluster(exchangeManager, session, self->_endpoint); - return cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, - [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - MTRFaultInjectionAttributeListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, - params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], - params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); - }, - subscriptionEstablishedHandler); -} - -+ (void)readAttributeAttributeListWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completionHandler: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler -{ - new MTRFaultInjectionAttributeListListAttributeCallbackBridge( - queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - if (attributeCacheContainer.cppAttributeCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FaultInjection::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); - auto successFn = Callback::FromCancelable(success); - if (err == CHIP_NO_ERROR) { - successFn->mCall(successFn->mContext, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -- (void)readAttributeFeatureMapWithCompletionHandler:(void (^)( - NSNumber * _Nullable value, NSError * _Nullable error))completionHandler -{ - new MTRInt32uAttributeCallbackBridge(self.callbackQueue, self.device, completionHandler, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { - using TypeInfo = FaultInjection::Attributes::FeatureMap::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - chip::Controller::FaultInjectionCluster cppCluster(exchangeManager, session, self->_endpoint); - return cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInterval - maxInterval:(NSNumber * _Nonnull)maxInterval - params:(MTRSubscribeParams * _Nullable)params - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - // Make a copy of params before we go async. - minInterval = [minInterval copy]; - maxInterval = [maxInterval copy]; - params = [params copy]; - new MTRInt32uAttributeCallbackSubscriptionBridge( - self.callbackQueue, self.device, reportHandler, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { - if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { - // We don't support disabling auto-resubscribe. - return CHIP_ERROR_INVALID_ARGUMENT; - } - using TypeInfo = FaultInjection::Attributes::FeatureMap::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - - chip::Controller::FaultInjectionCluster cppCluster(exchangeManager, session, self->_endpoint); - return cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, - [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - MTRInt32uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, - params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], - params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); - }, - subscriptionEstablishedHandler); -} - -+ (void)readAttributeFeatureMapWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler -{ - new MTRInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - if (attributeCacheContainer.cppAttributeCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FaultInjection::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); - auto successFn = Callback::FromCancelable(success); - if (err == CHIP_NO_ERROR) { - successFn->mCall(successFn->mContext, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -- (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completionHandler -{ - new MTRInt16uAttributeCallbackBridge(self.callbackQueue, self.device, completionHandler, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { - using TypeInfo = FaultInjection::Attributes::ClusterRevision::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - chip::Controller::FaultInjectionCluster cppCluster(exchangeManager, session, self->_endpoint); - return cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)minInterval - maxInterval:(NSNumber * _Nonnull)maxInterval - params:(MTRSubscribeParams * _Nullable)params - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - // Make a copy of params before we go async. - minInterval = [minInterval copy]; - maxInterval = [maxInterval copy]; - params = [params copy]; - new MTRInt16uAttributeCallbackSubscriptionBridge( - self.callbackQueue, self.device, reportHandler, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { - if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { - // We don't support disabling auto-resubscribe. - return CHIP_ERROR_INVALID_ARGUMENT; - } - using TypeInfo = FaultInjection::Attributes::ClusterRevision::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - - chip::Controller::FaultInjectionCluster cppCluster(exchangeManager, session, self->_endpoint); - return cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, - [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - MTRInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, - params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], - params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); - }, - subscriptionEstablishedHandler); -} - -+ (void)readAttributeClusterRevisionWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completionHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler -{ - new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - if (attributeCacheContainer.cppAttributeCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FaultInjection::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); - auto successFn = Callback::FromCancelable(success); - if (err == CHIP_NO_ERROR) { - successFn->mCall(successFn->mContext, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -@end - // NOLINTEND(clang-analyzer-cplusplus.NewDeleteLeaks) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_internal.h index 9c3afd19a23a4d..359f771f5b8910 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_internal.h @@ -348,8 +348,3 @@ @property (nonatomic, strong, readonly) MTRBaseDevice * device; @property (nonatomic, assign, readonly) chip::EndpointId endpoint; @end - -@interface MTRBaseClusterFaultInjection () -@property (nonatomic, strong, readonly) MTRBaseDevice * device; -@property (nonatomic, assign, readonly) chip::EndpointId endpoint; -@end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm index 70a58543255418..c80b80aa92c3de 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm @@ -11563,123 +11563,6 @@ } } -void MTRFaultInjectionGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::DecodableList & value) -{ - NSArray * _Nonnull objCValue; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = value.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - objCValue = array_0; - } - DispatchSuccess(context, objCValue); -}; - -void MTRFaultInjectionGeneratedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) -{ - auto * self = static_cast(context); - if (!self->mQueue) { - return; - } - - if (self->mEstablishedHandler != nil) { - dispatch_async(self->mQueue, self->mEstablishedHandler); - // On failure, mEstablishedHandler will be cleaned up by our destructor, - // but we can clean it up earlier on successful subscription - // establishment. - self->mEstablishedHandler = nil; - } -} - -void MTRFaultInjectionAcceptedCommandListListAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::DecodableList & value) -{ - NSArray * _Nonnull objCValue; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = value.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - objCValue = array_0; - } - DispatchSuccess(context, objCValue); -}; - -void MTRFaultInjectionAcceptedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) -{ - auto * self = static_cast(context); - if (!self->mQueue) { - return; - } - - if (self->mEstablishedHandler != nil) { - dispatch_async(self->mQueue, self->mEstablishedHandler); - // On failure, mEstablishedHandler will be cleaned up by our destructor, - // but we can clean it up earlier on successful subscription - // establishment. - self->mEstablishedHandler = nil; - } -} - -void MTRFaultInjectionAttributeListListAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::DecodableList & value) -{ - NSArray * _Nonnull objCValue; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = value.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - objCValue = array_0; - } - DispatchSuccess(context, objCValue); -}; - -void MTRFaultInjectionAttributeListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) -{ - auto * self = static_cast(context); - if (!self->mQueue) { - return; - } - - if (self->mEstablishedHandler != nil) { - dispatch_async(self->mQueue, self->mEstablishedHandler); - // On failure, mEstablishedHandler will be cleaned up by our destructor, - // but we can clean it up earlier on successful subscription - // establishment. - self->mEstablishedHandler = nil; - } -} - void MTRGroupsClusterAddGroupResponseCallbackBridge::OnSuccessFn( void * context, const chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType & data) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge_internal.h index c4f9a9ea72702e..cb995089ced939 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge_internal.h @@ -1112,12 +1112,6 @@ typedef void (*TestClusterAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*TestClusterAttributeListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*FaultInjectionGeneratedCommandListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*FaultInjectionAcceptedCommandListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*FaultInjectionAttributeListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); class MTRDefaultSuccessCallbackBridge : public MTRCallbackBridge { @@ -15151,150 +15145,6 @@ class MTRTestClusterAttributeListListAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRFaultInjectionGeneratedCommandListListAttributeCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRFaultInjectionGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRLocalActionBlock action, bool keepAlive = false) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; - - MTRFaultInjectionGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, chip::NodeId nodeID, - MTRDeviceController * controller, ResponseHandler handler, - MTRActionBlock action, bool keepAlive = false) : - MTRCallbackBridge(queue, nodeID, controller, handler, action, - OnSuccessFn, keepAlive){}; - - MTRFaultInjectionGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, MTRBaseDevice * device, - ResponseHandler handler, MTRActionBlock action, - bool keepAlive = false) : - MTRCallbackBridge(queue, device, handler, action, OnSuccessFn, - keepAlive){}; - - static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); -}; - -class MTRFaultInjectionGeneratedCommandListListAttributeCallbackSubscriptionBridge - : public MTRFaultInjectionGeneratedCommandListListAttributeCallbackBridge -{ -public: - MTRFaultInjectionGeneratedCommandListListAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, chip::NodeId nodeID, MTRDeviceController * controller, ResponseHandler handler, - MTRActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - MTRFaultInjectionGeneratedCommandListListAttributeCallbackBridge(queue, nodeID, controller, handler, action, true), - mEstablishedHandler(establishedHandler) - {} - - MTRFaultInjectionGeneratedCommandListListAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, MTRBaseDevice * device, ResponseHandler handler, MTRActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - MTRFaultInjectionGeneratedCommandListListAttributeCallbackBridge(queue, device, handler, action, true), - mEstablishedHandler(establishedHandler) - {} - - static void OnSubscriptionEstablished(void * context); - -private: - SubscriptionEstablishedHandler mEstablishedHandler; -}; - -class MTRFaultInjectionAcceptedCommandListListAttributeCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRFaultInjectionAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRLocalActionBlock action, bool keepAlive = false) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - - MTRFaultInjectionAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, chip::NodeId nodeID, - MTRDeviceController * controller, ResponseHandler handler, - MTRActionBlock action, bool keepAlive = false) : - MTRCallbackBridge(queue, nodeID, controller, handler, action, - OnSuccessFn, keepAlive){}; - - MTRFaultInjectionAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, MTRBaseDevice * device, - ResponseHandler handler, MTRActionBlock action, - bool keepAlive = false) : - MTRCallbackBridge(queue, device, handler, action, OnSuccessFn, - keepAlive){}; - - static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); -}; - -class MTRFaultInjectionAcceptedCommandListListAttributeCallbackSubscriptionBridge - : public MTRFaultInjectionAcceptedCommandListListAttributeCallbackBridge -{ -public: - MTRFaultInjectionAcceptedCommandListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, chip::NodeId nodeID, - MTRDeviceController * controller, - ResponseHandler handler, MTRActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - MTRFaultInjectionAcceptedCommandListListAttributeCallbackBridge(queue, nodeID, controller, handler, action, true), - mEstablishedHandler(establishedHandler) - {} - - MTRFaultInjectionAcceptedCommandListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, MTRBaseDevice * device, - ResponseHandler handler, MTRActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - MTRFaultInjectionAcceptedCommandListListAttributeCallbackBridge(queue, device, handler, action, true), - mEstablishedHandler(establishedHandler) - {} - - static void OnSubscriptionEstablished(void * context); - -private: - SubscriptionEstablishedHandler mEstablishedHandler; -}; - -class MTRFaultInjectionAttributeListListAttributeCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRFaultInjectionAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRLocalActionBlock action, bool keepAlive = false) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - - MTRFaultInjectionAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, chip::NodeId nodeID, - MTRDeviceController * controller, ResponseHandler handler, - MTRActionBlock action, bool keepAlive = false) : - MTRCallbackBridge(queue, nodeID, controller, handler, action, OnSuccessFn, - keepAlive){}; - - MTRFaultInjectionAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, MTRBaseDevice * device, - ResponseHandler handler, MTRActionBlock action, - bool keepAlive = false) : - MTRCallbackBridge(queue, device, handler, action, OnSuccessFn, - keepAlive){}; - - static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); -}; - -class MTRFaultInjectionAttributeListListAttributeCallbackSubscriptionBridge - : public MTRFaultInjectionAttributeListListAttributeCallbackBridge -{ -public: - MTRFaultInjectionAttributeListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, chip::NodeId nodeID, - MTRDeviceController * controller, ResponseHandler handler, - MTRActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - MTRFaultInjectionAttributeListListAttributeCallbackBridge(queue, nodeID, controller, handler, action, true), - mEstablishedHandler(establishedHandler) - {} - - MTRFaultInjectionAttributeListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, MTRBaseDevice * device, - ResponseHandler handler, MTRActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - MTRFaultInjectionAttributeListListAttributeCallbackBridge(queue, device, handler, action, true), - mEstablishedHandler(establishedHandler) - {} - - static void OnSubscriptionEstablished(void * context); - -private: - SubscriptionEstablishedHandler mEstablishedHandler; -}; - class MTRGroupsClusterAddGroupResponseCallbackBridge : public MTRCallbackBridge { public: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index bd815031aa0bc2..ef8bc064a5524f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -5283,38 +5283,4 @@ NS_ASSUME_NONNULL_BEGIN @end -/** - * Cluster Fault Injection - * - */ -@interface MTRClusterFaultInjection : MTRCluster - -- (nullable instancetype)initWithDevice:(MTRDevice *)device - endpoint:(uint16_t)endpoint - queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; - -- (void)failAtFaultWithParams:(MTRFaultInjectionClusterFailAtFaultParams *)params - expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries - expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs - completionHandler:(StatusCompletion)completionHandler; -- (void)failRandomlyAtFaultWithParams:(MTRFaultInjectionClusterFailRandomlyAtFaultParams *)params - expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries - expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs - completionHandler:(StatusCompletion)completionHandler; - -- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params; - -- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params; - -- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params; - -- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params; - -- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params; - -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)new NS_UNAVAILABLE; - -@end - NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 32d77c731b7dc3..9172a6d3b320c2 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -22036,133 +22036,4 @@ - (void)writeAttributeNullableRangeRestrictedInt16sWithValue:(NSDictionary *> *)expectedValues - expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completionHandler:(StatusCompletion)completionHandler -{ - // Make a copy of params before we go async. - params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - new MTRCommandSuccessCallbackBridge( - self.callbackQueue, baseDevice, - ^(id _Nullable value, NSError * _Nullable error) { - completionHandler(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { - chip::Optional timedInvokeTimeoutMs; - ListFreer listFreer; - FaultInjection::Commands::FailAtFault::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - } - request.type = static_cast>(params.type.unsignedCharValue); - request.id = params.id.unsignedIntValue; - request.numCallsToSkip = params.numCallsToSkip.unsignedIntValue; - request.numCallsToFail = params.numCallsToFail.unsignedIntValue; - request.takeMutex = params.takeMutex.boolValue; - - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - chip::Controller::FaultInjectionCluster cppCluster(exchangeManager, session, self->_endpoint); - return cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); - }); - - [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; -} - -- (void)failRandomlyAtFaultWithParams:(MTRFaultInjectionClusterFailRandomlyAtFaultParams *)params - expectedValues:(NSArray *> *)expectedValues - expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completionHandler:(StatusCompletion)completionHandler -{ - // Make a copy of params before we go async. - params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - new MTRCommandSuccessCallbackBridge( - self.callbackQueue, baseDevice, - ^(id _Nullable value, NSError * _Nullable error) { - completionHandler(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { - chip::Optional timedInvokeTimeoutMs; - ListFreer listFreer; - FaultInjection::Commands::FailRandomlyAtFault::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - } - request.type = static_cast>(params.type.unsignedCharValue); - request.id = params.id.unsignedIntValue; - request.percentage = params.percentage.unsignedCharValue; - - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - chip::Controller::FaultInjectionCluster cppCluster(exchangeManager, session, self->_endpoint); - return cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); - }); - - [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; -} - -- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterFaultInjectionID) - attributeID:@(MTRClusterFaultInjectionAttributeGeneratedCommandListID) - params:params]; -} - -- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterFaultInjectionID) - attributeID:@(MTRClusterFaultInjectionAttributeAcceptedCommandListID) - params:params]; -} - -- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterFaultInjectionID) - attributeID:@(MTRClusterFaultInjectionAttributeAttributeListID) - params:params]; -} - -- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterFaultInjectionID) - attributeID:@(MTRClusterFaultInjectionAttributeFeatureMapID) - params:params]; -} - -- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterFaultInjectionID) - attributeID:@(MTRClusterFaultInjectionAttributeClusterRevisionID) - params:params]; -} - -@end - // NOLINTEND(clang-analyzer-cplusplus.NewDeleteLeaks) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_internal.h index 7db0939f5c1565..3bc39dea076933 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_internal.h @@ -349,8 +349,3 @@ @property (nonatomic, readonly) uint16_t endpoint; @property (nonatomic, readonly) MTRDevice * device; @end - -@interface MTRClusterFaultInjection () -@property (nonatomic, readonly) uint16_t endpoint; -@property (nonatomic, readonly) MTRDevice * device; -@end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 92ccbc1751f4d9..6ee6ada8dabb0f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -2246,16 +2246,6 @@ id MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRead } break; } - case Clusters::FaultInjection::Id: { - using namespace Clusters::FaultInjection; - switch (aPath.mEventId) { - - default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; - break; - } - break; - } default: { *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index d0e87f6efe4086..f50a45e43715b0 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -10002,37 +10002,6 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case FaultInjection::Id: { - switch (path.mAttributeId) - { - case FaultInjection::Attributes::GeneratedCommandList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); - } - case FaultInjection::Attributes::AcceptedCommandList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); - } - case FaultInjection::Attributes::AttributeList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); - } - case FaultInjection::Attributes::FeatureMap::Id: { - uint32_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("FeatureMap", 1, value); - } - case FaultInjection::Attributes::ClusterRevision::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ClusterRevision", 1, value); - } - } - break; - } default: break; } diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h index 5850925843b055..63a1b997dd5b6c 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h @@ -519,9 +519,3 @@ typedef void (*TestClusterAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*TestClusterAttributeListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*FaultInjectionGeneratedCommandListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*FaultInjectionAcceptedCommandListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*FaultInjectionAttributeListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h index 6762d44ce16409..96283a05033cd6 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h @@ -631,14 +631,5 @@ class DLL_EXPORT TestClusterCluster : public ClusterBase ~TestClusterCluster() {} }; -class DLL_EXPORT FaultInjectionCluster : public ClusterBase -{ -public: - FaultInjectionCluster(Messaging::ExchangeManager & exchangeManager, const SessionHandle & session, EndpointId endpoint) : - ClusterBase(exchangeManager, session, app::Clusters::FaultInjection::Id, endpoint) - {} - ~FaultInjectionCluster() {} -}; - } // namespace Controller } // namespace chip diff --git a/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h b/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h index f11dc67564f01d..0b55a4004fc6ec 100644 --- a/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h @@ -86,5 +86,4 @@ MatterApplicationBasicPluginClientInitCallback(); \ MatterAccountLoginPluginClientInitCallback(); \ MatterElectricalMeasurementPluginClientInitCallback(); \ - MatterTestClusterPluginClientInitCallback(); \ - MatterFaultInjectionPluginClientInitCallback(); + MatterTestClusterPluginClientInitCallback(); diff --git a/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp b/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp index 5522f84665c1e7..8258822775bbef 100644 --- a/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp +++ b/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp @@ -98,9 +98,6 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_FAN_CONTROL_CLUSTER_ID: emberAfFanControlClusterInitCallback(endpoint); break; - case ZCL_FAULT_INJECTION_CLUSTER_ID: - emberAfFaultInjectionClusterInitCallback(endpoint); - break; case ZCL_FIXED_LABEL_CLUSTER_ID: emberAfFixedLabelClusterInitCallback(endpoint); break; @@ -348,11 +345,6 @@ void __attribute__((weak)) emberAfFanControlClusterInitCallback(EndpointId endpo // To prevent warning (void) endpoint; } -void __attribute__((weak)) emberAfFaultInjectionClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; -} void __attribute__((weak)) emberAfFixedLabelClusterInitCallback(EndpointId endpoint) { // To prevent warning diff --git a/zzz_generated/controller-clusters/zap-generated/endpoint_config.h b/zzz_generated/controller-clusters/zap-generated/endpoint_config.h index 730a7fb6a32cf6..02e8566c7cd596 100644 --- a/zzz_generated/controller-clusters/zap-generated/endpoint_config.h +++ b/zzz_generated/controller-clusters/zap-generated/endpoint_config.h @@ -79,7 +79,7 @@ #define GENERATED_FUNCTION_ARRAYS #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 66 +#define GENERATED_CLUSTER_COUNT 65 // clang-format off #define GENERATED_CLUSTERS { \ @@ -798,17 +798,6 @@ .acceptedCommandList = nullptr ,\ .generatedCommandList = nullptr ,\ },\ - { \ - /* Endpoint: 1, Cluster: Fault Injection (client) */ \ - .clusterId = 0xFFF1FC06, \ - .attributes = ZAP_ATTRIBUTE_INDEX(0), \ - .attributeCount = 0, \ - .clusterSize = 0, \ - .mask = ZAP_CLUSTER_MASK(CLIENT), \ - .functions = NULL, \ - .acceptedCommandList = nullptr ,\ - .generatedCommandList = nullptr ,\ - },\ } // clang-format on @@ -820,7 +809,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 66, 0 }, \ + { ZAP_CLUSTER_INDEX(0), 65, 0 }, \ } // Largest attribute size is needed for various buffers diff --git a/zzz_generated/controller-clusters/zap-generated/gen_config.h b/zzz_generated/controller-clusters/zap-generated/gen_config.h index ce1b5279cc45b9..0653ff31923019 100644 --- a/zzz_generated/controller-clusters/zap-generated/gen_config.h +++ b/zzz_generated/controller-clusters/zap-generated/gen_config.h @@ -94,7 +94,6 @@ #define EMBER_AF_ACCOUNT_LOGIN_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_ELECTRICAL_MEASUREMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_TEST_CLUSTER_CLIENT_ENDPOINT_COUNT (1) -#define EMBER_AF_FAULT_INJECTION_CLUSTER_CLIENT_ENDPOINT_COUNT (1) /**** Cluster Plugins ****/ @@ -357,7 +356,3 @@ // Use this macro to check if the client side of the Test Cluster cluster is included #define ZCL_USING_TEST_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_TEST_CLUSTER_CLIENT - -// Use this macro to check if the client side of the Fault Injection cluster is included -#define ZCL_USING_FAULT_INJECTION_CLUSTER_CLIENT -#define EMBER_AF_PLUGIN_FAULT_INJECTION_CLIENT diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index ec3f6fbaf1e027..ded9c6fb369a17 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -93049,457 +93049,6 @@ class SubscribeAttributeTestClusterClusterRevision : public SubscribeAttribute { } }; -/*----------------------------------------------------------------------------*\ -| Cluster FaultInjection | 0xFFF1FC06| -|------------------------------------------------------------------------------| -| Commands: | | -| * FailAtFault | 0x00 | -| * FailRandomlyAtFault | 0x01 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command FailAtFault - */ -class FaultInjectionFailAtFault : public ClusterCommand { -public: - FaultInjectionFailAtFault() - : ClusterCommand("fail-at-fault") - { - AddArgument("Type", 0, UINT8_MAX, &mRequest.type); - AddArgument("Id", 0, UINT32_MAX, &mRequest.id); - AddArgument("NumCallsToSkip", 0, UINT32_MAX, &mRequest.numCallsToSkip); - AddArgument("NumCallsToFail", 0, UINT32_MAX, &mRequest.numCallsToFail); - AddArgument("TakeMutex", 0, 1, &mRequest.takeMutex); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0xFFF1FC06) command (0x00000000) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - MTRBaseClusterFaultInjection * cluster = [[MTRBaseClusterFaultInjection alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - __auto_type * params = [[MTRFaultInjectionClusterFailAtFaultParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.type = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.type)]; - params.id = [NSNumber numberWithUnsignedInt:mRequest.id]; - params.numCallsToSkip = [NSNumber numberWithUnsignedInt:mRequest.numCallsToSkip]; - params.numCallsToFail = [NSNumber numberWithUnsignedInt:mRequest.numCallsToFail]; - params.takeMutex = [NSNumber numberWithBool:mRequest.takeMutex]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster failAtFaultWithParams:params - completionHandler:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return CHIP_NO_ERROR; - } - -private: - chip::app::Clusters::FaultInjection::Commands::FailAtFault::Type mRequest; -}; - -/* - * Command FailRandomlyAtFault - */ -class FaultInjectionFailRandomlyAtFault : public ClusterCommand { -public: - FaultInjectionFailRandomlyAtFault() - : ClusterCommand("fail-randomly-at-fault") - { - AddArgument("Type", 0, UINT8_MAX, &mRequest.type); - AddArgument("Id", 0, UINT32_MAX, &mRequest.id); - AddArgument("Percentage", 0, UINT8_MAX, &mRequest.percentage); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0xFFF1FC06) command (0x00000001) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - MTRBaseClusterFaultInjection * cluster = [[MTRBaseClusterFaultInjection alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - __auto_type * params = [[MTRFaultInjectionClusterFailRandomlyAtFaultParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.type = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.type)]; - params.id = [NSNumber numberWithUnsignedInt:mRequest.id]; - params.percentage = [NSNumber numberWithUnsignedChar:mRequest.percentage]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster failRandomlyAtFaultWithParams:params - completionHandler:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return CHIP_NO_ERROR; - } - -private: - chip::app::Clusters::FaultInjection::Commands::FailRandomlyAtFault::Type mRequest; -}; - -/* - * Attribute GeneratedCommandList - */ -class ReadFaultInjectionGeneratedCommandList : public ReadAttribute { -public: - ReadFaultInjectionGeneratedCommandList() - : ReadAttribute("generated-command-list") - { - } - - ~ReadFaultInjectionGeneratedCommandList() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0xFFF1FC06) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - MTRBaseClusterFaultInjection * cluster = [[MTRBaseClusterFaultInjection alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FaultInjection.GeneratedCommandList response %@", [value description]); - if (error != nil) { - LogNSError("FaultInjection GeneratedCommandList read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeFaultInjectionGeneratedCommandList : public SubscribeAttribute { -public: - SubscribeAttributeFaultInjectionGeneratedCommandList() - : SubscribeAttribute("generated-command-list") - { - } - - ~SubscribeAttributeFaultInjectionGeneratedCommandList() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0xFFF1FC06) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - MTRBaseClusterFaultInjection * cluster = [[MTRBaseClusterFaultInjection alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FaultInjection.GeneratedCommandList response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -/* - * Attribute AcceptedCommandList - */ -class ReadFaultInjectionAcceptedCommandList : public ReadAttribute { -public: - ReadFaultInjectionAcceptedCommandList() - : ReadAttribute("accepted-command-list") - { - } - - ~ReadFaultInjectionAcceptedCommandList() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0xFFF1FC06) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - MTRBaseClusterFaultInjection * cluster = [[MTRBaseClusterFaultInjection alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FaultInjection.AcceptedCommandList response %@", [value description]); - if (error != nil) { - LogNSError("FaultInjection AcceptedCommandList read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeFaultInjectionAcceptedCommandList : public SubscribeAttribute { -public: - SubscribeAttributeFaultInjectionAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") - { - } - - ~SubscribeAttributeFaultInjectionAcceptedCommandList() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0xFFF1FC06) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - MTRBaseClusterFaultInjection * cluster = [[MTRBaseClusterFaultInjection alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FaultInjection.AcceptedCommandList response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -/* - * Attribute AttributeList - */ -class ReadFaultInjectionAttributeList : public ReadAttribute { -public: - ReadFaultInjectionAttributeList() - : ReadAttribute("attribute-list") - { - } - - ~ReadFaultInjectionAttributeList() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0xFFF1FC06) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - MTRBaseClusterFaultInjection * cluster = [[MTRBaseClusterFaultInjection alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FaultInjection.AttributeList response %@", [value description]); - if (error != nil) { - LogNSError("FaultInjection AttributeList read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeFaultInjectionAttributeList : public SubscribeAttribute { -public: - SubscribeAttributeFaultInjectionAttributeList() - : SubscribeAttribute("attribute-list") - { - } - - ~SubscribeAttributeFaultInjectionAttributeList() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0xFFF1FC06) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - MTRBaseClusterFaultInjection * cluster = [[MTRBaseClusterFaultInjection alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FaultInjection.AttributeList response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -/* - * Attribute FeatureMap - */ -class ReadFaultInjectionFeatureMap : public ReadAttribute { -public: - ReadFaultInjectionFeatureMap() - : ReadAttribute("feature-map") - { - } - - ~ReadFaultInjectionFeatureMap() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0xFFF1FC06) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - MTRBaseClusterFaultInjection * cluster = [[MTRBaseClusterFaultInjection alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FaultInjection.FeatureMap response %@", [value description]); - if (error != nil) { - LogNSError("FaultInjection FeatureMap read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeFaultInjectionFeatureMap : public SubscribeAttribute { -public: - SubscribeAttributeFaultInjectionFeatureMap() - : SubscribeAttribute("feature-map") - { - } - - ~SubscribeAttributeFaultInjectionFeatureMap() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0xFFF1FC06) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - MTRBaseClusterFaultInjection * cluster = [[MTRBaseClusterFaultInjection alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FaultInjection.FeatureMap response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -/* - * Attribute ClusterRevision - */ -class ReadFaultInjectionClusterRevision : public ReadAttribute { -public: - ReadFaultInjectionClusterRevision() - : ReadAttribute("cluster-revision") - { - } - - ~ReadFaultInjectionClusterRevision() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0xFFF1FC06) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - MTRBaseClusterFaultInjection * cluster = [[MTRBaseClusterFaultInjection alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FaultInjection.ClusterRevision response %@", [value description]); - if (error != nil) { - LogNSError("FaultInjection ClusterRevision read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeFaultInjectionClusterRevision : public SubscribeAttribute { -public: - SubscribeAttributeFaultInjectionClusterRevision() - : SubscribeAttribute("cluster-revision") - { - } - - ~SubscribeAttributeFaultInjectionClusterRevision() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0xFFF1FC06) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - MTRBaseClusterFaultInjection * cluster = [[MTRBaseClusterFaultInjection alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FaultInjection.ClusterRevision response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - /*----------------------------------------------------------------------------*\ | Register all Clusters commands | \*----------------------------------------------------------------------------*/ @@ -97060,33 +96609,6 @@ void registerClusterTestCluster(Commands & commands) commands.Register(clusterName, clusterCommands); } -void registerClusterFaultInjection(Commands & commands) -{ - using namespace chip::app::Clusters::FaultInjection; - - const char * clusterName = "FaultInjection"; - - commands_list clusterCommands = { - make_unique(Id), // - make_unique(), // - make_unique(), // - make_unique(Id), // - make_unique(), // - make_unique(Id), // - make_unique(Id), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - }; - - commands.Register(clusterName, clusterCommands); -} void registerClusterAny(Commands & commands) { @@ -97171,5 +96693,4 @@ void registerClusters(Commands & commands) registerClusterAccountLogin(commands); registerClusterElectricalMeasurement(commands); registerClusterTestCluster(commands); - registerClusterFaultInjection(commands); }