From 1890490c964fa2abe85e0ef6e677b1c8b3f6859c Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Tue, 31 Oct 2023 00:32:44 -0700 Subject: [PATCH 01/12] Move the TlvReaderExternsion to TlvReader (#30117) --- src/controller/java/BUILD.gn | 4 +- .../cluster/TlvReaderExtension.kt | 44 ---------------- .../java/src/matter/tlv/TlvReader.kt | 51 +++++++++++++++++++ 3 files changed, 52 insertions(+), 47 deletions(-) delete mode 100644 src/controller/java/src/chip/devicecontroller/cluster/TlvReaderExtension.kt diff --git a/src/controller/java/BUILD.gn b/src/controller/java/BUILD.gn index ee5ead80b18b38..71c2a8b07bcbf5 100644 --- a/src/controller/java/BUILD.gn +++ b/src/controller/java/BUILD.gn @@ -328,9 +328,7 @@ kotlin_library("chipcluster") { deps = [ ":tlv" ] - sources = [ "src/chip/devicecontroller/cluster/TlvReaderExtension.kt" ] - - sources += structs_sources + sources = structs_sources sources += eventstructs_sources kotlinc_flags = [ "-Xlint:deprecation" ] diff --git a/src/controller/java/src/chip/devicecontroller/cluster/TlvReaderExtension.kt b/src/controller/java/src/chip/devicecontroller/cluster/TlvReaderExtension.kt deleted file mode 100644 index 136e64e4b555fd..00000000000000 --- a/src/controller/java/src/chip/devicecontroller/cluster/TlvReaderExtension.kt +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * Copyright (c) 2023 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package chip.devicecontroller.cluster - -import matter.tlv.NullValue -import matter.tlv.Tag -import matter.tlv.TlvReader - -fun TlvReader.getBoolean(tag: Tag): Boolean { - return getBool(tag) -} - -fun TlvReader.getString(tag: Tag): String { - return getUtf8String(tag) -} - -fun TlvReader.getByteArray(tag: Tag): ByteArray { - return getByteString(tag) -} - -fun TlvReader.isNull(): Boolean { - val value = peekElement().value - return (value is NullValue) -} - -fun TlvReader.isNextTag(tag: Tag): Boolean { - val nextTag = peekElement().tag - return (nextTag == tag) -} diff --git a/src/controller/java/src/matter/tlv/TlvReader.kt b/src/controller/java/src/matter/tlv/TlvReader.kt index 94fefe0b07f5cf..d8ce4d187a08f8 100644 --- a/src/controller/java/src/matter/tlv/TlvReader.kt +++ b/src/controller/java/src/matter/tlv/TlvReader.kt @@ -265,6 +265,57 @@ class TlvReader(bytes: ByteArray) : Iterable { require(value is NullValue) { "Unexpected value $value at index $index (expected NullValue)" } } + /** + * Retrieves a Boolean value associated with the given tag. + * + * @param tag The Tag to query for. + * @return The Boolean value associated with the tag. + */ + fun getBoolean(tag: Tag): Boolean { + return getBool(tag) + } + + /** + * Retrieves a String value associated with the given tag. The returned string is in UTF-8 format. + * + * @param tag The Tag to query for. + * @return The String value associated with the tag. + */ + fun getString(tag: Tag): String { + return getUtf8String(tag) + } + + /** + * Retrieves a ByteArray value associated with the given tag. + * + * @param tag The Tag to query for. + * @return The ByteArray value associated with the tag. + */ + fun getByteArray(tag: Tag): ByteArray { + return getByteString(tag) + } + + /** + * Checks if the current element's value is of type NullValue. + * + * @return True if the current element's value is NullValue, otherwise false. + */ + fun isNull(): Boolean { + val value = peekElement().value + return (value is NullValue) + } + + /** + * Checks if the next tag in sequence matches the provided tag. + * + * @param tag The Tag to compare against the next tag. + * @return True if the next tag matches the provided tag, otherwise false. + */ + fun isNextTag(tag: Tag): Boolean { + val nextTag = peekElement().tag + return (nextTag == tag) + } + /** * Verifies that the current element is a start of a Structure and advances to the next element. * From 4e438d69c63d259dafdc3fc3bb1748d7de27e044 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Tue, 31 Oct 2023 07:45:48 -0700 Subject: [PATCH 02/12] Update Java8 Optional handling in JniReferences (#30071) --- src/lib/support/JniReferences.cpp | 108 ++++++++++++++++++++---------- src/lib/support/JniReferences.h | 4 ++ 2 files changed, 75 insertions(+), 37 deletions(-) diff --git a/src/lib/support/JniReferences.cpp b/src/lib/support/JniReferences.cpp index f07837ade467bd..b6919f8c076b4a 100644 --- a/src/lib/support/JniReferences.cpp +++ b/src/lib/support/JniReferences.cpp @@ -21,6 +21,7 @@ #include #include #include +#include namespace chip { @@ -35,7 +36,7 @@ void JniReferences::SetJavaVm(JavaVM * jvm, const char * clsType) JNIEnv * env = GetEnvForCurrentThread(); // Any chip.devicecontroller.* class will work here - just need something to call getClassLoader() on. jclass chipClass = env->FindClass(clsType); - VerifyOrReturn(chipClass != nullptr, ChipLogError(Support, "clsType can not found")); + VerifyOrReturn(chipClass != nullptr, ChipLogError(Support, "clsType can not be found")); jclass classClass = env->FindClass("java/lang/Class"); jclass classLoaderClass = env->FindClass("java/lang/ClassLoader"); @@ -47,6 +48,36 @@ void JniReferences::SetJavaVm(JavaVM * jvm, const char * clsType) chip::JniReferences::GetInstance().GetClassRef(env, "java/util/List", mListClass); chip::JniReferences::GetInstance().GetClassRef(env, "java/util/ArrayList", mArrayListClass); chip::JniReferences::GetInstance().GetClassRef(env, "java/util/HashMap", mHashMapClass); + + // Determine if the Java code has proper Java 8 support or not. + // The class and method chosen here are arbitrary, all we care about is + // looking up any method that has an Optional parameter. + jclass controllerParamsClass = env->FindClass("chip/devicecontroller/ControllerParams"); + VerifyOrReturn(controllerParamsClass != nullptr, ChipLogError(Support, "controllerParamsClass is nullptr")); + + jmethodID getCountryCodeMethod = env->GetMethodID(controllerParamsClass, "getCountryCode", "()Ljava/util/Optional;"); + if (getCountryCodeMethod == nullptr) + { + // GetMethodID will have thrown an exception previously if it returned nullptr. + env->ExceptionClear(); + VerifyOrReturn(env->GetMethodID(controllerParamsClass, "getCountryCode", "()Lj$/util/Optional;") != nullptr, + ChipLogError(Support, "Method getCountryCode can not be found")); + use_java8_optional = false; + } + else + { + use_java8_optional = true; + } + + if (use_java8_optional) + { + chip::JniReferences::GetInstance().GetClassRef(env, "java/util/Optional", mOptionalClass); + } + else + { + chip::JniReferences::GetInstance().GetClassRef(env, "j$/util/Optional", mOptionalClass); + } + VerifyOrReturn(mOptionalClass != nullptr, ChipLogError(Support, "mOptionalClass is nullptr")); } JNIEnv * JniReferences::GetEnvForCurrentThread() @@ -90,11 +121,11 @@ CHIP_ERROR JniReferences::GetLocalClassRef(JNIEnv * env, const char * clsType, j { jclass cls = nullptr; - // Try `j$/util/Optional` when enabling Java8. - if (strcmp(clsType, "java/util/Optional") == 0) + // Try `j$/util/Optional` when enabling Java8. Check whether mOptionalClass + // is null because this method is used to originally set mOptionalClass. + if (mOptionalClass != nullptr && (strcmp(clsType, "java/util/Optional") == 0 || strcmp(clsType, "j$/util/Optional") == 0)) { - cls = env->FindClass("j$/util/Optional"); - env->ExceptionClear(); + cls = mOptionalClass; } if (cls == nullptr) @@ -129,6 +160,18 @@ CHIP_ERROR JniReferences::N2J_ByteArray(JNIEnv * env, const uint8_t * inArray, j return err; } +static std::string StrReplaceAll(const std::string & source, const std::string & from, const std::string & to) +{ + std::string newString = source; + size_t pos = 0; + while ((pos = newString.find(from, pos)) != std::string::npos) + { + newString.replace(pos, from.length(), to); + pos += to.length(); + } + return newString; +} + CHIP_ERROR JniReferences::FindMethod(JNIEnv * env, jobject object, const char * methodName, const char * methodSignature, jmethodID * methodId) { @@ -146,21 +189,14 @@ CHIP_ERROR JniReferences::FindMethod(JNIEnv * env, jobject object, const char * return CHIP_NO_ERROR; } - // Try `j$` when enabling Java8. - std::string methodSignature_java8_str(methodSignature); - size_t pos = methodSignature_java8_str.find("java/util/Optional"); - if (pos != std::string::npos) + std::string method_signature = methodSignature; + if (!use_java8_optional) { - // Replace all "java/util/Optional" with "j$/util/Optional". - while (pos != std::string::npos) - { - methodSignature_java8_str.replace(pos, strlen("java/util/Optional"), "j$/util/Optional"); - pos = methodSignature_java8_str.find("java/util/Optional"); - } - *methodId = env->GetMethodID(javaClass, methodName, methodSignature_java8_str.c_str()); - env->ExceptionClear(); + method_signature = StrReplaceAll(method_signature, "java/util/Optional", "j$/util/Optional"); } + *methodId = env->GetMethodID(javaClass, methodName, method_signature.data()); + VerifyOrReturnError(*methodId != nullptr, CHIP_JNI_ERROR_METHOD_NOT_FOUND); return CHIP_NO_ERROR; @@ -226,24 +262,23 @@ void JniReferences::ThrowError(JNIEnv * env, jclass exceptionCls, CHIP_ERROR err CHIP_ERROR JniReferences::CreateOptional(jobject objectToWrap, jobject & outOptional) { - JNIEnv * env = GetEnvForCurrentThread(); - jclass optionalCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/util/Optional", optionalCls); - VerifyOrReturnError(optionalCls != nullptr, CHIP_JNI_ERROR_TYPE_NOT_FOUND); - chip::JniClass jniClass(optionalCls); + VerifyOrReturnError(mOptionalClass != nullptr, CHIP_JNI_ERROR_TYPE_NOT_FOUND); - jmethodID ofMethod = env->GetStaticMethodID(optionalCls, "ofNullable", "(Ljava/lang/Object;)Ljava/util/Optional;"); - env->ExceptionClear(); + JNIEnv * const env = GetEnvForCurrentThread(); + VerifyOrReturnError(env != nullptr, CHIP_JNI_ERROR_NO_ENV); - // Try `Lj$/util/Optional;` when enabling Java8. - if (ofMethod == nullptr) + jmethodID ofMethod = nullptr; + if (use_java8_optional) { - ofMethod = env->GetStaticMethodID(optionalCls, "ofNullable", "(Ljava/lang/Object;)Lj$/util/Optional;"); - env->ExceptionClear(); + ofMethod = env->GetStaticMethodID(mOptionalClass, "ofNullable", "(Ljava/lang/Object;)Ljava/util/Optional;"); + } + else + { + ofMethod = env->GetStaticMethodID(mOptionalClass, "ofNullable", "(Ljava/lang/Object;)Lj$/util/Optional;"); } - VerifyOrReturnError(ofMethod != nullptr, CHIP_JNI_ERROR_METHOD_NOT_FOUND); - outOptional = env->CallStaticObjectMethod(optionalCls, ofMethod, objectToWrap); + + outOptional = env->CallStaticObjectMethod(mOptionalClass, ofMethod, objectToWrap); VerifyOrReturnError(!env->ExceptionCheck(), CHIP_JNI_ERROR_EXCEPTION_THROWN); @@ -252,13 +287,12 @@ CHIP_ERROR JniReferences::CreateOptional(jobject objectToWrap, jobject & outOpti CHIP_ERROR JniReferences::GetOptionalValue(jobject optionalObj, jobject & optionalValue) { - JNIEnv * env = GetEnvForCurrentThread(); - jclass optionalCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/util/Optional", optionalCls); - VerifyOrReturnError(optionalCls != nullptr, CHIP_JNI_ERROR_TYPE_NOT_FOUND); - chip::JniClass jniClass(optionalCls); + VerifyOrReturnError(mOptionalClass != nullptr, CHIP_JNI_ERROR_TYPE_NOT_FOUND); + + JNIEnv * const env = GetEnvForCurrentThread(); + VerifyOrReturnError(env != nullptr, CHIP_JNI_ERROR_NO_ENV); - jmethodID isPresentMethod = env->GetMethodID(optionalCls, "isPresent", "()Z"); + jmethodID isPresentMethod = env->GetMethodID(mOptionalClass, "isPresent", "()Z"); VerifyOrReturnError(isPresentMethod != nullptr, CHIP_JNI_ERROR_METHOD_NOT_FOUND); jboolean isPresent = optionalObj && env->CallBooleanMethod(optionalObj, isPresentMethod); @@ -268,7 +302,7 @@ CHIP_ERROR JniReferences::GetOptionalValue(jobject optionalObj, jobject & option return CHIP_NO_ERROR; } - jmethodID getMethod = env->GetMethodID(optionalCls, "get", "()Ljava/lang/Object;"); + jmethodID getMethod = env->GetMethodID(mOptionalClass, "get", "()Ljava/lang/Object;"); VerifyOrReturnError(getMethod != nullptr, CHIP_JNI_ERROR_METHOD_NOT_FOUND); optionalValue = env->CallObjectMethod(optionalObj, getMethod); return CHIP_NO_ERROR; diff --git a/src/lib/support/JniReferences.h b/src/lib/support/JniReferences.h index 9a0fea52019040..4abef990822b0c 100644 --- a/src/lib/support/JniReferences.h +++ b/src/lib/support/JniReferences.h @@ -190,8 +190,12 @@ class JniReferences jobject mClassLoader = nullptr; jmethodID mFindClassMethod = nullptr; + // These are global refs and therefore safe to persist. jclass mHashMapClass = nullptr; jclass mListClass = nullptr; jclass mArrayListClass = nullptr; + jclass mOptionalClass = nullptr; + + bool use_java8_optional = false; }; } // namespace chip From d165f6274a813ce7e471fd6822a5ad80dc7f3477 Mon Sep 17 00:00:00 2001 From: Tennessee Carmel-Veilleux Date: Tue, 31 Oct 2023 10:50:04 -0400 Subject: [PATCH 03/12] Add general diagnostics cluster Matter 1.3 XML changes (#30091) - Added TimeSnapshot command - Added necessary comments about other changes needed - Regenerated zap - Put necessary scaffolding for TimeSnapshot command - Updated TC-DGEN-1.1/TC-DGEN-2.1 tests to work with updated revision Issue #30096 --------- Co-authored-by: tennessee.carmelveilleux@gmail.com Co-authored-by: Restyled.io --- .../air-purifier-app.matter | 10 +- .../air-purifier-common/air-purifier-app.zap | 18 +- .../air-quality-sensor-app.matter | 10 +- .../air-quality-sensor-app.zap | 18 +- .../all-clusters-app.matter | 10 +- .../all-clusters-common/all-clusters-app.zap | 18 +- .../all-clusters-minimal-app.matter | 12 +- .../all-clusters-minimal-app.zap | 34 +++- .../bridge-common/bridge-app.matter | 10 +- .../bridge-app/bridge-common/bridge-app.zap | 18 +- ...p_rootnode_dimmablelight_bCwGYSDpoe.matter | 10 +- ...noip_rootnode_dimmablelight_bCwGYSDpoe.zap | 18 +- ...umiditysensor_thermostat_56de3d5f45.matter | 10 +- ...r_humiditysensor_thermostat_56de3d5f45.zap | 18 +- ...ootnode_airqualitysensor_e63187f6c9.matter | 10 +- .../rootnode_airqualitysensor_e63187f6c9.zap | 18 +- ...ootnode_basicvideoplayer_0ff86e943b.matter | 10 +- .../rootnode_basicvideoplayer_0ff86e943b.zap | 18 +- ...de_colortemperaturelight_hbUnzYVeyn.matter | 10 +- ...tnode_colortemperaturelight_hbUnzYVeyn.zap | 18 +- .../rootnode_contactsensor_lFAGG1bfRO.matter | 10 +- .../rootnode_contactsensor_lFAGG1bfRO.zap | 18 +- .../rootnode_dimmablelight_bCwGYSDpoe.matter | 10 +- .../rootnode_dimmablelight_bCwGYSDpoe.zap | 18 +- .../rootnode_dishwasher_cc105034fe.matter | 10 +- .../rootnode_dishwasher_cc105034fe.zap | 18 +- .../rootnode_doorlock_aNKYAreMXE.matter | 10 +- .../devices/rootnode_doorlock_aNKYAreMXE.zap | 18 +- ...tnode_extendedcolorlight_8lcaaYJVAa.matter | 10 +- ...rootnode_extendedcolorlight_8lcaaYJVAa.zap | 18 +- .../devices/rootnode_fan_7N2TobIlOX.matter | 10 +- .../chef/devices/rootnode_fan_7N2TobIlOX.zap | 18 +- .../rootnode_flowsensor_1zVxHedlaV.matter | 10 +- .../rootnode_flowsensor_1zVxHedlaV.zap | 18 +- .../rootnode_genericswitch_9866e35d0b.matter | 10 +- .../rootnode_genericswitch_9866e35d0b.zap | 18 +- ...tnode_heatingcoolingunit_ncdGai1E5a.matter | 10 +- ...rootnode_heatingcoolingunit_ncdGai1E5a.zap | 18 +- .../rootnode_humiditysensor_Xyj4gda6Hb.matter | 10 +- .../rootnode_humiditysensor_Xyj4gda6Hb.zap | 18 +- .../rootnode_laundrywasher_fb10d238c8.matter | 10 +- .../rootnode_laundrywasher_fb10d238c8.zap | 18 +- .../rootnode_lightsensor_lZQycTFcJK.matter | 10 +- .../rootnode_lightsensor_lZQycTFcJK.zap | 18 +- ...rootnode_occupancysensor_iHyVgifZuo.matter | 10 +- .../rootnode_occupancysensor_iHyVgifZuo.zap | 18 +- .../rootnode_onofflight_bbs1b7IaOV.matter | 10 +- .../rootnode_onofflight_bbs1b7IaOV.zap | 18 +- .../rootnode_onofflight_samplemei.matter | 10 +- .../devices/rootnode_onofflight_samplemei.zap | 18 +- ...ootnode_onofflightswitch_FsPlMr090Q.matter | 10 +- .../rootnode_onofflightswitch_FsPlMr090Q.zap | 18 +- ...rootnode_onoffpluginunit_Wtf8ss5EBY.matter | 10 +- .../rootnode_onoffpluginunit_Wtf8ss5EBY.zap | 18 +- .../rootnode_pressuresensor_s0qC9wLH4k.matter | 10 +- .../rootnode_pressuresensor_s0qC9wLH4k.zap | 18 +- .../devices/rootnode_pump_5f904818cc.matter | 12 +- .../chef/devices/rootnode_pump_5f904818cc.zap | 34 +++- .../devices/rootnode_pump_a811bb33a0.matter | 12 +- .../chef/devices/rootnode_pump_a811bb33a0.zap | 34 +++- ...eraturecontrolledcabinet_ffdb696680.matter | 10 +- ...emperaturecontrolledcabinet_ffdb696680.zap | 18 +- ...ode_roboticvacuumcleaner_1807ff0c49.matter | 10 +- ...otnode_roboticvacuumcleaner_1807ff0c49.zap | 18 +- ...tnode_roomairconditioner_9cf3607804.matter | 10 +- ...rootnode_roomairconditioner_9cf3607804.zap | 18 +- .../rootnode_smokecoalarm_686fe0dcb8.matter | 10 +- .../rootnode_smokecoalarm_686fe0dcb8.zap | 18 +- .../rootnode_speaker_RpzeXdimqA.matter | 10 +- .../devices/rootnode_speaker_RpzeXdimqA.zap | 18 +- ...otnode_temperaturesensor_Qy1zkNW7c3.matter | 10 +- .../rootnode_temperaturesensor_Qy1zkNW7c3.zap | 18 +- .../rootnode_thermostat_bm3fb8dhYi.matter | 10 +- .../rootnode_thermostat_bm3fb8dhYi.zap | 18 +- .../rootnode_windowcovering_RLCxaGi9Yx.matter | 10 +- .../rootnode_windowcovering_RLCxaGi9Yx.zap | 18 +- examples/chef/devices/template.zap | 18 +- .../test_files/sample_zap_file.zap | 2 +- .../contact-sensor-app.matter | 10 +- .../contact-sensor-app.zap | 18 +- .../dishwasher-common/dishwasher-app.matter | 10 +- .../dishwasher-common/dishwasher-app.zap | 18 +- .../light-switch-app.matter | 10 +- .../light-switch-common/light-switch-app.zap | 18 +- .../data_model/lighting-app-ethernet.matter | 10 +- .../data_model/lighting-app-ethernet.zap | 18 +- .../data_model/lighting-app-thread.matter | 10 +- .../data_model/lighting-app-thread.zap | 18 +- .../data_model/lighting-app-wifi.matter | 10 +- .../data_model/lighting-app-wifi.zap | 18 +- .../lighting-common/lighting-app.matter | 10 +- .../lighting-common/lighting-app.zap | 18 +- .../nxp/zap/lighting-on-off.matter | 12 +- .../lighting-app/nxp/zap/lighting-on-off.zap | 34 +++- examples/lighting-app/qpg/zap/light.matter | 10 +- examples/lighting-app/qpg/zap/light.zap | 18 +- .../data_model/lighting-thread-app.matter | 10 +- .../silabs/data_model/lighting-thread-app.zap | 18 +- .../data_model/lighting-wifi-app.matter | 10 +- .../silabs/data_model/lighting-wifi-app.zap | 18 +- examples/lock-app/lock-common/lock-app.matter | 10 +- examples/lock-app/lock-common/lock-app.zap | 18 +- examples/lock-app/nxp/zap/lock-app.matter | 12 +- examples/lock-app/nxp/zap/lock-app.zap | 34 +++- examples/lock-app/qpg/zap/lock.matter | 10 +- examples/lock-app/qpg/zap/lock.zap | 18 +- .../ota-provider-app.matter | 10 +- .../ota-provider-common/ota-provider-app.zap | 18 +- .../ota-requestor-app.matter | 10 +- .../ota-requestor-app.zap | 18 +- .../placeholder/linux/apps/app1/config.matter | 10 +- .../placeholder/linux/apps/app1/config.zap | 18 +- .../placeholder/linux/apps/app2/config.matter | 10 +- .../placeholder/linux/apps/app2/config.zap | 18 +- examples/pump-app/pump-common/pump-app.matter | 12 +- examples/pump-app/pump-common/pump-app.zap | 34 +++- .../silabs/data_model/pump-thread-app.matter | 12 +- .../silabs/data_model/pump-thread-app.zap | 34 +++- .../silabs/data_model/pump-wifi-app.matter | 12 +- .../silabs/data_model/pump-wifi-app.zap | 34 +++- .../pump-controller-app.matter | 12 +- .../pump-controller-app.zap | 34 +++- .../refrigerator-app.matter | 10 +- .../refrigerator-common/refrigerator-app.zap | 18 +- .../resource-monitoring-app.matter | 10 +- .../resource-monitoring-app.zap | 18 +- examples/rvc-app/rvc-common/rvc-app.matter | 10 +- examples/rvc-app/rvc-common/rvc-app.zap | 18 +- .../smoke-co-alarm-app.matter | 10 +- .../smoke-co-alarm-app.zap | 18 +- .../temperature-measurement.matter | 10 +- .../temperature-measurement.zap | 18 +- .../nxp/zap/thermostat_matter_thread.matter | 10 +- .../nxp/zap/thermostat_matter_thread.zap | 18 +- .../nxp/zap/thermostat_matter_wifi.matter | 10 +- .../nxp/zap/thermostat_matter_wifi.zap | 18 +- .../thermostat-common/thermostat.matter | 10 +- .../thermostat-common/thermostat.zap | 18 +- examples/tv-app/tv-common/tv-app.matter | 10 +- examples/tv-app/tv-common/tv-app.zap | 18 +- .../tv-casting-common/tv-casting-app.matter | 10 +- .../tv-casting-common/tv-casting-app.zap | 18 +- .../virtual-device-app.matter | 10 +- .../virtual-device-app.zap | 18 +- examples/window-app/common/window-app.matter | 10 +- examples/window-app/common/window-app.zap | 18 +- .../general-diagnostics-server.cpp | 9 + .../certification/Test_TC_DGGEN_1_1.yaml | 11 +- .../certification/Test_TC_DGGEN_2_1.yaml | 4 - .../chip/general-diagnostics-cluster.xml | 34 ++-- .../data_model/controller-clusters.matter | 7 + .../chip/devicecontroller/ChipClusters.java | 15 ++ .../devicecontroller/ClusterIDMapping.java | 3 +- .../devicecontroller/ClusterInfoMapping.java | 36 ++++ .../zap-generated/CHIPInvokeCallbacks.cpp | 75 ++++++++ .../java/zap-generated/CHIPInvokeCallbacks.h | 15 ++ .../python/chip/clusters/CHIPClusters.py | 6 + .../python/chip/clusters/Objects.py | 31 ++++ .../CHIP/zap-generated/MTRBaseClusters.h | 8 + .../CHIP/zap-generated/MTRBaseClusters.mm | 28 +++ .../CHIP/zap-generated/MTRClusterConstants.h | 2 + .../CHIP/zap-generated/MTRClusters.h | 3 + .../CHIP/zap-generated/MTRClusters.mm | 31 ++++ .../zap-generated/MTRCommandPayloadsObjc.h | 49 ++++++ .../zap-generated/MTRCommandPayloadsObjc.mm | 162 ++++++++++++++++++ .../MTRCommandPayloads_Internal.h | 12 ++ .../app-common/zap-generated/callback.h | 6 + .../zap-generated/cluster-objects.cpp | 59 +++++++ .../zap-generated/cluster-objects.h | 73 ++++++++ .../app-common/zap-generated/ids/Commands.h | 8 + .../zap-generated/cluster/Commands.h | 39 +++++ .../cluster/logging/DataModelLogger.cpp | 20 +++ .../cluster/logging/DataModelLogger.h | 2 + .../zap-generated/cluster/Commands.h | 52 ++++++ .../zap-generated/test/Commands.h | 18 +- 175 files changed, 2839 insertions(+), 177 deletions(-) diff --git a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter index 1f912fcd64e643..d8eae9ae77ced3 100644 --- a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter +++ b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter @@ -739,7 +739,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ @@ -1883,9 +1889,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster AdministratorCommissioning { diff --git a/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap b/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap index c1f47b4d162a51..cc96cb04983fc4 100644 --- a/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap +++ b/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap @@ -1379,6 +1379,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1552,7 +1568,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter index 736803eaad9c70..ca74840f26cdd7 100644 --- a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter @@ -696,7 +696,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1886,9 +1892,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap index 13bfc7a3777a90..f459cfa6521060 100644 --- a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap @@ -1327,6 +1327,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1500,7 +1516,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index a27629bc4da66d..ca2f4ed0bda4ab 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -1669,7 +1669,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -5399,9 +5405,11 @@ endpoint 0 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 24e0df516f1b12..c5045d193a6d82 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -2695,6 +2695,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -2932,7 +2948,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 5a4a521d090db2..d80602ebfc5633 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -1475,6 +1475,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute NetworkInterface networkInterfaces[] = 0; readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; readonly attribute boolean testEventTriggersEnabled = 8; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1488,7 +1489,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -4189,15 +4196,18 @@ endpoint 0 { server cluster GeneralDiagnostics { callback attribute networkInterfaces; callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; callback attribute testEventTriggersEnabled; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap index b5931df6f9ca27..50ab55464e0526 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap @@ -2368,6 +2368,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -2403,6 +2419,22 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "TestEventTriggersEnabled", "code": 8, @@ -2509,7 +2541,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index 63f5eb56aa9021..694b7de74c9f38 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -1006,7 +1006,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1787,9 +1793,11 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/bridge-app/bridge-common/bridge-app.zap b/examples/bridge-app/bridge-common/bridge-app.zap index a317c4f078917e..9570644c62188a 100644 --- a/examples/bridge-app/bridge-common/bridge-app.zap +++ b/examples/bridge-app/bridge-common/bridge-app.zap @@ -1797,6 +1797,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -2018,7 +2034,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index 35637f909cfcd7..8dfc00959b33d3 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -878,7 +878,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1599,9 +1605,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap index 25ac5369207196..8a9d8d4e42c31d 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap @@ -1299,6 +1299,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1472,7 +1488,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter index 7e202205baad3c..a44002cc3ca5e6 100644 --- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter +++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter @@ -659,7 +659,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ @@ -1848,9 +1854,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster AdministratorCommissioning { diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap index 972a203fbb2822..8e8c9a404ce37c 100644 --- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap +++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap @@ -1172,6 +1172,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1345,7 +1361,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter index 25c89264dc5cc4..7ab39684ed63a8 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter @@ -788,7 +788,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1823,9 +1829,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap index 9bcbe3d733ef4d..8df2dae41dc7d8 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter index 552d72bad13b31..a9e79fa2f29573 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter @@ -793,7 +793,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1593,9 +1599,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap index 5f7070767c1420..f9b6772b58d4f2 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter index f34d41305c3231..05203e0729239f 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter @@ -970,7 +970,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1644,9 +1650,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap index 54a5668ca54ea3..4c96f6708498f9 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap @@ -1379,6 +1379,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1552,7 +1568,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index 1f48ef322092f0..39ac6b08dba8f3 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -876,7 +876,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1320,9 +1326,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap index 57d85478f48039..49c9fe342f96be 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index 590adf953259f3..f503073da064bb 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -1026,7 +1026,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1496,9 +1502,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap index b5d2ed8cfb1508..ae7f9833be6028 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap @@ -1575,6 +1575,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1748,7 +1764,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter index b3273daa5b68c6..45c904f19f693a 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter @@ -631,7 +631,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1165,9 +1171,11 @@ endpoint 0 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster WiFiNetworkDiagnostics { diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap index e50c640463cb6d..25a0d0d1be222b 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap @@ -1786,6 +1786,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -2007,7 +2023,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index db8fafe7e33ab9..ab0f572eb982ad 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -876,7 +876,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1792,9 +1798,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap index 6e55ee26b2f95c..fc97739ea6ec98 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index 4055d3f91948f7..5502974d07c632 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -1026,7 +1026,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1723,9 +1729,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap index 5d3000d8b3ab71..62689b778ce654 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter index 37361893fd2449..bb154d3af5b762 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter @@ -863,7 +863,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1363,9 +1369,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap b/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap index 6d93d50076731c..f410f56974d928 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap @@ -1559,6 +1559,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1732,7 +1748,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index 430af0dd820338..2ddd9204315b8e 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -882,7 +882,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1325,9 +1331,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap index 3ad57c090834ff..d193bb5d236e2b 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter index 3305b751649ce5..de09288e6eaf13 100644 --- a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter +++ b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter @@ -590,7 +590,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** This cluster exposes interactions with a switch device, for the purpose of using those interactions by other devices. @@ -990,9 +996,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster AdministratorCommissioning { diff --git a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap index 1f3613a429ed18..568708c64ea1ad 100644 --- a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap +++ b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap @@ -1172,6 +1172,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1345,7 +1361,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index 08aa21400773f2..03c9febba23c21 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -1020,7 +1020,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1672,9 +1678,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap index 3995dfe9782e6a..40ea29e55ac961 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index 3078ca5196ed87..a3c8e66c387718 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -882,7 +882,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1325,9 +1331,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap index 0e56fbaa2449b8..9837d64370ea7f 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter index 2e9b45c1f90b23..9657c9b28e6909 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter @@ -631,7 +631,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1163,9 +1169,11 @@ endpoint 0 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster WiFiNetworkDiagnostics { diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap index 798ae3307bd2e0..c33f7639fe02d9 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap @@ -1786,6 +1786,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -2007,7 +2023,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index 6a9dd8678eaf30..3110d0f02c255d 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -882,7 +882,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1330,9 +1336,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap index a33119d44de291..4628663d2048eb 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index 14000155c0a0bc..17d359a6a8e4cc 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -882,7 +882,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1341,9 +1347,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap index 6646443a09e65b..e0a1133e2b10c7 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index ca7dd727790bcc..fb6bcf3d62788d 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -1026,7 +1026,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1455,9 +1461,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap index e89d7311babe0a..cce6ae448e774e 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.matter b/examples/chef/devices/rootnode_onofflight_samplemei.matter index 85933c93474d4b..69ee3097aba335 100644 --- a/examples/chef/devices/rootnode_onofflight_samplemei.matter +++ b/examples/chef/devices/rootnode_onofflight_samplemei.matter @@ -1026,7 +1026,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1478,9 +1484,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.zap b/examples/chef/devices/rootnode_onofflight_samplemei.zap index 5b983849ca4f2f..83f44eebd1907d 100644 --- a/examples/chef/devices/rootnode_onofflight_samplemei.zap +++ b/examples/chef/devices/rootnode_onofflight_samplemei.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index e226808c56b944..da912ef77108a1 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -990,7 +990,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1419,9 +1425,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap index e2e1d77b241f90..801d9c4fd2de67 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index 0a7f8aabd6adc2..08003bcfe2384a 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -925,7 +925,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1354,9 +1360,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap index 24052570e77c22..66744fe2fc879e 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index dd1a2f16349f05..eb125b89e48971 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -882,7 +882,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1344,9 +1350,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap index 1b0028275e2b40..4ed304754c594f 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.matter b/examples/chef/devices/rootnode_pump_5f904818cc.matter index a5bd2bf03297bb..a28ab46f769944 100644 --- a/examples/chef/devices/rootnode_pump_5f904818cc.matter +++ b/examples/chef/devices/rootnode_pump_5f904818cc.matter @@ -648,6 +648,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute NetworkInterface networkInterfaces[] = 0; readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; readonly attribute boolean testEventTriggersEnabled = 8; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -661,7 +662,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ @@ -1176,14 +1183,17 @@ endpoint 0 { server cluster GeneralDiagnostics { callback attribute networkInterfaces; callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; callback attribute testEventTriggersEnabled default = false; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster AdministratorCommissioning { diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.zap b/examples/chef/devices/rootnode_pump_5f904818cc.zap index 131da70f467974..ca969c6222fabe 100644 --- a/examples/chef/devices/rootnode_pump_5f904818cc.zap +++ b/examples/chef/devices/rootnode_pump_5f904818cc.zap @@ -1511,6 +1511,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1546,6 +1562,22 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "TestEventTriggersEnabled", "code": 8, @@ -1636,7 +1668,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.matter b/examples/chef/devices/rootnode_pump_a811bb33a0.matter index 44e81fb472dc0c..ed9c708770e43f 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.matter +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.matter @@ -648,6 +648,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute NetworkInterface networkInterfaces[] = 0; readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; readonly attribute boolean testEventTriggersEnabled = 8; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -661,7 +662,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ @@ -1128,14 +1135,17 @@ endpoint 0 { server cluster GeneralDiagnostics { callback attribute networkInterfaces; callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; callback attribute testEventTriggersEnabled default = false; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster AdministratorCommissioning { diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.zap b/examples/chef/devices/rootnode_pump_a811bb33a0.zap index 49a4e51fd9a20e..c4ce099577de7a 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.zap +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.zap @@ -1511,6 +1511,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1546,6 +1562,22 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "TestEventTriggersEnabled", "code": 8, @@ -1636,7 +1668,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter index 745eb917c8b8bd..789ab736372331 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter @@ -631,7 +631,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1130,9 +1136,11 @@ endpoint 0 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster WiFiNetworkDiagnostics { diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap index 6d0189f25a769a..f63a0072d3fc7e 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap @@ -1786,6 +1786,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -2007,7 +2023,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter index a5a8b6afc1c7a0..b776749b7e2699 100644 --- a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter +++ b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter @@ -659,7 +659,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ @@ -1172,9 +1178,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster AdministratorCommissioning { diff --git a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap index dad96cd186033a..b12960c0ad7c65 100644 --- a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap +++ b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap @@ -1172,6 +1172,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1345,7 +1361,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter index 3f2fb5857276cc..6a2b4649a021c0 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter @@ -704,7 +704,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ @@ -1217,9 +1223,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster AdministratorCommissioning { diff --git a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap index 81b7dd94bb90f1..22078ba8f841f7 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap @@ -1172,6 +1172,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1345,7 +1361,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter index 1c026bb8c31c30..2742d918b4aa9d 100644 --- a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter +++ b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter @@ -891,7 +891,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ @@ -1348,9 +1354,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster AdministratorCommissioning { diff --git a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap index ac52e9a00e295e..9fdb65c8035573 100644 --- a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap +++ b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap @@ -1172,6 +1172,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1345,7 +1361,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index 5fc393ff48f607..c2a65154372e18 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -951,7 +951,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1380,9 +1386,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap index dd5e63a06d5bfd..28f47070e93356 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index 8eb9c77b6fc45e..7c3771e7222915 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -882,7 +882,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1324,9 +1330,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap index 28e1691e0d9387..e16ee3fcca8420 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index 73d5d7df7262a2..5e63942dde6df5 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -876,7 +876,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1573,9 +1579,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap index fc6192274b30ac..fbe5c0f9c50a56 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index 7a1f5a750e1747..7b2e347b0ed662 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -876,7 +876,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1449,9 +1455,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap index 981a417a84f735..0d68f07eccb7a1 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/devices/template.zap b/examples/chef/devices/template.zap index 0f7cf1a1d63a13..bf77da05ea3d05 100644 --- a/examples/chef/devices/template.zap +++ b/examples/chef/devices/template.zap @@ -1172,6 +1172,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1345,7 +1361,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chef/sample_app_util/test_files/sample_zap_file.zap b/examples/chef/sample_app_util/test_files/sample_zap_file.zap index eff6a00671d5b0..1359eea30b9791 100644 --- a/examples/chef/sample_app_util/test_files/sample_zap_file.zap +++ b/examples/chef/sample_app_util/test_files/sample_zap_file.zap @@ -1830,7 +1830,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter index 2d0308f0c81741..847c827d4fe086 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter @@ -863,7 +863,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1646,9 +1652,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap index 0fa6b11ed229eb..1a7ff846ae75a0 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap @@ -1683,6 +1683,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1856,7 +1872,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter index 1cac116c4efef6..fa10fd83dd7c77 100644 --- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter +++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter @@ -719,7 +719,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1270,9 +1276,11 @@ endpoint 0 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster WiFiNetworkDiagnostics { diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap b/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap index 35e670751458f5..be3add8ed70a6a 100644 --- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap +++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap @@ -1926,6 +1926,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -2147,7 +2163,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index f8962a2ac437d7..74028e4ef9f8ae 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -1177,7 +1177,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -2459,9 +2465,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.zap b/examples/light-switch-app/light-switch-common/light-switch-app.zap index a92321ae63ca0c..0e3857c0ef3747 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.zap +++ b/examples/light-switch-app/light-switch-common/light-switch-app.zap @@ -1601,6 +1601,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1774,7 +1790,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter index 8ab0257efa2b41..7a3be88505e300 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter @@ -1034,7 +1034,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1797,9 +1803,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap index 3fbf144422e576..964c28d2394697 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap @@ -1437,6 +1437,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1610,7 +1626,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter index f7bb7e5544d04e..3475808b741751 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter @@ -1034,7 +1034,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1929,9 +1935,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap index cb06c41a042700..01561c14d6dd33 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter index 98e9f875aebe99..c389aafb01efc5 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter @@ -1034,7 +1034,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1839,9 +1845,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap index c24ec8d3bc8eaf..b5a5f6165d0016 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index f39d6580d31f65..3ff6f8d4ede74f 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -1181,7 +1181,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -2255,9 +2261,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/lighting-app/lighting-common/lighting-app.zap b/examples/lighting-app/lighting-common/lighting-app.zap index c4f3572ec96857..1eb4d7a701f432 100644 --- a/examples/lighting-app/lighting-common/lighting-app.zap +++ b/examples/lighting-app/lighting-common/lighting-app.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.matter b/examples/lighting-app/nxp/zap/lighting-on-off.matter index 879cdadd19a22f..4ac1ee3eca2f63 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.matter +++ b/examples/lighting-app/nxp/zap/lighting-on-off.matter @@ -901,6 +901,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute NetworkInterface networkInterfaces[] = 0; readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; readonly attribute boolean testEventTriggersEnabled = 8; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -914,7 +915,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1442,11 +1449,14 @@ endpoint 0 { emits event BootReason; callback attribute networkInterfaces; callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.zap b/examples/lighting-app/nxp/zap/lighting-on-off.zap index 4da6db3bf6d93b..908dfc6bc2ac66 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.zap +++ b/examples/lighting-app/nxp/zap/lighting-on-off.zap @@ -1191,6 +1191,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1226,6 +1242,22 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "TestEventTriggersEnabled", "code": 8, @@ -1268,7 +1300,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/lighting-app/qpg/zap/light.matter b/examples/lighting-app/qpg/zap/light.matter index 7c055058372faf..d0f37c17c22356 100644 --- a/examples/lighting-app/qpg/zap/light.matter +++ b/examples/lighting-app/qpg/zap/light.matter @@ -975,7 +975,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1877,9 +1883,11 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/lighting-app/qpg/zap/light.zap b/examples/lighting-app/qpg/zap/light.zap index ffd306791f7f40..a3b56ebb02d1cb 100644 --- a/examples/lighting-app/qpg/zap/light.zap +++ b/examples/lighting-app/qpg/zap/light.zap @@ -1715,6 +1715,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1936,7 +1952,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter index 31c6acf21d6c38..551342811a2428 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -1438,7 +1438,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -2308,9 +2314,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap index 00e4fc3dc68664..f9bedf8f98ceee 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap @@ -1497,6 +1497,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1670,7 +1686,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter index 293faf071dbb16..404029c1978ca1 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -1417,7 +1417,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -2198,9 +2204,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap b/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap index 76f4fde26b1b09..9fdd90c26099db 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap @@ -1497,6 +1497,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1670,7 +1686,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index b3f6f1c74593a3..ea7d73c4282cb2 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -1100,7 +1100,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -2516,9 +2522,11 @@ endpoint 0 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/lock-app/lock-common/lock-app.zap b/examples/lock-app/lock-common/lock-app.zap index e079f41ed81adf..5dddf5b3075d14 100644 --- a/examples/lock-app/lock-common/lock-app.zap +++ b/examples/lock-app/lock-common/lock-app.zap @@ -2284,6 +2284,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -2521,7 +2537,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/lock-app/nxp/zap/lock-app.matter b/examples/lock-app/nxp/zap/lock-app.matter index 9b030c237fb074..9481cb27c858d3 100644 --- a/examples/lock-app/nxp/zap/lock-app.matter +++ b/examples/lock-app/nxp/zap/lock-app.matter @@ -519,6 +519,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute NetworkInterface networkInterfaces[] = 0; readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; readonly attribute boolean testEventTriggersEnabled = 8; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -532,7 +533,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1515,11 +1522,14 @@ endpoint 0 { emits event BootReason; callback attribute networkInterfaces; callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/lock-app/nxp/zap/lock-app.zap b/examples/lock-app/nxp/zap/lock-app.zap index 103c17087eccfd..8e015b083248cb 100644 --- a/examples/lock-app/nxp/zap/lock-app.zap +++ b/examples/lock-app/nxp/zap/lock-app.zap @@ -984,6 +984,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1019,6 +1035,22 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "TestEventTriggersEnabled", "code": 8, @@ -1061,7 +1093,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/lock-app/qpg/zap/lock.matter b/examples/lock-app/qpg/zap/lock.matter index 5b67875cce9279..573fbe867361c6 100644 --- a/examples/lock-app/qpg/zap/lock.matter +++ b/examples/lock-app/qpg/zap/lock.matter @@ -808,7 +808,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1911,9 +1917,11 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/lock-app/qpg/zap/lock.zap b/examples/lock-app/qpg/zap/lock.zap index e66ddc5a32eac5..c60d090151a3b7 100644 --- a/examples/lock-app/qpg/zap/lock.zap +++ b/examples/lock-app/qpg/zap/lock.zap @@ -1715,6 +1715,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1936,7 +1952,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter index e5187ffa74eefb..fe849962ec5103 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter @@ -706,7 +706,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ @@ -1110,9 +1116,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster AdministratorCommissioning { diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap b/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap index 3776092d0b62dd..d445d8a2694769 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap @@ -1442,6 +1442,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1615,7 +1631,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter index 583331cd2a86ee..8b95001f4e391b 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter @@ -889,7 +889,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ @@ -1293,9 +1299,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster AdministratorCommissioning { diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap index e36f3b95848231..f2eae5d5381cfc 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap @@ -1491,6 +1491,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1664,7 +1680,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 1040513cc7c557..8daed1603f891c 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -1683,7 +1683,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -6734,9 +6740,11 @@ endpoint 0 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/placeholder/linux/apps/app1/config.zap b/examples/placeholder/linux/apps/app1/config.zap index c1166d993338fd..6bb34d3306eac0 100644 --- a/examples/placeholder/linux/apps/app1/config.zap +++ b/examples/placeholder/linux/apps/app1/config.zap @@ -2599,6 +2599,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -2836,7 +2852,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index a2662b804165b9..654c6f2fec41de 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -1642,7 +1642,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -6694,9 +6700,11 @@ endpoint 0 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/placeholder/linux/apps/app2/config.zap b/examples/placeholder/linux/apps/app2/config.zap index 88191b28ef9110..3f19bedb04a28a 100644 --- a/examples/placeholder/linux/apps/app2/config.zap +++ b/examples/placeholder/linux/apps/app2/config.zap @@ -2615,6 +2615,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -2852,7 +2868,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index 97ece6ceda452c..b95b685b2b753e 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -831,6 +831,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute NetworkInterface networkInterfaces[] = 0; readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; readonly attribute boolean testEventTriggersEnabled = 8; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -844,7 +845,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ @@ -1535,14 +1542,17 @@ endpoint 0 { emits event BootReason; callback attribute networkInterfaces; callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; callback attribute testEventTriggersEnabled default = false; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster ThreadNetworkDiagnostics { diff --git a/examples/pump-app/pump-common/pump-app.zap b/examples/pump-app/pump-common/pump-app.zap index 6e21cc9d3de2cf..73b79af6674e30 100644 --- a/examples/pump-app/pump-common/pump-app.zap +++ b/examples/pump-app/pump-common/pump-app.zap @@ -1575,6 +1575,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1610,6 +1626,22 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "TestEventTriggersEnabled", "code": 8, @@ -1700,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/pump-app/silabs/data_model/pump-thread-app.matter b/examples/pump-app/silabs/data_model/pump-thread-app.matter index 8112f63eebb16f..0bdb0955fef1bb 100644 --- a/examples/pump-app/silabs/data_model/pump-thread-app.matter +++ b/examples/pump-app/silabs/data_model/pump-thread-app.matter @@ -831,6 +831,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute NetworkInterface networkInterfaces[] = 0; readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; readonly attribute boolean testEventTriggersEnabled = 8; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -844,7 +845,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ @@ -1535,14 +1542,17 @@ endpoint 0 { emits event BootReason; callback attribute networkInterfaces; callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; callback attribute testEventTriggersEnabled default = false; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster ThreadNetworkDiagnostics { diff --git a/examples/pump-app/silabs/data_model/pump-thread-app.zap b/examples/pump-app/silabs/data_model/pump-thread-app.zap index 30e326a3bf068c..bd3569bc9c42f9 100644 --- a/examples/pump-app/silabs/data_model/pump-thread-app.zap +++ b/examples/pump-app/silabs/data_model/pump-thread-app.zap @@ -1575,6 +1575,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1610,6 +1626,22 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "TestEventTriggersEnabled", "code": 8, @@ -1700,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/pump-app/silabs/data_model/pump-wifi-app.matter b/examples/pump-app/silabs/data_model/pump-wifi-app.matter index 8112f63eebb16f..0bdb0955fef1bb 100644 --- a/examples/pump-app/silabs/data_model/pump-wifi-app.matter +++ b/examples/pump-app/silabs/data_model/pump-wifi-app.matter @@ -831,6 +831,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute NetworkInterface networkInterfaces[] = 0; readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; readonly attribute boolean testEventTriggersEnabled = 8; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -844,7 +845,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ @@ -1535,14 +1542,17 @@ endpoint 0 { emits event BootReason; callback attribute networkInterfaces; callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; callback attribute testEventTriggersEnabled default = false; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster ThreadNetworkDiagnostics { diff --git a/examples/pump-app/silabs/data_model/pump-wifi-app.zap b/examples/pump-app/silabs/data_model/pump-wifi-app.zap index 30e326a3bf068c..bd3569bc9c42f9 100644 --- a/examples/pump-app/silabs/data_model/pump-wifi-app.zap +++ b/examples/pump-app/silabs/data_model/pump-wifi-app.zap @@ -1575,6 +1575,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1610,6 +1626,22 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "TestEventTriggersEnabled", "code": 8, @@ -1700,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter index fd542a29b72f78..a5a9759bf9ae54 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter @@ -756,6 +756,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute NetworkInterface networkInterfaces[] = 0; readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; readonly attribute boolean testEventTriggersEnabled = 8; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -769,7 +770,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ @@ -1421,14 +1428,17 @@ endpoint 0 { emits event BootReason; callback attribute networkInterfaces; callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; callback attribute testEventTriggersEnabled default = false; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster ThreadNetworkDiagnostics { diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap b/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap index cb7f4b298c5fbb..0d687d1f4d446c 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap @@ -1575,6 +1575,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1610,6 +1626,22 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "TestEventTriggersEnabled", "code": 8, @@ -1700,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter index d9bc12cf315e95..dbbe4fc7142fdc 100644 --- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter @@ -586,7 +586,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1075,9 +1081,11 @@ endpoint 0 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster WiFiNetworkDiagnostics { diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap b/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap index b772acad198770..3d554d6d8ca5ad 100644 --- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap @@ -1694,6 +1694,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1915,7 +1931,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter index e8ad6f4689e6d9..4bf471ffc11107 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter +++ b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter @@ -863,7 +863,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1815,9 +1821,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap index f9ec6ae993d322..a55f8b6f4abe87 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap +++ b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap @@ -1683,6 +1683,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1856,7 +1872,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/rvc-app/rvc-common/rvc-app.matter b/examples/rvc-app/rvc-common/rvc-app.matter index 4822febc1d0239..9be857b09ec61b 100644 --- a/examples/rvc-app/rvc-common/rvc-app.matter +++ b/examples/rvc-app/rvc-common/rvc-app.matter @@ -590,7 +590,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ @@ -1100,9 +1106,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster AdministratorCommissioning { diff --git a/examples/rvc-app/rvc-common/rvc-app.zap b/examples/rvc-app/rvc-common/rvc-app.zap index a9f67c56bd7bc8..e5f9e297ad0b19 100644 --- a/examples/rvc-app/rvc-common/rvc-app.zap +++ b/examples/rvc-app/rvc-common/rvc-app.zap @@ -1172,6 +1172,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1345,7 +1361,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter index 48642e7abbf947..b8fcae541ac10c 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter @@ -1095,7 +1095,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1871,9 +1877,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap index b5fe6c12387788..2507ad7cba4c4b 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap @@ -1481,6 +1481,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1654,7 +1670,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter index 187f8d14112801..2f492c5c2b031d 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter @@ -617,7 +617,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1171,9 +1177,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap index 7845ed393315aa..1b4d5b5e83b16f 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap @@ -1386,6 +1386,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1559,7 +1575,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter index a581f1f70d285d..6c00996c41eaca 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter @@ -1264,7 +1264,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ @@ -1941,9 +1947,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster ThreadNetworkDiagnostics { diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.zap b/examples/thermostat/nxp/zap/thermostat_matter_thread.zap index ec8baf4d992228..1db8b2b288b77f 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.zap +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.zap @@ -1626,6 +1626,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1799,7 +1815,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter index ede88c2f5677f3..7123a0dadf1874 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter @@ -1264,7 +1264,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1850,9 +1856,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster WiFiNetworkDiagnostics { diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap b/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap index fcc14df85255d3..7a3e1ffbb356ba 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap @@ -1626,6 +1626,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1799,7 +1815,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index be2a7be5dacc50..d5ed36f49349b8 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -954,7 +954,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1799,9 +1805,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/thermostat/thermostat-common/thermostat.zap b/examples/thermostat/thermostat-common/thermostat.zap index 74262e2093f6b1..d22c446eb23fac 100644 --- a/examples/thermostat/thermostat-common/thermostat.zap +++ b/examples/thermostat/thermostat-common/thermostat.zap @@ -1727,6 +1727,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1900,7 +1916,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index 5d7764d71f36c8..f33bd7a4b364a1 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -1109,7 +1109,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -2601,9 +2607,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap index 58a0b469101460..08def3fad76094 100644 --- a/examples/tv-app/tv-common/tv-app.zap +++ b/examples/tv-app/tv-common/tv-app.zap @@ -1754,6 +1754,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1927,7 +1943,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index a98c4dbf1b207e..88b8b3574f7f48 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -950,7 +950,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -2129,9 +2135,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap index b231ccb0ec904f..d55da66fab0eba 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap @@ -1400,6 +1400,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1573,7 +1589,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter index 0c56f79c581271..41a46c5c47d3ac 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter @@ -1244,7 +1244,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -2660,9 +2666,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap b/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap index ea5776de0b3587..d60d0e3de7f852 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap @@ -1552,6 +1552,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1725,7 +1741,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index f997baf66cfc98..6b5f06125fcf6e 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -1084,7 +1084,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -2000,9 +2006,11 @@ endpoint 0 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/window-app/common/window-app.zap b/examples/window-app/common/window-app.zap index a5dcb3b1a3bc2e..3ac0170b1683e6 100644 --- a/examples/window-app/common/window-app.zap +++ b/examples/window-app/common/window-app.zap @@ -2303,6 +2303,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -2540,7 +2556,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp index 994104abf22a75..0ea54f2e2c96b6 100644 --- a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp +++ b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp @@ -384,6 +384,15 @@ bool emberAfGeneralDiagnosticsClusterTestEventTriggerCallback(CommandHandler * c return true; } +bool emberAfGeneralDiagnosticsClusterTimeSnapshotCallback(CommandHandler * commandObj, ConcreteCommandPath const & commandPath, + Commands::TimeSnapshot::DecodableType const & commandData) +{ + // TODO(#30096): Command needs to be implemented. + ChipLogError(Zcl, "TimeSnapshot not yet supported!"); + commandObj->AddStatus(commandPath, Status::InvalidCommand); + return true; +} + void MatterGeneralDiagnosticsPluginServerInitCallback() { BootReasonEnum bootReason; diff --git a/src/app/tests/suites/certification/Test_TC_DGGEN_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DGGEN_1_1.yaml index 1fdcfce09d47ee..147242c5db841e 100644 --- a/src/app/tests/suites/certification/Test_TC_DGGEN_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DGGEN_1_1.yaml @@ -35,7 +35,7 @@ tests: command: "readAttribute" attribute: "ClusterRevision" response: - value: 1 + value: 2 constraints: type: int16u @@ -65,8 +65,9 @@ tests: type: list contains: [0, 1, 8, 65528, 65529, 65531, 65532, 65533] - - label: "Step 4b: Read optional attribute(UpTime) in AttributeList" - PICS: DGGEN.S.A0002 + - label: + "Step 4b: Validate presence of mandatory attribute(UpTime) in + AttributeList" command: "readAttribute" attribute: "AttributeList" response: @@ -168,12 +169,12 @@ tests: response: constraints: type: list - contains: [0] + contains: [0, 1] - label: "Step 7: TH reads GeneratedCommandList from DUT" command: "readAttribute" attribute: "GeneratedCommandList" response: - value: [] + value: [2] constraints: type: list diff --git a/src/app/tests/suites/certification/Test_TC_DGGEN_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DGGEN_2_1.yaml index 22a222055e689f..5b4e7a489a613f 100644 --- a/src/app/tests/suites/certification/Test_TC_DGGEN_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DGGEN_2_1.yaml @@ -183,7 +183,6 @@ tests: - label: "Step 4a: TH reads the Uptime attribute value of DUT. Store the value in uptime1" - PICS: DGGEN.S.A0002 command: "readAttribute" attribute: "UpTime" response: @@ -192,7 +191,6 @@ tests: type: int64u - label: "Wait 10 seconds" - PICS: DGGEN.S.A0002 cluster: "DelayCommands" command: "WaitForMs" arguments: @@ -203,7 +201,6 @@ tests: - label: "Step 4b: TH reads a Uptime attribute value of DUT. Store the value in uptime2. Verify that uptime2 is greater than uptime1." - PICS: DGGEN.S.A0002 command: "readAttribute" attribute: "UpTime" response: @@ -241,7 +238,6 @@ tests: - label: "Step 4c: TH reads a Uptime attribute value of DUT. Store the value in uptime3. Verify that uptime3 is lesser than uptime2." - PICS: DGGEN.S.A0003 command: "readAttribute" attribute: "UpTime" response: diff --git a/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml index 4e0e9b5cafdfe2..0a3c0f12ffd783 100644 --- a/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml @@ -38,7 +38,7 @@ limitations under the License. - + @@ -56,7 +56,7 @@ limitations under the License. - + @@ -67,15 +67,15 @@ limitations under the License. - - - - + + + + - - - - + + + + General @@ -83,8 +83,9 @@ limitations under the License. 0x0033 GENERAL_DIAGNOSTICS_CLUSTER The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. - NetworkInterfaces + NetworkInterfaces RebootCount + UpTime TotalOperationalHours BootReason @@ -92,6 +93,7 @@ limitations under the License. ActiveRadioFaults ActiveNetworkFaults TestEventTriggersEnabled + AverageWearCount @@ -101,6 +103,16 @@ limitations under the License. + + Take a snapshot of system time and epoch time. + + + + Response for the TimeSnapshot command. + + + + Indicate a change in the set of hardware faults currently detected by the Node. diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index d5b1691dc9eb9f..41a318647f425d 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -1795,8 +1795,15 @@ client cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + /** Provide a means for certification tests to trigger some test-plan-specific events */ command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + /** Take a snapshot of system time and epoch time. */ + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 62c12f62001130..006c23aaf1d582 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -6062,8 +6062,23 @@ public void testEventTrigger(DefaultClusterCallback callback, byte[] enableKey, testEventTrigger(chipClusterPtr, callback, enableKey, eventTrigger, timedInvokeTimeoutMs); } + public void timeSnapshot(TimeSnapshotResponseCallback callback) { + timeSnapshot(chipClusterPtr, callback, null); + } + + public void timeSnapshot(TimeSnapshotResponseCallback callback, int timedInvokeTimeoutMs) { + timeSnapshot(chipClusterPtr, callback, timedInvokeTimeoutMs); + } + private native void testEventTrigger(long chipClusterPtr, DefaultClusterCallback callback, byte[] enableKey, Long eventTrigger, @Nullable Integer timedInvokeTimeoutMs); + private native void timeSnapshot(long chipClusterPtr, TimeSnapshotResponseCallback callback, @Nullable Integer timedInvokeTimeoutMs); + + public interface TimeSnapshotResponseCallback { + void onSuccess(Long systemTimeUs, @Nullable Long UTCTimeUs); + void onError(Exception error); + } + public interface NetworkInterfacesAttributeCallback { void onSuccess(List value); void onError(Exception ex); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index 413541bdf799b4..99fa62cef2d0c1 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -3800,7 +3800,8 @@ public static Event value(long id) throws NoSuchFieldError { } public enum Command { - TestEventTrigger(0L),; + TestEventTrigger(0L), + TimeSnapshot(1L),; private final long id; Command(long id) { this.id = id; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index a051e4d5b071b8..78cce7dc99f04d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -3638,6 +3638,30 @@ public void onError(Exception ex) { } } + + public static class DelegatedGeneralDiagnosticsClusterTimeSnapshotResponseCallback implements ChipClusters.GeneralDiagnosticsCluster.TimeSnapshotResponseCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(Long systemTimeUs, @Nullable Long UTCTimeUs) { + Map responseValues = new LinkedHashMap<>(); + + CommandResponseInfo systemTimeUsResponseValue = new CommandResponseInfo("systemTimeUs", "Long"); + responseValues.put(systemTimeUsResponseValue, systemTimeUs); + CommandResponseInfo UTCTimeUsResponseValue = new CommandResponseInfo("UTCTimeUs", "Long"); + responseValues.put(UTCTimeUsResponseValue, UTCTimeUs); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } public static class DelegatedGeneralDiagnosticsClusterNetworkInterfacesAttributeCallback implements ChipClusters.GeneralDiagnosticsCluster.NetworkInterfacesAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -18933,6 +18957,18 @@ public Map> getCommandMap() { ); generalDiagnosticsClusterInteractionInfoMap.put("testEventTrigger", generalDiagnosticstestEventTriggerInteractionInfo); + Map generalDiagnosticstimeSnapshotCommandParams = new LinkedHashMap(); + InteractionInfo generalDiagnosticstimeSnapshotInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GeneralDiagnosticsCluster) cluster) + .timeSnapshot((ChipClusters.GeneralDiagnosticsCluster.TimeSnapshotResponseCallback) callback + ); + }, + () -> new DelegatedGeneralDiagnosticsClusterTimeSnapshotResponseCallback(), + generalDiagnosticstimeSnapshotCommandParams + ); + generalDiagnosticsClusterInteractionInfoMap.put("timeSnapshot", generalDiagnosticstimeSnapshotInteractionInfo); + commandMap.put("generalDiagnostics", generalDiagnosticsClusterInteractionInfoMap); Map softwareDiagnosticsClusterInteractionInfoMap = new LinkedHashMap<>(); diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index f2a81f98fc819b..6c7d8b46e8a37d 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -2202,6 +2202,81 @@ void CHIPDiagnosticLogsClusterRetrieveLogsResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, Status, LogContent, UTCTimeStamp, TimeSinceBoot); } +CHIPGeneralDiagnosticsClusterTimeSnapshotResponseCallback::CHIPGeneralDiagnosticsClusterTimeSnapshotResponseCallback( + jobject javaCallback) : Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = 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"); + } +} + +CHIPGeneralDiagnosticsClusterTimeSnapshotResponseCallback::~CHIPGeneralDiagnosticsClusterTimeSnapshotResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPGeneralDiagnosticsClusterTimeSnapshotResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshotResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Long;Ljava/lang/Long;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject SystemTimeUs; + std::string SystemTimeUsClassName = "java/lang/Long"; + std::string SystemTimeUsCtorSignature = "(J)V"; + jlong jniSystemTimeUs = static_cast(dataResponse.systemTimeUs); + chip::JniReferences::GetInstance().CreateBoxedObject(SystemTimeUsClassName.c_str(), SystemTimeUsCtorSignature.c_str(), + jniSystemTimeUs, SystemTimeUs); + jobject UTCTimeUs; + if (dataResponse.UTCTimeUs.IsNull()) + { + UTCTimeUs = nullptr; + } + else + { + std::string UTCTimeUsClassName = "java/lang/Long"; + std::string UTCTimeUsCtorSignature = "(J)V"; + jlong jniUTCTimeUs = static_cast(dataResponse.UTCTimeUs.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(UTCTimeUsClassName.c_str(), UTCTimeUsCtorSignature.c_str(), + jniUTCTimeUs, UTCTimeUs); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, SystemTimeUs, UTCTimeUs); +} CHIPTimeSynchronizationClusterSetTimeZoneResponseCallback::CHIPTimeSynchronizationClusterSetTimeZoneResponseCallback( jobject javaCallback) : Callback::Callback(CallbackFn, this) { diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h index 4bb4afe2fe72ba..c6afa9916c41fa 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h @@ -342,6 +342,21 @@ class CHIPDiagnosticLogsClusterRetrieveLogsResponseCallback jobject javaCallbackRef; }; +class CHIPGeneralDiagnosticsClusterTimeSnapshotResponseCallback + : public Callback::Callback +{ +public: + CHIPGeneralDiagnosticsClusterTimeSnapshotResponseCallback(jobject javaCallback); + + ~CHIPGeneralDiagnosticsClusterTimeSnapshotResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshotResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + class CHIPTimeSynchronizationClusterSetTimeZoneResponseCallback : public Callback::Callback { diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index efa9adc53cfdab..ea04b2c6cf583d 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -2397,6 +2397,12 @@ class ChipClusters: "eventTrigger": "int", }, }, + 0x00000001: { + "commandId": 0x00000001, + "commandName": "TimeSnapshot", + "args": { + }, + }, }, "attributes": { 0x00000000: { diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 38c92ee15ed234..cffb2a70cb56a6 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -8346,6 +8346,37 @@ def descriptor(cls) -> ClusterObjectDescriptor: enableKey: 'bytes' = b"" eventTrigger: 'uint' = 0 + @dataclass + class TimeSnapshot(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000033 + command_id: typing.ClassVar[int] = 0x00000001 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'TimeSnapshotResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class TimeSnapshotResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000033 + command_id: typing.ClassVar[int] = 0x00000002 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="systemTimeUs", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="UTCTimeUs", Tag=1, Type=typing.Union[Nullable, uint]), + ]) + + systemTimeUs: 'uint' = 0 + UTCTimeUs: 'typing.Union[Nullable, uint]' = NullValue + class Attributes: @dataclass class NetworkInterfaces(ClusterAttributeDescriptor): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 7a6c820b64fc67..9a05da483a248f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -2619,6 +2619,14 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) * Provide a means for certification tests to trigger some test-plan-specific events */ - (void)testEventTriggerWithParams:(MTRGeneralDiagnosticsClusterTestEventTriggerParams *)params completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +/** + * Command TimeSnapshot + * + * Take a snapshot of system time and epoch time. + */ +- (void)timeSnapshotWithParams:(MTRGeneralDiagnosticsClusterTimeSnapshotParams * _Nullable)params completion:(void (^)(MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)timeSnapshotWithCompletion:(void (^)(MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams * _Nullable data, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; - (void)readAttributeNetworkInterfacesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)subscribeAttributeNetworkInterfacesWithParams:(MTRSubscribeParams *)params diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index ec55b1beca255a..4e04fc5f85c6f5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -22057,6 +22057,34 @@ - (void)testEventTriggerWithParams:(MTRGeneralDiagnosticsClusterTestEventTrigger queue:self.callbackQueue completion:responseHandler]; } +- (void)timeSnapshotWithCompletion:(void (^)(MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + [self timeSnapshotWithParams:nil completion:completion]; +} +- (void)timeSnapshotWithParams:(MTRGeneralDiagnosticsClusterTimeSnapshotParams * _Nullable)params completion:(void (^)(MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRGeneralDiagnosticsClusterTimeSnapshotParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = GeneralDiagnostics::Commands::TimeSnapshot::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)readAttributeNetworkInterfacesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index c42739771e0925..a0320b33fd3b36 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -5792,6 +5792,8 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { // Cluster GeneralDiagnostics commands MTRCommandIDTypeClusterGeneralDiagnosticsCommandTestEventTriggerID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000000, + MTRCommandIDTypeClusterGeneralDiagnosticsCommandTimeSnapshotID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRCommandIDTypeClusterGeneralDiagnosticsCommandTimeSnapshotResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, // Cluster SoftwareDiagnostics deprecated command id names MTRClusterSoftwareDiagnosticsCommandResetWatermarksID diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index bbc0a86180ec83..c3c7c512f33813 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -1323,6 +1323,9 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, readonly) MTRDevice * device MTR_NEWLY_AVAILABLE; - (void)testEventTriggerWithParams:(MTRGeneralDiagnosticsClusterTestEventTriggerParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +- (void)timeSnapshotWithParams:(MTRGeneralDiagnosticsClusterTimeSnapshotParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)timeSnapshotWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams * _Nullable data, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary * _Nullable)readAttributeNetworkInterfacesWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 9650aaf7d0e7a6..ae12459f547741 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -4440,6 +4440,37 @@ - (void)testEventTriggerWithParams:(MTRGeneralDiagnosticsClusterTestEventTrigger completion:responseHandler]; } +- (void)timeSnapshotWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(void (^)(MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + [self timeSnapshotWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)timeSnapshotWithParams:(MTRGeneralDiagnosticsClusterTimeSnapshotParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRGeneralDiagnosticsClusterTimeSnapshotParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = GeneralDiagnostics::Commands::TimeSnapshot::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} + - (NSDictionary * _Nullable)readAttributeNetworkInterfacesWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeGeneralDiagnosticsID) attributeID:@(MTRAttributeIDTypeClusterGeneralDiagnosticsAttributeNetworkInterfacesID) params:params]; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 3f1e00bc19794b..6a2bb522b42aad 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -3250,6 +3250,55 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRGeneralDiagnosticsClusterTimeSnapshotParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull systemTimeUs MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable utcTimeUs MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRSoftwareDiagnosticsClusterResetWatermarksParams : NSObject /** diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 6ffbc9daaa07ae..386d6e02f5799d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -8529,6 +8529,168 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end +@implementation MTRGeneralDiagnosticsClusterTimeSnapshotParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRGeneralDiagnosticsClusterTimeSnapshotParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end + +@implementation MTRGeneralDiagnosticsClusterTimeSnapshotParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshot::Type encodableStruct; + ListFreer listFreer; + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _systemTimeUs = @(0); + + _utcTimeUs = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams alloc] init]; + + other.systemTimeUs = self.systemTimeUs; + other.utcTimeUs = self.utcTimeUs; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: systemTimeUs:%@; utcTimeUs:%@; >", NSStringFromClass([self class]), _systemTimeUs, _utcTimeUs]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshotResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshotResponse::DecodableType &)decodableStruct +{ + { + self.systemTimeUs = [NSNumber numberWithUnsignedLongLong:decodableStruct.systemTimeUs]; + } + { + if (decodableStruct.UTCTimeUs.IsNull()) { + self.utcTimeUs = nil; + } else { + self.utcTimeUs = [NSNumber numberWithUnsignedLongLong:decodableStruct.UTCTimeUs.Value()]; + } + } + return CHIP_NO_ERROR; +} + +@end + @implementation MTRSoftwareDiagnosticsClusterResetWatermarksParams - (instancetype)init { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index c00abea960dec0..cc23f560d8fee7 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -514,6 +514,18 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRGeneralDiagnosticsClusterTimeSnapshotParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshotResponse::DecodableType &)decodableStruct; + +@end + @interface MTRSoftwareDiagnosticsClusterResetWatermarksParams (InternalMethods) - (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 9b692fb362815b..e684a60678084e 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -8659,6 +8659,12 @@ bool emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback( bool emberAfGeneralDiagnosticsClusterTestEventTriggerCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::DecodableType & commandData); +/** + * @brief General Diagnostics Cluster TimeSnapshot Command callback (from client) + */ +bool emberAfGeneralDiagnosticsClusterTimeSnapshotCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshot::DecodableType & commandData); /** * @brief Software Diagnostics Cluster ResetWatermarks Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 139fc46ed756bf..c094c10b39790b 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -6457,6 +6457,65 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } } // namespace TestEventTrigger. +namespace TimeSnapshot { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + } +} +} // namespace TimeSnapshot. +namespace TimeSnapshotResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kSystemTimeUs), systemTimeUs); + encoder.Encode(to_underlying(Fields::kUTCTimeUs), UTCTimeUs); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kSystemTimeUs)) + { + err = DataModel::Decode(reader, systemTimeUs); + } + else if (__context_tag == to_underlying(Fields::kUTCTimeUs)) + { + err = DataModel::Decode(reader, UTCTimeUs); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace TimeSnapshotResponse. } // namespace Commands namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index ca8a7867870c28..ae63fcf4a89d02 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -8176,6 +8176,16 @@ struct Type; struct DecodableType; } // namespace TestEventTrigger +namespace TimeSnapshot { +struct Type; +struct DecodableType; +} // namespace TimeSnapshot + +namespace TimeSnapshotResponse { +struct Type; +struct DecodableType; +} // namespace TimeSnapshotResponse + } // namespace Commands namespace Commands { @@ -8214,6 +8224,69 @@ struct DecodableType CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace TestEventTrigger +namespace TimeSnapshot { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::TimeSnapshot::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = Clusters::GeneralDiagnostics::Commands::TimeSnapshotResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::TimeSnapshot::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace TimeSnapshot +namespace TimeSnapshotResponse { +enum class Fields : uint8_t +{ + kSystemTimeUs = 0, + kUTCTimeUs = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::TimeSnapshotResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } + + uint64_t systemTimeUs = static_cast(0); + DataModel::Nullable UTCTimeUs; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::TimeSnapshotResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } + + uint64_t systemTimeUs = static_cast(0); + DataModel::Nullable UTCTimeUs; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace TimeSnapshotResponse } // namespace Commands namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index 2b957cf72375ed..299da9e744f32c 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -434,6 +434,14 @@ namespace TestEventTrigger { static constexpr CommandId Id = 0x00000000; } // namespace TestEventTrigger +namespace TimeSnapshot { +static constexpr CommandId Id = 0x00000001; +} // namespace TimeSnapshot + +namespace TimeSnapshotResponse { +static constexpr CommandId Id = 0x00000002; +} // namespace TimeSnapshotResponse + } // namespace Commands } // namespace GeneralDiagnostics diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index f65b3063fba7bd..ad1bbc556ee196 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -3053,6 +3053,7 @@ class DiagnosticLogsRetrieveLogsRequest : public ClusterCommand |------------------------------------------------------------------------------| | Commands: | | | * TestEventTrigger | 0x00 | +| * TimeSnapshot | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | | * NetworkInterfaces | 0x0000 | @@ -3118,6 +3119,43 @@ class GeneralDiagnosticsTestEventTrigger : public ClusterCommand chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type mRequest; }; +/* + * Command TimeSnapshot + */ +class GeneralDiagnosticsTimeSnapshot : public ClusterCommand +{ +public: + GeneralDiagnosticsTimeSnapshot(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("time-snapshot", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::GeneralDiagnostics::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshot::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::GeneralDiagnostics::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshot::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshot::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster SoftwareDiagnostics | 0x0034 | |------------------------------------------------------------------------------| @@ -13365,6 +13403,7 @@ void registerClusterGeneralDiagnostics(Commands & commands, CredentialIssuerComm // make_unique(Id, credsIssuerConfig), // make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // 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 f26ae6d1c32025..a97925574bf5ac 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -4625,6 +4625,15 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const GeneralDiagnostics::Commands::TimeSnapshotResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("systemTimeUs", indent + 1, value.systemTimeUs)); + ReturnErrorOnFailure(DataModelLogger::LogValue("UTCTimeUs", indent + 1, value.UTCTimeUs)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const TimeSynchronization::Commands::SetTimeZoneResponse::DecodableType & value) { @@ -13711,6 +13720,17 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa } break; } + case GeneralDiagnostics::Id: { + switch (path.mCommandId) + { + case GeneralDiagnostics::Commands::TimeSnapshotResponse::Id: { + GeneralDiagnostics::Commands::TimeSnapshotResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("TimeSnapshotResponse", 1, value); + } + } + break; + } case TimeSynchronization::Id: { switch (path.mCommandId) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index 96f8b52b007164..6d2ccf1c0fbc68 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -460,6 +460,8 @@ LogValue(const char * label, size_t indent, const chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetworkResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshotResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::TimeSynchronization::Commands::SetTimeZoneResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, 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 519a27da8c68ba..07f482a5ab89b7 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -27930,6 +27930,7 @@ class SubscribeAttributeDiagnosticLogsClusterRevision : public SubscribeAttribut |------------------------------------------------------------------------------| | Commands: | | | * TestEventTrigger | 0x00 | +| * TimeSnapshot | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | | * NetworkInterfaces | 0x0000 | @@ -28005,6 +28006,56 @@ class GeneralDiagnosticsTestEventTrigger : public ClusterCommand { chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type mRequest; }; +/* + * Command TimeSnapshot + */ +class GeneralDiagnosticsTimeSnapshot : public ClusterCommand { +public: + GeneralDiagnosticsTimeSnapshot() + : ClusterCommand("time-snapshot") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::GeneralDiagnostics::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshot::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRGeneralDiagnosticsClusterTimeSnapshotParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster timeSnapshotWithParams:params completion: + ^(MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshotResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshotResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + /* * Attribute NetworkInterfaces */ @@ -154577,6 +154628,7 @@ void registerClusterGeneralDiagnostics(Commands & commands) commands_list clusterCommands = { make_unique(Id), // make_unique(), // + make_unique(), // make_unique(Id), // make_unique(Id), // make_unique(Id), // diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index fe9d1ee034da7c..3c845e5215856e 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -49324,12 +49324,8 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { err = TestStep4aReadTheGlobalAttributeAttributeList_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Step 4b: Read optional attribute(UpTime) in AttributeList\n"); - if (ShouldSkip("DGGEN.S.A0002")) { - NextTest(); - return; - } - err = TestStep4bReadOptionalAttributeUpTimeInAttributeList_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 4b: Validate presence of mandatory attribute(UpTime) in AttributeList\n"); + err = TestStep4bValidatePresenceOfMandatoryAttributeUpTimeInAttributeList_5(); break; case 6: ChipLogProgress(chipTool, " ***** Test Step 6 : Step 4c: Read optional attribute(TotalOperationalHours) in AttributeList\n"); @@ -49512,7 +49508,7 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 2U)); } VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); @@ -49603,7 +49599,7 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4bReadOptionalAttributeUpTimeInAttributeList_5() + CHIP_ERROR TestStep4bValidatePresenceOfMandatoryAttributeUpTimeInAttributeList_5() { MTRBaseDevice * device = GetDevice("alpha"); @@ -49611,7 +49607,7 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4b: Read optional attribute(UpTime) in AttributeList Error: %@", err); + NSLog(@"Step 4b: Validate presence of mandatory attribute(UpTime) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -49743,6 +49739,7 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); NextTest(); }]; @@ -49764,7 +49761,8 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 2UL)); } VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); From fe513bbf0d3624be3f7c1f86bee55210e5418196 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 31 Oct 2023 11:12:35 -0400 Subject: [PATCH 04/12] Update ZAP to fix handling of Darwin provisional availability. (#30101) * Update ZAP to fix handling of Darwin provisional availability. The template change is fixing a place where we checked for "provisional" even for things that are not supported at all, and they started coming back as "provisional" now. MIN_ZAP_VERSION is being set to the date the commit was merged (which is what we are getting in the reported ZAP version), not to the tag date, which is later. * Auto-update .zap files. * Regenerate generated code. --- .../air-purifier-common/air-purifier-app.zap | 11 +++++------ .../air-quality-sensor-app.zap | 9 ++++----- .../all-clusters-common/all-clusters-app.zap | 11 +++++------ .../all-clusters-minimal-app.zap | 9 ++++----- examples/bridge-app/bridge-common/bridge-app.zap | 9 ++++----- .../noip_rootnode_dimmablelight_bCwGYSDpoe.zap | 3 +-- ...nsor_humiditysensor_thermostat_56de3d5f45.zap | 9 ++++----- .../rootnode_airqualitysensor_e63187f6c9.zap | 11 +++++------ .../rootnode_basicvideoplayer_0ff86e943b.zap | 3 +-- ...rootnode_colortemperaturelight_hbUnzYVeyn.zap | 3 +-- .../rootnode_contactsensor_lFAGG1bfRO.zap | 3 +-- .../rootnode_dimmablelight_bCwGYSDpoe.zap | 3 +-- .../devices/rootnode_dishwasher_cc105034fe.zap | 3 +-- .../devices/rootnode_doorlock_aNKYAreMXE.zap | 3 +-- .../rootnode_extendedcolorlight_8lcaaYJVAa.zap | 3 +-- .../chef/devices/rootnode_fan_7N2TobIlOX.zap | 3 +-- .../devices/rootnode_flowsensor_1zVxHedlaV.zap | 3 +-- .../rootnode_genericswitch_9866e35d0b.zap | 3 +-- .../rootnode_heatingcoolingunit_ncdGai1E5a.zap | 3 +-- .../rootnode_humiditysensor_Xyj4gda6Hb.zap | 3 +-- .../rootnode_laundrywasher_fb10d238c8.zap | 3 +-- .../devices/rootnode_lightsensor_lZQycTFcJK.zap | 3 +-- .../rootnode_occupancysensor_iHyVgifZuo.zap | 3 +-- .../devices/rootnode_onofflight_bbs1b7IaOV.zap | 3 +-- .../devices/rootnode_onofflight_samplemei.zap | 3 +-- .../rootnode_onofflightswitch_FsPlMr090Q.zap | 3 +-- .../rootnode_onoffpluginunit_Wtf8ss5EBY.zap | 3 +-- .../rootnode_pressuresensor_s0qC9wLH4k.zap | 3 +-- .../chef/devices/rootnode_pump_5f904818cc.zap | 9 ++++----- .../chef/devices/rootnode_pump_a811bb33a0.zap | 3 +-- ...t_temperaturecontrolledcabinet_ffdb696680.zap | 3 +-- .../rootnode_roboticvacuumcleaner_1807ff0c49.zap | 3 +-- .../rootnode_roomairconditioner_9cf3607804.zap | 3 +-- .../devices/rootnode_smokecoalarm_686fe0dcb8.zap | 3 +-- .../chef/devices/rootnode_speaker_RpzeXdimqA.zap | 3 +-- .../rootnode_temperaturesensor_Qy1zkNW7c3.zap | 9 ++++----- .../devices/rootnode_thermostat_bm3fb8dhYi.zap | 3 +-- .../rootnode_windowcovering_RLCxaGi9Yx.zap | 3 +-- examples/chef/devices/template.zap | 3 +-- .../contact-sensor-common/contact-sensor-app.zap | 3 +-- .../templates/commands.zapt | 2 +- .../dishwasher-common/dishwasher-app.zap | 3 +-- .../light-switch-common/light-switch-app.zap | 3 +-- .../data_model/lighting-app-ethernet.zap | 3 +-- .../data_model/lighting-app-thread.zap | 3 +-- .../bouffalolab/data_model/lighting-app-wifi.zap | 3 +-- .../lighting-common/lighting-app.zap | 3 +-- .../lighting-app/nxp/zap/lighting-on-off.zap | 3 +-- examples/lighting-app/qpg/zap/light.zap | 3 +-- .../silabs/data_model/lighting-thread-app.zap | 3 +-- .../silabs/data_model/lighting-wifi-app.zap | 3 +-- examples/lock-app/lock-common/lock-app.zap | 3 +-- examples/lock-app/nxp/zap/lock-app.zap | 3 +-- examples/lock-app/qpg/zap/lock.zap | 3 +-- .../log-source-common/log-source-app.zap | 3 +-- .../ota-provider-common/ota-provider-app.zap | 3 +-- .../ota-requestor-common/ota-requestor-app.zap | 3 +-- examples/placeholder/linux/apps/app1/config.zap | 11 +++++------ examples/placeholder/linux/apps/app2/config.zap | 11 +++++------ examples/pump-app/pump-common/pump-app.zap | 11 +++++------ .../silabs/data_model/pump-thread-app.zap | 11 +++++------ .../pump-app/silabs/data_model/pump-wifi-app.zap | 11 +++++------ .../pump-controller-app.zap | 3 +-- .../refrigerator-common/refrigerator-app.zap | 3 +-- .../resource-monitoring-app.zap | 3 +-- examples/rvc-app/rvc-common/rvc-app.zap | 3 +-- .../smoke-co-alarm-common/smoke-co-alarm-app.zap | 3 +-- .../temperature-measurement.zap | 9 ++++----- .../nxp/zap/thermostat_matter_thread.zap | 3 +-- .../nxp/zap/thermostat_matter_wifi.zap | 3 +-- .../thermostat/thermostat-common/thermostat.zap | 3 +-- examples/tv-app/tv-common/tv-app.zap | 3 +-- .../tv-casting-common/tv-casting-app.zap | 3 +-- .../virtual-device-common/virtual-device-app.zap | 3 +-- examples/window-app/common/window-app.zap | 3 +-- scripts/setup/zap.json | 4 ++-- scripts/setup/zap.version | 2 +- .../tools/zap/tests/inputs/all-clusters-app.zap | 11 +++++------ scripts/tools/zap/tests/inputs/lighting-app.zap | 3 +-- scripts/tools/zap/zap_execution.py | 2 +- .../data_model/controller-clusters.zap | 3 +-- .../zap-generated/MTRAttributeTLVValueDecoder.mm | 6 ++++++ .../zap-generated/cluster/Commands.h | 16 ++++++++++++++++ 83 files changed, 161 insertions(+), 216 deletions(-) diff --git a/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap b/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap index cc96cb04983fc4..62293622ef43db 100644 --- a/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap +++ b/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap @@ -6838,7 +6838,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6854,7 +6854,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6870,7 +6870,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6886,7 +6886,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7559,6 +7559,5 @@ "endpointId": 4, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap index f459cfa6521060..23d2555a8ead16 100644 --- a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap @@ -4008,7 +4008,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4024,7 +4024,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4040,7 +4040,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5861,6 +5861,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index c5045d193a6d82..f2272fbee91295 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -14808,7 +14808,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14824,7 +14824,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14840,7 +14840,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14856,7 +14856,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -21901,6 +21901,5 @@ "endpointId": 65534, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap index 50ab55464e0526..4d7eeff57bcfc4 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap @@ -7553,7 +7553,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7569,7 +7569,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7585,7 +7585,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12348,6 +12348,5 @@ "endpointId": 65534, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/bridge-app/bridge-common/bridge-app.zap b/examples/bridge-app/bridge-common/bridge-app.zap index 9570644c62188a..90eed8842cbc4f 100644 --- a/examples/bridge-app/bridge-common/bridge-app.zap +++ b/examples/bridge-app/bridge-common/bridge-app.zap @@ -5571,7 +5571,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "External", "singleton": 0, @@ -5587,7 +5587,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "External", "singleton": 0, @@ -5603,7 +5603,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "External", "singleton": 0, @@ -5721,6 +5721,5 @@ "endpointId": 2, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap index 8a9d8d4e42c31d..37c35471f5c872 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap @@ -4795,6 +4795,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap index 8e8c9a404ce37c..ec3dcd931353d7 100644 --- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap +++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap @@ -6581,7 +6581,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6597,7 +6597,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6613,7 +6613,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7844,6 +7844,5 @@ "endpointId": 5, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap index 8df2dae41dc7d8..8b9d43e1c969d5 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap @@ -2913,7 +2913,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -2929,7 +2929,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -2945,7 +2945,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -2961,7 +2961,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "temperature", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -6078,6 +6078,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap index f9b6772b58d4f2..333dbf4d9fa34f 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap @@ -3938,6 +3938,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap index 4c96f6708498f9..2c06878eb0fd64 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap @@ -3918,6 +3918,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap index 49c9fe342f96be..5d66b2b8710794 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap @@ -3100,6 +3100,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap index ae7f9833be6028..a910fd9b245a2e 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap @@ -3532,6 +3532,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap index 25a0d0d1be222b..ba944f48bbd683 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap @@ -3533,6 +3533,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap index fc97739ea6ec98..a759e3d7c11b16 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap @@ -3429,6 +3429,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap index 62689b778ce654..ced7051c1f78ba 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap @@ -4022,6 +4022,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap b/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap index f410f56974d928..c40b276cc84f5c 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap @@ -3243,6 +3243,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap index d193bb5d236e2b..a88c76d6957e95 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap @@ -3002,6 +3002,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap index 568708c64ea1ad..8e509727894bf5 100644 --- a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap +++ b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap @@ -2406,6 +2406,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap index 40ea29e55ac961..681fd3d7ba8fee 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap @@ -3607,6 +3607,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap index 9837d64370ea7f..4b66c78c1a73cc 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap @@ -3002,6 +3002,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap index c33f7639fe02d9..d0766a02e2dec8 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap @@ -3369,6 +3369,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap index 4628663d2048eb..53edd8abd939df 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap @@ -2970,6 +2970,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap index e0a1133e2b10c7..70dcd3fa601752 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap @@ -2986,6 +2986,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap index cce6ae448e774e..0d48f3a2efe8bb 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap @@ -3442,6 +3442,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.zap b/examples/chef/devices/rootnode_onofflight_samplemei.zap index 83f44eebd1907d..57669126a8386d 100644 --- a/examples/chef/devices/rootnode_onofflight_samplemei.zap +++ b/examples/chef/devices/rootnode_onofflight_samplemei.zap @@ -3574,6 +3574,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap index 801d9c4fd2de67..3d7196817f51fa 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap @@ -3162,6 +3162,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap index 66744fe2fc879e..c000d81688d972 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap @@ -3190,6 +3190,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap index 4ed304754c594f..c57e7287d9b850 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap @@ -3012,6 +3012,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.zap b/examples/chef/devices/rootnode_pump_5f904818cc.zap index ca969c6222fabe..4d2ca2a38f6ea6 100644 --- a/examples/chef/devices/rootnode_pump_5f904818cc.zap +++ b/examples/chef/devices/rootnode_pump_5f904818cc.zap @@ -3078,7 +3078,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3094,7 +3094,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3110,7 +3110,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3545,6 +3545,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.zap b/examples/chef/devices/rootnode_pump_a811bb33a0.zap index c4ce099577de7a..c6ed1ed214c31d 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.zap +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.zap @@ -3003,6 +3003,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap index f63a0072d3fc7e..f90591eef0a0d6 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap @@ -3793,6 +3793,5 @@ "endpointId": 3, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap index b12960c0ad7c65..8d10ab99962f47 100644 --- a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap +++ b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap @@ -3051,6 +3051,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap index 22078ba8f841f7..401800be09fd61 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap @@ -3148,6 +3148,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap index 9fdb65c8035573..bb3717d00bda33 100644 --- a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap +++ b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap @@ -3085,6 +3085,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap index 28f47070e93356..b5d0e9eeb514f5 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap @@ -3174,6 +3174,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap index e16ee3fcca8420..0c4c5c17c371f9 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap @@ -2843,7 +2843,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2859,7 +2859,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2875,7 +2875,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2986,6 +2986,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap index fbe5c0f9c50a56..42a23375c9ec67 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap @@ -3817,6 +3817,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap index 0d68f07eccb7a1..992590ceb2d483 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap @@ -3478,6 +3478,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/template.zap b/examples/chef/devices/template.zap index bf77da05ea3d05..87c7e61ab964d9 100644 --- a/examples/chef/devices/template.zap +++ b/examples/chef/devices/template.zap @@ -2788,6 +2788,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap index 1a7ff846ae75a0..5d739897104e04 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap @@ -4714,6 +4714,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/darwin-framework-tool/templates/commands.zapt b/examples/darwin-framework-tool/templates/commands.zapt index 9d1c98e1d1d06f..241a75bd33ecc6 100644 --- a/examples/darwin-framework-tool/templates/commands.zapt +++ b/examples/darwin-framework-tool/templates/commands.zapt @@ -312,10 +312,10 @@ public: {{/if}} {{/if}} {{/zcl_attributes_server}} -{{/if}} {{#if (isProvisional (asUpperCamelCase name preserveAcronyms=true))}} #endif // MTR_ENABLE_PROVISIONAL {{/if}} +{{/if}} {{/zcl_clusters}} /*----------------------------------------------------------------------------*\ diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap b/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap index be3add8ed70a6a..6296916227604a 100644 --- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap +++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap @@ -3919,6 +3919,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.zap b/examples/light-switch-app/light-switch-common/light-switch-app.zap index 0e3857c0ef3747..9d57c838c576ee 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.zap +++ b/examples/light-switch-app/light-switch-common/light-switch-app.zap @@ -5848,6 +5848,5 @@ "endpointId": 2, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap index 964c28d2394697..83336230621679 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap @@ -4293,6 +4293,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap index 01561c14d6dd33..61d2547e67729e 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap @@ -5269,6 +5269,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap index b5a5f6165d0016..d0caac0d852db9 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap @@ -4476,6 +4476,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/lighting-common/lighting-app.zap b/examples/lighting-app/lighting-common/lighting-app.zap index 1eb4d7a701f432..cb6181d2277fd6 100644 --- a/examples/lighting-app/lighting-common/lighting-app.zap +++ b/examples/lighting-app/lighting-common/lighting-app.zap @@ -5992,6 +5992,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.zap b/examples/lighting-app/nxp/zap/lighting-on-off.zap index 908dfc6bc2ac66..fd414f8267f4c5 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.zap +++ b/examples/lighting-app/nxp/zap/lighting-on-off.zap @@ -3962,6 +3962,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/qpg/zap/light.zap b/examples/lighting-app/qpg/zap/light.zap index a3b56ebb02d1cb..af746454e6158a 100644 --- a/examples/lighting-app/qpg/zap/light.zap +++ b/examples/lighting-app/qpg/zap/light.zap @@ -6223,6 +6223,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap index f9bedf8f98ceee..ba891a5419f952 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap @@ -5932,6 +5932,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap b/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap index 9fdd90c26099db..2af72278d94d61 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap @@ -5108,6 +5108,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lock-app/lock-common/lock-app.zap b/examples/lock-app/lock-common/lock-app.zap index 5dddf5b3075d14..82c7bbe7268baf 100644 --- a/examples/lock-app/lock-common/lock-app.zap +++ b/examples/lock-app/lock-common/lock-app.zap @@ -6660,6 +6660,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lock-app/nxp/zap/lock-app.zap b/examples/lock-app/nxp/zap/lock-app.zap index 8e015b083248cb..b672e0c2b5a7ec 100644 --- a/examples/lock-app/nxp/zap/lock-app.zap +++ b/examples/lock-app/nxp/zap/lock-app.zap @@ -3425,6 +3425,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lock-app/qpg/zap/lock.zap b/examples/lock-app/qpg/zap/lock.zap index c60d090151a3b7..fc0f478213e3be 100644 --- a/examples/lock-app/qpg/zap/lock.zap +++ b/examples/lock-app/qpg/zap/lock.zap @@ -5284,6 +5284,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/log-source-app/log-source-common/log-source-app.zap b/examples/log-source-app/log-source-common/log-source-app.zap index 4be1a514aea258..f24d8dc8c4c007 100644 --- a/examples/log-source-app/log-source-common/log-source-app.zap +++ b/examples/log-source-app/log-source-common/log-source-app.zap @@ -737,6 +737,5 @@ "endpointId": 0, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap b/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap index d445d8a2694769..534246e46c8c30 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap @@ -2283,6 +2283,5 @@ "endpointId": 0, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap index f2eae5d5381cfc..fb1913ba066f28 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap @@ -3440,6 +3440,5 @@ "endpointId": 65534, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/placeholder/linux/apps/app1/config.zap b/examples/placeholder/linux/apps/app1/config.zap index 6bb34d3306eac0..a4822b8fe9da04 100644 --- a/examples/placeholder/linux/apps/app1/config.zap +++ b/examples/placeholder/linux/apps/app1/config.zap @@ -9046,7 +9046,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9062,7 +9062,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9078,7 +9078,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9094,7 +9094,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -15205,6 +15205,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/placeholder/linux/apps/app2/config.zap b/examples/placeholder/linux/apps/app2/config.zap index 3f19bedb04a28a..f65aa2068700bb 100644 --- a/examples/placeholder/linux/apps/app2/config.zap +++ b/examples/placeholder/linux/apps/app2/config.zap @@ -9120,7 +9120,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9136,7 +9136,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9152,7 +9152,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9168,7 +9168,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14997,6 +14997,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/pump-app/pump-common/pump-app.zap b/examples/pump-app/pump-common/pump-app.zap index 73b79af6674e30..b982bfd166c7f3 100644 --- a/examples/pump-app/pump-common/pump-app.zap +++ b/examples/pump-app/pump-common/pump-app.zap @@ -4033,7 +4033,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4049,7 +4049,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4065,7 +4065,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4081,7 +4081,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4622,6 +4622,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/pump-app/silabs/data_model/pump-thread-app.zap b/examples/pump-app/silabs/data_model/pump-thread-app.zap index bd3569bc9c42f9..ca953399539dc7 100644 --- a/examples/pump-app/silabs/data_model/pump-thread-app.zap +++ b/examples/pump-app/silabs/data_model/pump-thread-app.zap @@ -4033,7 +4033,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4049,7 +4049,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4065,7 +4065,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4081,7 +4081,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4622,6 +4622,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/pump-app/silabs/data_model/pump-wifi-app.zap b/examples/pump-app/silabs/data_model/pump-wifi-app.zap index bd3569bc9c42f9..ca953399539dc7 100644 --- a/examples/pump-app/silabs/data_model/pump-wifi-app.zap +++ b/examples/pump-app/silabs/data_model/pump-wifi-app.zap @@ -4033,7 +4033,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4049,7 +4049,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4065,7 +4065,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4081,7 +4081,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4622,6 +4622,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap b/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap index 0d687d1f4d446c..db4f39092d7d56 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap @@ -3448,6 +3448,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap b/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap index 3d554d6d8ca5ad..0d4058a623ed3b 100644 --- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap @@ -3733,6 +3733,5 @@ "endpointId": 3, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap index a55f8b6f4abe87..316b31550d4dd1 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap +++ b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap @@ -5339,6 +5339,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/rvc-app/rvc-common/rvc-app.zap b/examples/rvc-app/rvc-common/rvc-app.zap index e5f9e297ad0b19..2a5e70c15e6899 100644 --- a/examples/rvc-app/rvc-common/rvc-app.zap +++ b/examples/rvc-app/rvc-common/rvc-app.zap @@ -2799,6 +2799,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap index 2507ad7cba4c4b..9f908ddc467eb1 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap @@ -4849,6 +4849,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap index 1b4d5b5e83b16f..d30f78430de90d 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap @@ -2891,7 +2891,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2907,7 +2907,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2923,7 +2923,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2986,6 +2986,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.zap b/examples/thermostat/nxp/zap/thermostat_matter_thread.zap index 1db8b2b288b77f..fc4fcab08daeb0 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.zap +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.zap @@ -4950,6 +4950,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap b/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap index 7a3e1ffbb356ba..4f547325082971 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap @@ -4092,6 +4092,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/thermostat/thermostat-common/thermostat.zap b/examples/thermostat/thermostat-common/thermostat.zap index d22c446eb23fac..15089b3ab63025 100644 --- a/examples/thermostat/thermostat-common/thermostat.zap +++ b/examples/thermostat/thermostat-common/thermostat.zap @@ -5059,6 +5059,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap index 08def3fad76094..dfb855bbc4182f 100644 --- a/examples/tv-app/tv-common/tv-app.zap +++ b/examples/tv-app/tv-common/tv-app.zap @@ -7637,6 +7637,5 @@ "endpointId": 3, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap index d55da66fab0eba..fdcfe88813b957 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap @@ -4382,6 +4382,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap b/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap index d60d0e3de7f852..2de2594f69d319 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap @@ -6138,6 +6138,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/window-app/common/window-app.zap b/examples/window-app/common/window-app.zap index 3ac0170b1683e6..62335819c78496 100644 --- a/examples/window-app/common/window-app.zap +++ b/examples/window-app/common/window-app.zap @@ -7073,6 +7073,5 @@ "endpointId": 2, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/scripts/setup/zap.json b/scripts/setup/zap.json index b9e8e18016cd31..94d4799af8f241 100644 --- a/scripts/setup/zap.json +++ b/scripts/setup/zap.json @@ -8,13 +8,13 @@ "mac-amd64", "windows-amd64" ], - "tags": ["version:2@v2023.10.24-nightly.1"] + "tags": ["version:2@v2023.10.30-nightly.1"] }, { "_comment": "Always get the amd64 version on mac until usable arm64 zap build is available", "path": "fuchsia/third_party/zap/mac-amd64", "platforms": ["mac-arm64"], - "tags": ["version:2@v2023.10.24-nightly.1"] + "tags": ["version:2@v2023.10.30-nightly.1"] } ] } diff --git a/scripts/setup/zap.version b/scripts/setup/zap.version index c26dc3f85a55d8..7cea852e9c90f1 100644 --- a/scripts/setup/zap.version +++ b/scripts/setup/zap.version @@ -1 +1 @@ -v2023.10.24-nightly +v2023.10.30-nightly diff --git a/scripts/tools/zap/tests/inputs/all-clusters-app.zap b/scripts/tools/zap/tests/inputs/all-clusters-app.zap index 12d89a5da8d510..97bea16a06f3a2 100644 --- a/scripts/tools/zap/tests/inputs/all-clusters-app.zap +++ b/scripts/tools/zap/tests/inputs/all-clusters-app.zap @@ -11586,7 +11586,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11602,7 +11602,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11618,7 +11618,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11634,7 +11634,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16797,6 +16797,5 @@ "endpointId": 65534, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/scripts/tools/zap/tests/inputs/lighting-app.zap b/scripts/tools/zap/tests/inputs/lighting-app.zap index 7fbcb784bfd527..e2d343dc413e5f 100644 --- a/scripts/tools/zap/tests/inputs/lighting-app.zap +++ b/scripts/tools/zap/tests/inputs/lighting-app.zap @@ -5742,6 +5742,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/scripts/tools/zap/zap_execution.py b/scripts/tools/zap/zap_execution.py index 60e861d28cd926..4aa1eac29d4bed 100644 --- a/scripts/tools/zap/zap_execution.py +++ b/scripts/tools/zap/zap_execution.py @@ -23,7 +23,7 @@ # Use scripts/tools/zap/version_update.py to manage ZAP versioning as many # files may need updating for versions # -MIN_ZAP_VERSION = '2023.10.24' +MIN_ZAP_VERSION = '2023.10.28' class ZapTool: diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 69823c343442e1..fbec11f218ab8f 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -5081,6 +5081,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 4aaa93b2fc98c9..dbbd836fd32445 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -2518,6 +2518,7 @@ static id _Nullable DecodeAttributeValueForNetworkCommissioningCluster(Attribute } return value; } +#if MTR_ENABLE_PROVISIONAL case Attributes::SupportedWiFiBands::Id: { using TypeInfo = Attributes::SupportedWiFiBands::TypeInfo; TypeInfo::DecodableType cppValue; @@ -2544,6 +2545,8 @@ static id _Nullable DecodeAttributeValueForNetworkCommissioningCluster(Attribute } return value; } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL case Attributes::SupportedThreadFeatures::Id: { using TypeInfo = Attributes::SupportedThreadFeatures::TypeInfo; TypeInfo::DecodableType cppValue; @@ -2555,6 +2558,8 @@ static id _Nullable DecodeAttributeValueForNetworkCommissioningCluster(Attribute value = [NSNumber numberWithUnsignedShort:cppValue.Raw()]; return value; } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL case Attributes::ThreadVersion::Id: { using TypeInfo = Attributes::ThreadVersion::TypeInfo; TypeInfo::DecodableType cppValue; @@ -2566,6 +2571,7 @@ static id _Nullable DecodeAttributeValueForNetworkCommissioningCluster(Attribute value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } +#endif // MTR_ENABLE_PROVISIONAL default: { break; } 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 07f482a5ab89b7..31c1d5a6e5bbb9 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -26609,6 +26609,8 @@ class SubscribeAttributeNetworkCommissioningLastConnectErrorValue : public Subsc } }; +#if MTR_ENABLE_PROVISIONAL + /* * Attribute SupportedWiFiBands */ @@ -26691,6 +26693,9 @@ class SubscribeAttributeNetworkCommissioningSupportedWiFiBands : public Subscrib } }; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + /* * Attribute SupportedThreadFeatures */ @@ -26773,6 +26778,9 @@ class SubscribeAttributeNetworkCommissioningSupportedThreadFeatures : public Sub } }; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + /* * Attribute ThreadVersion */ @@ -26855,6 +26863,8 @@ class SubscribeAttributeNetworkCommissioningThreadVersion : public SubscribeAttr } }; +#endif // MTR_ENABLE_PROVISIONAL + /* * Attribute GeneratedCommandList */ @@ -154565,12 +154575,18 @@ void registerClusterNetworkCommissioning(Commands & commands) make_unique(), // make_unique(), // make_unique(), // +#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // make_unique(), // From 5c9d8e8748a8c18bd0c62161704f007b481869b7 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 31 Oct 2023 13:05:59 -0400 Subject: [PATCH 05/12] Make dispatch of OperationalSessionSetup retry notifications safer. (#30103) --- src/app/OperationalSessionSetup.cpp | 37 +++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/src/app/OperationalSessionSetup.cpp b/src/app/OperationalSessionSetup.cpp index 7b5d70919f2a8a..0b68c12c96a7dd 100644 --- a/src/app/OperationalSessionSetup.cpp +++ b/src/app/OperationalSessionSetup.cpp @@ -702,10 +702,43 @@ void OperationalSessionSetup::NotifyRetryHandlers(CHIP_ERROR error, const Reliab void OperationalSessionSetup::NotifyRetryHandlers(CHIP_ERROR error, System::Clock::Seconds16 timeoutEstimate) { - for (auto * item = mConnectionRetry.First(); item && item != &mConnectionRetry; item = item->mNext) + // We have to be very careful here: Calling into these handlers might in + // theory destroy the Callback objects involved, but unlike the + // succcess/failure cases we don't want to just clear the handlers from our + // list when we are calling them, because we might need to call a given + // handler more than once. + // + // To handle this we: + // + // 1) Snapshot the list of handlers up front, so if any of the handlers + // triggers an AddRetryHandler with some other handler that does not + // affect the list we plan to notify here. + // + // 2) When planning to notify a handler move it to a new list that contains + // just that handler. This way if it gets canceled as part of the + // notification we can tell it has been canceled. + // + // 3) If notifying the handler does not cancel it, add it back to our list + // of handlers so we will notify it on future retries. + + Cancelable retryHandlerListSnapshot; + mConnectionRetry.DequeueAll(retryHandlerListSnapshot); + + while (retryHandlerListSnapshot.mNext != &retryHandlerListSnapshot) { - auto cb = Callback::Callback::FromCancelable(item); + auto * cb = Callback::Callback::FromCancelable(retryHandlerListSnapshot.mNext); + + Callback::CallbackDeque currentCallbackHolder; + currentCallbackHolder.Enqueue(cb->Cancel()); + cb->mCall(cb->mContext, mPeerId, error, timeoutEstimate); + + if (currentCallbackHolder.mNext != ¤tCallbackHolder) + { + // Callback has not been canceled as part of the call, so is still + // supposed to be registered with us. + AddRetryHandler(cb); + } } } #endif // CHIP_DEVICE_CONFIG_ENABLE_AUTOMATIC_CASE_RETRIES From 89ce5e7db6a00a7b4c6fec4412a834799f0141b2 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 31 Oct 2023 15:38:13 -0400 Subject: [PATCH 06/12] Update availability annotations for Darwin. (#30129) * Administrator Commissioning feature map has been around for a while, but finally got added to the SDK, so that's not marked provisional. * Various things targeting Spring 2024 Matter release are explicitly marked provisional. --- .../CHIP/templates/availability.yaml | 22 +++++++++++++++++++ .../CHIP/zap-generated/MTRBaseClusters.h | 4 ++-- .../zap-generated/cluster/Commands.h | 5 +++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 50dd02c4952444..abe0c77d9ec5b7 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -7729,6 +7729,9 @@ - release: "Future" versions: "future" introduced: + bitmaps: + AdministratorCommissioning: + - Feature bitmap values: PumpConfigurationAndControl: PumpStatusBitmap: @@ -7736,6 +7739,9 @@ SoftwareDiagnostics: Feature: - Watermarks + AdministratorCommissioning: + Feature: + - Basic deprecated: bitmap values: PumpConfigurationAndControl: @@ -7744,6 +7750,22 @@ SoftwareDiagnostics: Feature: - WaterMarks + provisional: + attributes: + NetworkCommissioning: + # Targeting Spring 2024 Matter release + - SupportedWiFiBands + - SupportedThreadFeatures + - ThreadVersion + commands: + GeneralDiagnostics: + # Targeting Spring 2024 Matter release + - TimeSnapshot + - TimeSnapshotResponse + bitmaps: + NetworkCommissioning: + # Targeting Spring 2024 Matter release + - ThreadCapabilitiesBitmap renames: bitmap values: PumpConfigurationAndControl: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 9a05da483a248f..56a27d8ae18e8c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -14230,8 +14230,8 @@ typedef NS_ENUM(uint8_t, MTRAdministratorCommissioningStatusCode) { } MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_OPTIONS(uint32_t, MTRAdministratorCommissioningFeature) { - MTRAdministratorCommissioningFeatureBasic MTR_PROVISIONALLY_AVAILABLE = 0x1, -} MTR_PROVISIONALLY_AVAILABLE; + MTRAdministratorCommissioningFeatureBasic MTR_NEWLY_AVAILABLE = 0x1, +} MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTROperationalCredentialsCertificateChainType) { MTROperationalCredentialsCertificateChainTypeDACCertificate MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x01, 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 31c1d5a6e5bbb9..6fa4deb1bb9bbd 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -28016,6 +28016,7 @@ class GeneralDiagnosticsTestEventTrigger : public ClusterCommand { chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type mRequest; }; +#if MTR_ENABLE_PROVISIONAL /* * Command TimeSnapshot */ @@ -28066,6 +28067,8 @@ class GeneralDiagnosticsTimeSnapshot : public ClusterCommand { private: }; +#endif // MTR_ENABLE_PROVISIONAL + /* * Attribute NetworkInterfaces */ @@ -154644,7 +154647,9 @@ void registerClusterGeneralDiagnostics(Commands & commands) commands_list clusterCommands = { make_unique(Id), // make_unique(), // +#if MTR_ENABLE_PROVISIONAL make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL make_unique(Id), // make_unique(Id), // make_unique(Id), // From d1d09a9f54f178ed37b3bd4275eeb9ee340a7e5d Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 31 Oct 2023 15:38:25 -0400 Subject: [PATCH 07/12] Switch temperature measurement tolerance back to u16 (instead of temperature) (#30132) * Switch temperature measurement tolerance back to int16u to match the spec (this is not a temperature) * Zap regen --- .../air-purifier-common/air-purifier-app.matter | 2 +- .../all-clusters-common/all-clusters-app.matter | 2 +- .../rootnode_airqualitysensor_e63187f6c9.matter | 2 +- .../chef/devices/rootnode_thermostat_bm3fb8dhYi.matter | 2 +- examples/placeholder/linux/apps/app1/config.matter | 4 ++-- examples/placeholder/linux/apps/app2/config.matter | 4 ++-- examples/pump-app/pump-common/pump-app.matter | 2 +- .../pump-app/silabs/data_model/pump-thread-app.matter | 2 +- .../pump-app/silabs/data_model/pump-wifi-app.matter | 2 +- .../pump-controller-common/pump-controller-app.matter | 2 +- .../all-clusters-app/app-templates/endpoint_config.h | 8 ++++---- .../chip/temperature-measurement-cluster.xml | 2 +- src/controller/data_model/controller-clusters.matter | 2 +- src/controller/python/chip/clusters/Objects.py | 8 ++++---- .../CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm | 2 +- .../app-common/zap-generated/attributes/Accessors.cpp | 10 +++++----- .../app-common/zap-generated/attributes/Accessors.h | 4 ++-- .../app-common/zap-generated/cluster-objects.h | 8 ++++---- .../chip-tool/zap-generated/cluster/Commands.h | 4 ++-- .../zap-generated/cluster/logging/DataModelLogger.cpp | 2 +- .../zap-generated/test/Commands.h | 6 +++--- 21 files changed, 40 insertions(+), 40 deletions(-) diff --git a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter index d8eae9ae77ced3..4607a5f5f21274 100644 --- a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter +++ b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter @@ -1189,7 +1189,7 @@ server cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute temperature tolerance = 3; + readonly attribute int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index ca2f4ed0bda4ab..96bf1a611debb3 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -4126,7 +4126,7 @@ server cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute temperature tolerance = 3; + readonly attribute int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter index 7ab39684ed63a8..39e54e141b921d 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter @@ -1114,7 +1114,7 @@ server cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute temperature tolerance = 3; + readonly attribute int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index 5e63942dde6df5..d4bd76b4f7a695 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -1375,7 +1375,7 @@ client cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute optional temperature tolerance = 3; + readonly attribute optional int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 8daed1603f891c..b11384ba3b829d 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -5179,7 +5179,7 @@ client cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute optional temperature tolerance = 3; + readonly attribute optional int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5193,7 +5193,7 @@ server cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute temperature tolerance = 3; + readonly attribute int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 654c6f2fec41de..6ab8cec8fd39ad 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -5138,7 +5138,7 @@ client cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute optional temperature tolerance = 3; + readonly attribute optional int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5152,7 +5152,7 @@ server cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute temperature tolerance = 3; + readonly attribute int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index b95b685b2b753e..6c26c5b6079ea6 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -1331,7 +1331,7 @@ server cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute temperature tolerance = 3; + readonly attribute int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/pump-app/silabs/data_model/pump-thread-app.matter b/examples/pump-app/silabs/data_model/pump-thread-app.matter index 0bdb0955fef1bb..25a99c27a8d8c2 100644 --- a/examples/pump-app/silabs/data_model/pump-thread-app.matter +++ b/examples/pump-app/silabs/data_model/pump-thread-app.matter @@ -1331,7 +1331,7 @@ server cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute temperature tolerance = 3; + readonly attribute int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/pump-app/silabs/data_model/pump-wifi-app.matter b/examples/pump-app/silabs/data_model/pump-wifi-app.matter index 0bdb0955fef1bb..25a99c27a8d8c2 100644 --- a/examples/pump-app/silabs/data_model/pump-wifi-app.matter +++ b/examples/pump-app/silabs/data_model/pump-wifi-app.matter @@ -1331,7 +1331,7 @@ server cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute temperature tolerance = 3; + readonly attribute int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter index a5a9759bf9ae54..7dabd7f444c97f 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter @@ -1256,7 +1256,7 @@ client cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute optional temperature tolerance = 3; + readonly attribute optional int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h index 16e6c92fe83576..f4cdf85102f119 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h @@ -1148,10 +1148,10 @@ { ZAP_SIMPLE_DEFAULT(0x8000), 0x00000001, 2, ZAP_TYPE(TEMPERATURE), \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* MinMeasuredValue */ \ { ZAP_SIMPLE_DEFAULT(0x8000), 0x00000002, 2, ZAP_TYPE(TEMPERATURE), \ - ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* MaxMeasuredValue */ \ - { ZAP_EMPTY_DEFAULT(), 0x00000003, 2, ZAP_TYPE(TEMPERATURE), 0 }, /* Tolerance */ \ - { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ - { ZAP_SIMPLE_DEFAULT(4), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ + ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* MaxMeasuredValue */ \ + { ZAP_EMPTY_DEFAULT(), 0x00000003, 2, ZAP_TYPE(INT16U), 0 }, /* Tolerance */ \ + { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ + { ZAP_SIMPLE_DEFAULT(4), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ { ZAP_SIMPLE_DEFAULT(0x0000), 0x00000000, 2, ZAP_TYPE(INT16S), ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* MeasuredValue */ \ diff --git a/src/app/zap-templates/zcl/data-model/chip/temperature-measurement-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/temperature-measurement-cluster.xml index aee79b86eea3c0..d141743fafde56 100644 --- a/src/app/zap-templates/zcl/data-model/chip/temperature-measurement-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/temperature-measurement-cluster.xml @@ -27,6 +27,6 @@ limitations under the License. MeasuredValue MinMeasuredValue MaxMeasuredValue - Tolerance + Tolerance diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 41a318647f425d..05c426a0fd3f3d 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -5142,7 +5142,7 @@ client cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute optional temperature tolerance = 3; + readonly attribute optional int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index cffb2a70cb56a6..7571e68d18b3dd 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -27604,7 +27604,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="measuredValue", Tag=0x00000000, Type=typing.Union[Nullable, int]), ClusterObjectFieldDescriptor(Label="minMeasuredValue", Tag=0x00000001, Type=typing.Union[Nullable, int]), ClusterObjectFieldDescriptor(Label="maxMeasuredValue", Tag=0x00000002, Type=typing.Union[Nullable, int]), - ClusterObjectFieldDescriptor(Label="tolerance", Tag=0x00000003, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="tolerance", Tag=0x00000003, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -27616,7 +27616,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: measuredValue: 'typing.Union[Nullable, int]' = None minMeasuredValue: 'typing.Union[Nullable, int]' = None maxMeasuredValue: 'typing.Union[Nullable, int]' = None - tolerance: 'typing.Optional[int]' = None + tolerance: 'typing.Optional[uint]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None eventList: 'typing.List[uint]' = None @@ -27685,9 +27685,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - value: 'typing.Optional[int]' = None + value: 'typing.Optional[uint]' = None @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index dbbd836fd32445..74adbc2c2ed52a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -9958,7 +9958,7 @@ static id _Nullable DecodeAttributeValueForTemperatureMeasurementCluster(Attribu return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } default: { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 9563ed39d85707..374c60ca85fee1 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -17735,9 +17735,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, readable, sizeof(temp)); @@ -17749,9 +17749,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -17759,7 +17759,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Tolerance diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index e993b63df4c0ea..154e8cd0f01329 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -3128,8 +3128,8 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // temperature -EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Tolerance namespace FeatureMap { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index ae63fcf4a89d02..bc7968f384ba38 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -25065,9 +25065,9 @@ struct TypeInfo namespace Tolerance { struct TypeInfo { - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; + using Type = uint16_t; + using DecodableType = uint16_t; + using DecodableArgType = uint16_t; static constexpr ClusterId GetClusterId() { return Clusters::TemperatureMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::Tolerance::Id; } @@ -25122,7 +25122,7 @@ struct TypeInfo Attributes::MeasuredValue::TypeInfo::DecodableType measuredValue; Attributes::MinMeasuredValue::TypeInfo::DecodableType minMeasuredValue; Attributes::MaxMeasuredValue::TypeInfo::DecodableType maxMeasuredValue; - Attributes::Tolerance::TypeInfo::DecodableType tolerance = static_cast(0); + Attributes::Tolerance::TypeInfo::DecodableType tolerance = static_cast(0); Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::EventList::TypeInfo::DecodableType eventList; diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index ad1bbc556ee196..a70cdbbca288c3 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -18075,8 +18075,8 @@ void registerClusterTemperatureMeasurement(Commands & commands, CredentialIssuer make_unique>>(Id, "max-measured-value", INT16_MIN, INT16_MAX, Attributes::MaxMeasuredValue::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "tolerance", INT16_MIN, INT16_MAX, Attributes::Tolerance::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "tolerance", 0, UINT16_MAX, Attributes::Tolerance::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index a97925574bf5ac..2b6081b77e0f4b 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -10542,7 +10542,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("MaxMeasuredValue", 1, value); } case TemperatureMeasurement::Attributes::Tolerance::Id: { - int16_t value; + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Tolerance", 1, value); } diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 3c845e5215856e..e58522377c8b60 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -93672,9 +93672,9 @@ class Test_TC_TMP_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("tolerance", "temperature", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("tolerance", [value shortValue], 0)); - VerifyOrReturn(CheckConstraintMaxValue("tolerance", [value shortValue], 2048)); + VerifyOrReturn(CheckConstraintType("tolerance", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("tolerance", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("tolerance", [value unsignedShortValue], 2048U)); NextTest(); }]; From 5218c3bd51fdb854a047a2067cb987492b320cc4 Mon Sep 17 00:00:00 2001 From: fengdx4 <131833628+fengdx4@users.noreply.github.com> Date: Wed, 1 Nov 2023 03:49:50 +0800 Subject: [PATCH 08/12] Add microwave oven control cluster xml (#30044) * add microwave oven control cluster * Restyled by prettier-json * commit new generated files * updated for the MicrowaveOvenControl Cluster xml related files * Updated for the relative files of MicrowaveOvenControl cluster * fix zcl.json for MicrowaveOvenControl cluster * regen relative files * fix MicrowaveOvenControl environment problem --------- Co-authored-by: mideayanghui Co-authored-by: Restyled.io --- .github/workflows/tests.yaml | 1 + scripts/rules.matterlint | 1 + src/app/zap-templates/zcl/data-model/all.xml | 1 + .../chip/microwave-oven-control-cluster.xml | 45 + .../zcl/zcl-with-test-extensions.json | 1 + src/app/zap-templates/zcl/zcl.json | 1 + src/app/zap_cluster_list.json | 2 + src/controller/data_model/BUILD.gn | 2 + .../data_model/controller-clusters.matter | 30 + .../data_model/controller-clusters.zap | 52 + .../chip/devicecontroller/ChipClusters.java | 209 ++++ .../devicecontroller/ClusterIDMapping.java | 144 +++ .../devicecontroller/ClusterInfoMapping.java | 137 +++ .../devicecontroller/ClusterReadMapping.java | 126 ++ .../devicecontroller/ClusterWriteMapping.java | 2 + .../CHIPAttributeTLVValueDecoder.cpp | 222 ++++ .../java/zap-generated/CHIPClientCallbacks.h | 8 + .../CHIPEventTLVValueDecoder.cpp | 10 + .../java/zap-generated/CHIPReadCallbacks.cpp | 287 +++++ .../python/chip/clusters/CHIPClusters.py | 92 ++ .../python/chip/clusters/Objects.py | 248 ++++ .../MTRAttributeSpecifiedCheck.mm | 45 + .../MTRAttributeTLVValueDecoder.mm | 70 ++ .../CHIP/zap-generated/MTRBaseClusters.h | 100 ++ .../CHIP/zap-generated/MTRBaseClusters.mm | 461 +++++++ .../zap-generated/MTRBaseClusters_Internal.h | 4 + .../CHIP/zap-generated/MTRClusterConstants.h | 18 + .../CHIP/zap-generated/MTRClusters.h | 50 + .../CHIP/zap-generated/MTRClusters.mm | 125 ++ .../CHIP/zap-generated/MTRClusters.swift | 7 + .../zap-generated/MTRCommandPayloadsObjc.h | 64 + .../zap-generated/MTRCommandPayloadsObjc.mm | 179 +++ .../MTRCommandPayloads_Internal.h | 12 + .../zap-generated/MTRCommandTimedCheck.mm | 12 + .../zap-generated/MTREventTLVValueDecoder.mm | 15 + .../zap-generated/attributes/Accessors.cpp | 223 ++++ .../zap-generated/attributes/Accessors.h | 41 + .../app-common/zap-generated/callback.h | 96 ++ .../app-common/zap-generated/cluster-enums.h | 2 + .../zap-generated/cluster-objects.cpp | 126 ++ .../zap-generated/cluster-objects.h | 212 ++++ .../app-common/zap-generated/ids/Attributes.h | 50 + .../app-common/zap-generated/ids/Clusters.h | 3 + .../app-common/zap-generated/ids/Commands.h | 14 + .../app-common/zap-generated/print-cluster.h | 8 + .../zap-generated/cluster/Commands.h | 176 +++ .../cluster/logging/DataModelLogger.cpp | 61 + .../zap-generated/cluster/Commands.h | 1082 +++++++++++++++++ 48 files changed, 4877 insertions(+) create mode 100644 src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d6c580e643e9ff..120f69be6c3077 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -114,6 +114,7 @@ jobs: src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml \ diff --git a/scripts/rules.matterlint b/scripts/rules.matterlint index 3892736a0da7fa..0a63eeecf0a4f2 100644 --- a/scripts/rules.matterlint +++ b/scripts/rules.matterlint @@ -25,6 +25,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml"; diff --git a/src/app/zap-templates/zcl/data-model/all.xml b/src/app/zap-templates/zcl/data-model/all.xml index 211fed5581d049..2ec5c1a47500ca 100644 --- a/src/app/zap-templates/zcl/data-model/all.xml +++ b/src/app/zap-templates/zcl/data-model/all.xml @@ -23,6 +23,7 @@ + diff --git a/src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml new file mode 100644 index 00000000000000..e6cb38e39a1efc --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml @@ -0,0 +1,45 @@ + + + + + + + Microwave Oven Control + Appliances + Attributes and commands for configuring the microwave oven control, and reporting cooking stats. + 0x005F + MICROWAVE_OVEN_CONTROL_CLUSTER + true + true + CookTime + PowerSetting + MinPower + MaxPower + PowerStep + + + Set Cooking Parameters + + + + + + Add More Cooking Time + + + + diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 543a902517da97..1c2b767a7c5fd4 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -37,6 +37,7 @@ "diagnostic-logs-cluster.xml", "dishwasher-alarm-cluster.xml", "dishwasher-mode-cluster.xml", + "microwave-oven-control-cluster.xml", "door-lock-cluster.xml", "electrical-measurement-cluster.xml", "ethernet-network-diagnostics-cluster.xml", diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index c047c56557e2fa..db14ae2f939221 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -89,6 +89,7 @@ "switch-cluster.xml", "target-navigator-cluster.xml", "temperature-control-cluster.xml", + "microwave-oven-control-cluster.xml", "temperature-measurement-cluster.xml", "test-cluster.xml", "thermostat-cluster.xml", diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index 61b2d99f5433e0..bd4228a001522a 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -53,6 +53,7 @@ "LOW_POWER_CLUSTER": [], "MEDIA_INPUT_CLUSTER": [], "MEDIA_PLAYBACK_CLUSTER": [], + "MICROWAVE_OVEN_CONTROL_CLUSTER": [], "MODE_SELECT_CLUSTER": [], "NETWORK_COMMISSIONING_CLUSTER": [], "SAMPLE_MEI_CLUSTER": [], @@ -182,6 +183,7 @@ "LOW_POWER_CLUSTER": ["low-power-server"], "MEDIA_INPUT_CLUSTER": ["media-input-server"], "MEDIA_PLAYBACK_CLUSTER": ["media-playback-server"], + "MICROWAVE_OVEN_CONTROL_CLUSTER": ["microwave-oven-control-server"], "MODE_SELECT_CLUSTER": ["mode-select-server"], "NETWORK_COMMISSIONING_CLUSTER": ["network-commissioning"], "NITROGEN_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [ diff --git a/src/controller/data_model/BUILD.gn b/src/controller/data_model/BUILD.gn index f5044d61711df8..445d2b264e3516 100644 --- a/src/controller/data_model/BUILD.gn +++ b/src/controller/data_model/BUILD.gn @@ -114,6 +114,8 @@ if (current_os == "android" || matter_enable_java_compilation) { "jni/DishwasherAlarmClient-ReadImpl.cpp", "jni/DishwasherModeClient-InvokeSubscribeImpl.cpp", "jni/DishwasherModeClient-ReadImpl.cpp", + "jni/MicrowaveOvenControlClient-InvokeSubscribeImpl.cpp", + "jni/MicrowaveOvenControlClient-ReadImpl.cpp", "jni/DoorLockClient-InvokeSubscribeImpl.cpp", "jni/DoorLockClient-ReadImpl.cpp", "jni/ElectricalMeasurementClient-InvokeSubscribeImpl.cpp", diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 05c426a0fd3f3d..d10f65b38f9b6e 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -3354,6 +3354,36 @@ client cluster DishwasherAlarm = 93 { command ModifyEnabledAlarms(ModifyEnabledAlarmsRequest): DefaultSuccess = 1; } +/** Attributes and commands for configuring the microwave oven control, and reporting cooking stats. */ +provisional client cluster MicrowaveOvenControl = 95 { + readonly attribute elapsed_s cookTime = 1; + readonly attribute int8u powerSetting = 2; + readonly attribute optional int8u minPower = 3; + readonly attribute optional int8u maxPower = 4; + readonly attribute optional int8u powerStep = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct SetCookingParametersRequest { + optional int8u cookMode = 0; + optional elapsed_s cookTime = 1; + optional int8u powerSetting = 2; + } + + request struct AddMoreTimeRequest { + elapsed_s timeToAdd = 0; + } + + /** Set Cooking Parameters */ + command SetCookingParameters(SetCookingParametersRequest): DefaultSuccess = 0; + /** Add More Cooking Time */ + command AddMoreTime(AddMoreTimeRequest): DefaultSuccess = 1; +} + /** This cluster supports remotely monitoring and, where supported, changing the operational state of any device where a state machine is a part of the operation. */ client cluster OperationalState = 96 { enum ErrorStateEnum : enum8 { diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index fbec11f218ab8f..6705edcaded561 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -4739,6 +4739,58 @@ } ] }, + { + "name": "Microwave Oven Control", + "code": 1295, + "mfgCode": null, + "define": "MICROWAVE_OVEN_CONTROL_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "SetCookingParameters", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Electrical Measurement", "code": 2820, diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 006c23aaf1d582..23afc530dd458b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -13669,6 +13669,215 @@ public void subscribeClusterRevisionAttribute( private native void subscribeClusterRevisionAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } + public static class MicrowaveOvenControlCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 95L; + + public MicrowaveOvenControlCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public void setCookingParameters(DefaultClusterCallback callback, Optional cookMode, Optional cookTime, Optional powerSetting) { + setCookingParameters(chipClusterPtr, callback, cookMode, cookTime, powerSetting, null); + } + + public void setCookingParameters(DefaultClusterCallback callback, Optional cookMode, Optional cookTime, Optional powerSetting, int timedInvokeTimeoutMs) { + setCookingParameters(chipClusterPtr, callback, cookMode, cookTime, powerSetting, timedInvokeTimeoutMs); + } + + public void addMoreTime(DefaultClusterCallback callback, Long timeToAdd) { + addMoreTime(chipClusterPtr, callback, timeToAdd, null); + } + + public void addMoreTime(DefaultClusterCallback callback, Long timeToAdd, int timedInvokeTimeoutMs) { + addMoreTime(chipClusterPtr, callback, timeToAdd, timedInvokeTimeoutMs); + } + + private native void setCookingParameters(long chipClusterPtr, DefaultClusterCallback callback, Optional cookMode, Optional cookTime, Optional powerSetting, @Nullable Integer timedInvokeTimeoutMs); + + private native void addMoreTime(long chipClusterPtr, DefaultClusterCallback callback, Long timeToAdd, @Nullable Integer timedInvokeTimeoutMs); + + public interface GeneratedCommandListAttributeCallback { + void onSuccess(List value); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AcceptedCommandListAttributeCallback { + void onSuccess(List value); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface EventListAttributeCallback { + void onSuccess(List value); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AttributeListAttributeCallback { + void onSuccess(List value); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public void readCookTimeAttribute( + LongAttributeCallback callback) { + readCookTimeAttribute(chipClusterPtr, callback); + } + + public void subscribeCookTimeAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeCookTimeAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readPowerSettingAttribute( + IntegerAttributeCallback callback) { + readPowerSettingAttribute(chipClusterPtr, callback); + } + + public void subscribePowerSettingAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribePowerSettingAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readMinPowerAttribute( + IntegerAttributeCallback callback) { + readMinPowerAttribute(chipClusterPtr, callback); + } + + public void subscribeMinPowerAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeMinPowerAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readMaxPowerAttribute( + IntegerAttributeCallback callback) { + readMaxPowerAttribute(chipClusterPtr, callback); + } + + public void subscribeMaxPowerAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeMaxPowerAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readPowerStepAttribute( + IntegerAttributeCallback callback) { + readPowerStepAttribute(chipClusterPtr, callback); + } + + public void subscribePowerStepAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribePowerStepAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + 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 readEventListAttribute( + EventListAttributeCallback callback) { + readEventListAttribute(chipClusterPtr, callback); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeEventListAttribute(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 readCookTimeAttribute(long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeCookTimeAttribute(long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readPowerSettingAttribute(long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribePowerSettingAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readMinPowerAttribute(long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeMinPowerAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readMaxPowerAttribute(long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeMaxPowerAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readPowerStepAttribute(long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribePowerStepAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int 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 readEventListAttribute(long chipClusterPtr, EventListAttributeCallback callback); + + private native void subscribeEventListAttribute(long chipClusterPtr, EventListAttributeCallback 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); + } + public static class OperationalStateCluster extends BaseChipCluster { public static final long CLUSTER_ID = 96L; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index 99fa62cef2d0c1..792350d7595992 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -187,6 +187,9 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == DishwasherAlarm.ID) { return new DishwasherAlarm(); } + if (clusterId == MicrowaveOvenControl.ID) { + return new MicrowaveOvenControl(); + } if (clusterId == OperationalState.ID) { return new OperationalState(); } @@ -7532,6 +7535,147 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } + public static class MicrowaveOvenControl implements BaseCluster { + public static final long ID = 95L; + public long getID() { + return ID; + } + + public enum Attribute { + CookTime(1L), + PowerSetting(2L), + MinPower(3L), + MaxPower(4L), + PowerStep(5L), + GeneratedCommandList(65528L), + AcceptedCommandList(65529L), + EventList(65530L), + AttributeList(65531L), + FeatureMap(65532L), + ClusterRevision(65533L),; + private final long id; + Attribute(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Attribute value(long id) throws NoSuchFieldError { + for (Attribute attribute : Attribute.values()) { + if (attribute.getID() == id) { + return attribute; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Event {; + private final long id; + Event(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Event value(long id) throws NoSuchFieldError { + for (Event event : Event.values()) { + if (event.getID() == id) { + return event; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Command { + SetCookingParameters(0L), + AddMoreTime(1L),; + private final long id; + Command(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Command value(long id) throws NoSuchFieldError { + for (Command command : Command.values()) { + if (command.getID() == id) { + return command; + } + } + throw new NoSuchFieldError(); + } + }public enum SetCookingParametersCommandField {CookMode(0),CookTime(1),PowerSetting(2),; + private final int id; + SetCookingParametersCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SetCookingParametersCommandField value(int id) throws NoSuchFieldError { + for (SetCookingParametersCommandField field : SetCookingParametersCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum AddMoreTimeCommandField {TimeToAdd(0),; + private final int id; + AddMoreTimeCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static AddMoreTimeCommandField value(int id) throws NoSuchFieldError { + for (AddMoreTimeCommandField field : AddMoreTimeCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }@Override + public String getAttributeName(long id) throws NoSuchFieldError { + return Attribute.value(id).toString(); + } + + @Override + public String getEventName(long id) throws NoSuchFieldError { + return Event.value(id).toString(); + } + + @Override + public String getCommandName(long id) throws NoSuchFieldError { + return Command.value(id).toString(); + } + + @Override + public long getAttributeID(String name) throws IllegalArgumentException { + return Attribute.valueOf(name).getID(); + } + + @Override + public long getEventID(String name) throws IllegalArgumentException { + return Event.valueOf(name).getID(); + } + + @Override + public long getCommandID(String name) throws IllegalArgumentException { + return Command.valueOf(name).getID(); + } + } public static class OperationalState implements BaseCluster { public static final long ID = 96L; public long getID() { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index 78cce7dc99f04d..340add6c45dd40 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -8146,6 +8146,90 @@ public void onError(Exception ex) { } } + public static class DelegatedMicrowaveOvenControlClusterGeneratedCommandListAttributeCallback implements ChipClusters.MicrowaveOvenControlCluster.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 DelegatedMicrowaveOvenControlClusterAcceptedCommandListAttributeCallback implements ChipClusters.MicrowaveOvenControlCluster.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 DelegatedMicrowaveOvenControlClusterEventListAttributeCallback implements ChipClusters.MicrowaveOvenControlCluster.EventListAttributeCallback, 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 DelegatedMicrowaveOvenControlClusterAttributeListAttributeCallback implements ChipClusters.MicrowaveOvenControlCluster.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 static class DelegatedOperationalStateClusterOperationalCommandResponseCallback implements ChipClusters.OperationalStateCluster.OperationalCommandResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -17065,6 +17149,10 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.DishwasherAlarmCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("dishwasherAlarm", dishwasherAlarmClusterInfo); + ClusterInfo microwaveOvenControlClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.MicrowaveOvenControlCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("microwaveOvenControl", microwaveOvenControlClusterInfo); + ClusterInfo operationalStateClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.OperationalStateCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("operationalState", operationalStateClusterInfo); @@ -17302,6 +17390,7 @@ public void combineCommand(Map destination, Map> getCommandMap() { commandMap.put("dishwasherAlarm", dishwasherAlarmClusterInteractionInfoMap); + Map microwaveOvenControlClusterInteractionInfoMap = new LinkedHashMap<>(); + + Map microwaveOvenControlsetCookingParametersCommandParams = new LinkedHashMap(); + + CommandParameterInfo microwaveOvenControlsetCookingParameterscookModeCommandParameterInfo = new CommandParameterInfo("cookMode", Optional.class, Integer.class); + microwaveOvenControlsetCookingParametersCommandParams.put("cookMode",microwaveOvenControlsetCookingParameterscookModeCommandParameterInfo); + + CommandParameterInfo microwaveOvenControlsetCookingParameterscookTimeCommandParameterInfo = new CommandParameterInfo("cookTime", Optional.class, Long.class); + microwaveOvenControlsetCookingParametersCommandParams.put("cookTime",microwaveOvenControlsetCookingParameterscookTimeCommandParameterInfo); + + CommandParameterInfo microwaveOvenControlsetCookingParameterspowerSettingCommandParameterInfo = new CommandParameterInfo("powerSetting", Optional.class, Integer.class); + microwaveOvenControlsetCookingParametersCommandParams.put("powerSetting",microwaveOvenControlsetCookingParameterspowerSettingCommandParameterInfo); + InteractionInfo microwaveOvenControlsetCookingParametersInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster) + .setCookingParameters((DefaultClusterCallback) callback + , (Optional) + commandArguments.get("cookMode") + , (Optional) + commandArguments.get("cookTime") + , (Optional) + commandArguments.get("powerSetting") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + microwaveOvenControlsetCookingParametersCommandParams + ); + microwaveOvenControlClusterInteractionInfoMap.put("setCookingParameters", microwaveOvenControlsetCookingParametersInteractionInfo); + + Map microwaveOvenControladdMoreTimeCommandParams = new LinkedHashMap(); + + CommandParameterInfo microwaveOvenControladdMoreTimetimeToAddCommandParameterInfo = new CommandParameterInfo("timeToAdd", Long.class, Long.class); + microwaveOvenControladdMoreTimeCommandParams.put("timeToAdd",microwaveOvenControladdMoreTimetimeToAddCommandParameterInfo); + InteractionInfo microwaveOvenControladdMoreTimeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster) + .addMoreTime((DefaultClusterCallback) callback + , (Long) + commandArguments.get("timeToAdd") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + microwaveOvenControladdMoreTimeCommandParams + ); + microwaveOvenControlClusterInteractionInfoMap.put("addMoreTime", microwaveOvenControladdMoreTimeInteractionInfo); + + commandMap.put("microwaveOvenControl", microwaveOvenControlClusterInteractionInfoMap); + Map operationalStateClusterInteractionInfoMap = new LinkedHashMap<>(); Map operationalStatepauseCommandParams = new LinkedHashMap(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 8fc29e53155f78..a8c56baddaa892 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -7453,6 +7453,131 @@ private static Map readDishwasherAlarmInteractionInfo() return result; } + private static Map readMicrowaveOvenControlInteractionInfo() { + Map result = new LinkedHashMap<>();Map readMicrowaveOvenControlCookTimeCommandParams = new LinkedHashMap(); + InteractionInfo readMicrowaveOvenControlCookTimeAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster).readCookTimeAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readMicrowaveOvenControlCookTimeCommandParams + ); + result.put("readCookTimeAttribute", readMicrowaveOvenControlCookTimeAttributeInteractionInfo); + Map readMicrowaveOvenControlPowerSettingCommandParams = new LinkedHashMap(); + InteractionInfo readMicrowaveOvenControlPowerSettingAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster).readPowerSettingAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readMicrowaveOvenControlPowerSettingCommandParams + ); + result.put("readPowerSettingAttribute", readMicrowaveOvenControlPowerSettingAttributeInteractionInfo); + Map readMicrowaveOvenControlMinPowerCommandParams = new LinkedHashMap(); + InteractionInfo readMicrowaveOvenControlMinPowerAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster).readMinPowerAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readMicrowaveOvenControlMinPowerCommandParams + ); + result.put("readMinPowerAttribute", readMicrowaveOvenControlMinPowerAttributeInteractionInfo); + Map readMicrowaveOvenControlMaxPowerCommandParams = new LinkedHashMap(); + InteractionInfo readMicrowaveOvenControlMaxPowerAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster).readMaxPowerAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readMicrowaveOvenControlMaxPowerCommandParams + ); + result.put("readMaxPowerAttribute", readMicrowaveOvenControlMaxPowerAttributeInteractionInfo); + Map readMicrowaveOvenControlPowerStepCommandParams = new LinkedHashMap(); + InteractionInfo readMicrowaveOvenControlPowerStepAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster).readPowerStepAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readMicrowaveOvenControlPowerStepCommandParams + ); + result.put("readPowerStepAttribute", readMicrowaveOvenControlPowerStepAttributeInteractionInfo); + Map readMicrowaveOvenControlGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readMicrowaveOvenControlGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.MicrowaveOvenControlCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMicrowaveOvenControlClusterGeneratedCommandListAttributeCallback(), + readMicrowaveOvenControlGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readMicrowaveOvenControlGeneratedCommandListAttributeInteractionInfo); + Map readMicrowaveOvenControlAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readMicrowaveOvenControlAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.MicrowaveOvenControlCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMicrowaveOvenControlClusterAcceptedCommandListAttributeCallback(), + readMicrowaveOvenControlAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readMicrowaveOvenControlAcceptedCommandListAttributeInteractionInfo); + Map readMicrowaveOvenControlEventListCommandParams = new LinkedHashMap(); + InteractionInfo readMicrowaveOvenControlEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster).readEventListAttribute( + (ChipClusters.MicrowaveOvenControlCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMicrowaveOvenControlClusterEventListAttributeCallback(), + readMicrowaveOvenControlEventListCommandParams + ); + result.put("readEventListAttribute", readMicrowaveOvenControlEventListAttributeInteractionInfo); + Map readMicrowaveOvenControlAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readMicrowaveOvenControlAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster).readAttributeListAttribute( + (ChipClusters.MicrowaveOvenControlCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMicrowaveOvenControlClusterAttributeListAttributeCallback(), + readMicrowaveOvenControlAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readMicrowaveOvenControlAttributeListAttributeInteractionInfo); + Map readMicrowaveOvenControlFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readMicrowaveOvenControlFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readMicrowaveOvenControlFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readMicrowaveOvenControlFeatureMapAttributeInteractionInfo); + Map readMicrowaveOvenControlClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readMicrowaveOvenControlClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readMicrowaveOvenControlClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readMicrowaveOvenControlClusterRevisionAttributeInteractionInfo); + + return result; + } private static Map readOperationalStateInteractionInfo() { Map result = new LinkedHashMap<>();Map readOperationalStatePhaseListCommandParams = new LinkedHashMap(); InteractionInfo readOperationalStatePhaseListAttributeInteractionInfo = new InteractionInfo( @@ -17524,6 +17649,7 @@ public Map> getReadAttributeMap() { put("airQuality", readAirQualityInteractionInfo()); put("smokeCoAlarm", readSmokeCoAlarmInteractionInfo()); put("dishwasherAlarm", readDishwasherAlarmInteractionInfo()); + put("microwaveOvenControl", readMicrowaveOvenControlInteractionInfo()); put("operationalState", readOperationalStateInteractionInfo()); put("rvcOperationalState", readRvcOperationalStateInteractionInfo()); put("hepaFilterMonitoring", readHepaFilterMonitoringInteractionInfo()); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index eaf536bf0f76cd..4631e7a257cf35 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -1034,6 +1034,8 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("smokeCoAlarm", writeSmokeCoAlarmInteractionInfo); Map writeDishwasherAlarmInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("dishwasherAlarm", writeDishwasherAlarmInteractionInfo); + Map writeMicrowaveOvenControlInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("microwaveOvenControl", writeMicrowaveOvenControlInteractionInfo); Map writeOperationalStateInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("operationalState", writeOperationalStateInteractionInfo); Map writeRvcOperationalStateInteractionInfo = new LinkedHashMap<>(); diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index a6d9ea102648fb..05f84ea0041019 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -15859,6 +15859,228 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::MicrowaveOvenControl::Id: { + using namespace app::Clusters::MicrowaveOvenControl; + switch (aPath.mAttributeId) + { + case Attributes::CookTime::Id: { + using TypeInfo = Attributes::CookTime::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"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::PowerSetting::Id: { + using TypeInfo = Attributes::PowerSetting::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"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::MinPower::Id: { + using TypeInfo = Attributes::MinPower::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"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::MaxPower::Id: { + using TypeInfo = Attributes::MaxPower::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"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::PowerStep::Id: { + using TypeInfo = Attributes::PowerStep::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"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + 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"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_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"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::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"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_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"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_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"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, 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"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } case app::Clusters::OperationalState::Id: { using namespace app::Clusters::OperationalState; switch (aPath.mAttributeId) diff --git a/src/controller/java/zap-generated/CHIPClientCallbacks.h b/src/controller/java/zap-generated/CHIPClientCallbacks.h index 30c2b580433cd9..ed4ee39880b20d 100644 --- a/src/controller/java/zap-generated/CHIPClientCallbacks.h +++ b/src/controller/java/zap-generated/CHIPClientCallbacks.h @@ -595,6 +595,14 @@ typedef void (*DishwasherAlarmEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*DishwasherAlarmAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*MicrowaveOvenControlGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*MicrowaveOvenControlAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*MicrowaveOvenControlEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*MicrowaveOvenControlAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); typedef void (*OperationalStatePhaseListListAttributeCallback)( void * context, const chip::app::DataModel::Nullable> & data); typedef void (*OperationalStateOperationalStateListListAttributeCallback)( diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 0a096db6a8e36c..a5ae8d8871b781 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -3043,6 +3043,16 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::MicrowaveOvenControl::Id: { + using namespace app::Clusters::MicrowaveOvenControl; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::OperationalState::Id: { using namespace app::Clusters::OperationalState; switch (aPath.mEventId) diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index f71fce0e5c8de4..f9194b8b06d9eb 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -24823,6 +24823,293 @@ void CHIPDishwasherAlarmAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPMicrowaveOvenControlGeneratedCommandListAttributeCallback::CHIPMicrowaveOvenControlGeneratedCommandListAttributeCallback( + 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"); + } +} + +CHIPMicrowaveOvenControlGeneratedCommandListAttributeCallback::~CHIPMicrowaveOvenControlGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPMicrowaveOvenControlGeneratedCommandListAttributeCallback::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"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPMicrowaveOvenControlAcceptedCommandListAttributeCallback::CHIPMicrowaveOvenControlAcceptedCommandListAttributeCallback( + 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"); + } +} + +CHIPMicrowaveOvenControlAcceptedCommandListAttributeCallback::~CHIPMicrowaveOvenControlAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPMicrowaveOvenControlAcceptedCommandListAttributeCallback::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"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPMicrowaveOvenControlEventListAttributeCallback::CHIPMicrowaveOvenControlEventListAttributeCallback(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"); + } +} + +CHIPMicrowaveOvenControlEventListAttributeCallback::~CHIPMicrowaveOvenControlEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPMicrowaveOvenControlEventListAttributeCallback::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"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPMicrowaveOvenControlAttributeListAttributeCallback::CHIPMicrowaveOvenControlAttributeListAttributeCallback(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"); + } +} + +CHIPMicrowaveOvenControlAttributeListAttributeCallback::~CHIPMicrowaveOvenControlAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPMicrowaveOvenControlAttributeListAttributeCallback::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"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + CHIPOperationalStatePhaseListAttributeCallback::CHIPOperationalStatePhaseListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index ea04b2c6cf583d..4946c669d88dab 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -5263,6 +5263,96 @@ class ChipClusters: }, }, } + _MICROWAVE_OVEN_CONTROL_CLUSTER_INFO = { + "clusterName": "MicrowaveOvenControl", + "clusterId": 0x0000005F, + "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "SetCookingParameters", + "args": { + "cookMode": "int", + "cookTime": "int", + "powerSetting": "int", + }, + }, + 0x00000001: { + "commandId": 0x00000001, + "commandName": "AddMoreTime", + "args": { + "timeToAdd": "int", + }, + }, + }, + "attributes": { + 0x00000001: { + "attributeName": "CookTime", + "attributeId": 0x00000001, + "type": "int", + "reportable": True, + }, + 0x00000002: { + "attributeName": "PowerSetting", + "attributeId": 0x00000002, + "type": "int", + "reportable": True, + }, + 0x00000003: { + "attributeName": "MinPower", + "attributeId": 0x00000003, + "type": "int", + "reportable": True, + }, + 0x00000004: { + "attributeName": "MaxPower", + "attributeId": 0x00000004, + "type": "int", + "reportable": True, + }, + 0x00000005: { + "attributeName": "PowerStep", + "attributeId": 0x00000005, + "type": "int", + "reportable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "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, + }, + }, + } _OPERATIONAL_STATE_CLUSTER_INFO = { "clusterName": "OperationalState", "clusterId": 0x00000060, @@ -12248,6 +12338,7 @@ class ChipClusters: 0x0000005B: _AIR_QUALITY_CLUSTER_INFO, 0x0000005C: _SMOKE_CO_ALARM_CLUSTER_INFO, 0x0000005D: _DISHWASHER_ALARM_CLUSTER_INFO, + 0x0000005F: _MICROWAVE_OVEN_CONTROL_CLUSTER_INFO, 0x00000060: _OPERATIONAL_STATE_CLUSTER_INFO, 0x00000061: _RVC_OPERATIONAL_STATE_CLUSTER_INFO, 0x00000071: _HEPA_FILTER_MONITORING_CLUSTER_INFO, @@ -12349,6 +12440,7 @@ class ChipClusters: "AirQuality": _AIR_QUALITY_CLUSTER_INFO, "SmokeCoAlarm": _SMOKE_CO_ALARM_CLUSTER_INFO, "DishwasherAlarm": _DISHWASHER_ALARM_CLUSTER_INFO, + "MicrowaveOvenControl": _MICROWAVE_OVEN_CONTROL_CLUSTER_INFO, "OperationalState": _OPERATIONAL_STATE_CLUSTER_INFO, "RvcOperationalState": _RVC_OPERATIONAL_STATE_CLUSTER_INFO, "HepaFilterMonitoring": _HEPA_FILTER_MONITORING_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 7571e68d18b3dd..4ee0663a3ef736 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -18449,6 +18449,254 @@ def descriptor(cls) -> ClusterObjectDescriptor: mask: 'uint' = 0 +@dataclass +class MicrowaveOvenControl(Cluster): + id: typing.ClassVar[int] = 0x0000005F + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="cookTime", Tag=0x00000001, Type=uint), + ClusterObjectFieldDescriptor(Label="powerSetting", Tag=0x00000002, Type=uint), + ClusterObjectFieldDescriptor(Label="minPower", Tag=0x00000003, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="maxPower", Tag=0x00000004, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="powerStep", Tag=0x00000005, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), + ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), + ]) + + cookTime: 'uint' = None + powerSetting: 'uint' = None + minPower: 'typing.Optional[uint]' = None + maxPower: 'typing.Optional[uint]' = None + powerStep: 'typing.Optional[uint]' = None + generatedCommandList: 'typing.List[uint]' = None + acceptedCommandList: 'typing.List[uint]' = None + eventList: 'typing.List[uint]' = None + attributeList: 'typing.List[uint]' = None + featureMap: 'uint' = None + clusterRevision: 'uint' = None + + class Commands: + @dataclass + class SetCookingParameters(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0000005F + command_id: typing.ClassVar[int] = 0x00000000 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="cookMode", Tag=0, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="cookTime", Tag=1, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="powerSetting", Tag=2, Type=typing.Optional[uint]), + ]) + + cookMode: 'typing.Optional[uint]' = None + cookTime: 'typing.Optional[uint]' = None + powerSetting: 'typing.Optional[uint]' = None + + @dataclass + class AddMoreTime(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0000005F + command_id: typing.ClassVar[int] = 0x00000001 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="timeToAdd", Tag=0, Type=uint), + ]) + + timeToAdd: 'uint' = 0 + + class Attributes: + @dataclass + class CookTime(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000005F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class PowerSetting(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000005F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class MinPower(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000005F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class MaxPower(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000005F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000004 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class PowerStep(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000005F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000005 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000005F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF8 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AcceptedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000005F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF9 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class EventList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000005F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFA + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AttributeList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000005F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFB + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class FeatureMap(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000005F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFC + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ClusterRevision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000005F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass class OperationalState(Cluster): id: typing.ClassVar[int] = 0x00000060 diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index 6400bbbdf26e85..d9682c0187ce3b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -2408,6 +2408,48 @@ static BOOL AttributeIsSpecifiedInDishwasherAlarmCluster(AttributeId aAttributeI } } } +static BOOL AttributeIsSpecifiedInMicrowaveOvenControlCluster(AttributeId aAttributeId) +{ + using namespace Clusters::MicrowaveOvenControl; + switch (aAttributeId) { + case Attributes::CookTime::Id: { + return YES; + } + case Attributes::PowerSetting::Id: { + return YES; + } + case Attributes::MinPower::Id: { + return YES; + } + case Attributes::MaxPower::Id: { + return YES; + } + case Attributes::PowerStep::Id: { + return YES; + } + case Attributes::GeneratedCommandList::Id: { + return YES; + } + case Attributes::AcceptedCommandList::Id: { + return YES; + } + case Attributes::EventList::Id: { + return YES; + } + case Attributes::AttributeList::Id: { + return YES; + } + case Attributes::FeatureMap::Id: { + return YES; + } + case Attributes::ClusterRevision::Id: { + return YES; + } + default: { + return NO; + } + } +} static BOOL AttributeIsSpecifiedInOperationalStateCluster(AttributeId aAttributeId) { using namespace Clusters::OperationalState; @@ -5649,6 +5691,9 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::DishwasherAlarm::Id: { return AttributeIsSpecifiedInDishwasherAlarmCluster(aAttributeId); } + case Clusters::MicrowaveOvenControl::Id: { + return AttributeIsSpecifiedInMicrowaveOvenControlCluster(aAttributeId); + } case Clusters::OperationalState::Id: { return AttributeIsSpecifiedInOperationalStateCluster(aAttributeId); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 74adbc2c2ed52a..fe63b938dd74d2 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -6459,6 +6459,73 @@ static id _Nullable DecodeAttributeValueForDishwasherAlarmCluster(AttributeId aA *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } +static id _Nullable DecodeAttributeValueForMicrowaveOvenControlCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::MicrowaveOvenControl; + switch (aAttributeId) { + case Attributes::CookTime::Id: { + using TypeInfo = Attributes::CookTime::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::PowerSetting::Id: { + using TypeInfo = Attributes::PowerSetting::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::MinPower::Id: { + using TypeInfo = Attributes::MinPower::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::MaxPower::Id: { + using TypeInfo = Attributes::MaxPower::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::PowerStep::Id: { + using TypeInfo = Attributes::PowerStep::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} static id _Nullable DecodeAttributeValueForOperationalStateCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::OperationalState; @@ -15919,6 +15986,9 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::DishwasherAlarm::Id: { return DecodeAttributeValueForDishwasherAlarmCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::MicrowaveOvenControl::Id: { + return DecodeAttributeValueForMicrowaveOvenControlCluster(aPath.mAttributeId, aReader, aError); + } case Clusters::OperationalState::Id: { return DecodeAttributeValueForOperationalStateCluster(aPath.mAttributeId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 56a27d8ae18e8c..ba9b2092fc0abf 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -5710,6 +5710,106 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster Microwave Oven Control + * + * Attributes and commands for configuring the microwave oven control, and reporting cooking stats. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRBaseClusterMicrowaveOvenControl : MTRCluster + +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; + +/** + * Command SetCookingParameters + * + * Set Cooking Parameters + */ +- (void)setCookingParametersWithParams:(MTRMicrowaveOvenControlClusterSetCookingParametersParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command AddMoreTime + * + * Add More Cooking Time + */ +- (void)addMoreTimeWithParams:(MTRMicrowaveOvenControlClusterAddMoreTimeParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeCookTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeCookTimeWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeCookTimeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributePowerSettingWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributePowerSettingWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributePowerSettingWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMinPowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMinPowerWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMinPowerWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMaxPowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMaxPowerWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMaxPowerWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributePowerStepWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributePowerStepWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributePowerStepWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + /** * Cluster Operational State * diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 4e04fc5f85c6f5..c947aaff946788 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -45029,6 +45029,467 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end +@implementation MTRBaseClusterMicrowaveOvenControl + +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue +{ + if (self = [super initWithEndpointID:endpointID queue:queue]) { + if (device == nil) { + return nil; + } + + _device = device; + } + return self; +} + +- (void)setCookingParametersWithParams:(MTRMicrowaveOvenControlClusterSetCookingParametersParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRMicrowaveOvenControlClusterSetCookingParametersParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = MicrowaveOvenControl::Commands::SetCookingParameters::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)addMoreTimeWithParams:(MTRMicrowaveOvenControlClusterAddMoreTimeParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRMicrowaveOvenControlClusterAddMoreTimeParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = MicrowaveOvenControl::Commands::AddMoreTime::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)readAttributeCookTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::CookTime::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeCookTimeWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MicrowaveOvenControl::Attributes::CookTime::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeCookTimeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::CookTime::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributePowerSettingWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::PowerSetting::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributePowerSettingWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MicrowaveOvenControl::Attributes::PowerSetting::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributePowerSettingWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::PowerSetting::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMinPowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::MinPower::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMinPowerWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MicrowaveOvenControl::Attributes::MinPower::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMinPowerWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::MinPower::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMaxPowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::MaxPower::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMaxPowerWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MicrowaveOvenControl::Attributes::MaxPower::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMaxPowerWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::MaxPower::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributePowerStepWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::PowerStep::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributePowerStepWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MicrowaveOvenControl::Attributes::PowerStep::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributePowerStepWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::PowerStep::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::GeneratedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MicrowaveOvenControl::Attributes::GeneratedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::GeneratedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::AcceptedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MicrowaveOvenControl::Attributes::AcceptedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::AcceptedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::EventList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MicrowaveOvenControl::Attributes::EventList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::EventList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::AttributeList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MicrowaveOvenControl::Attributes::AttributeList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::AttributeList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::FeatureMap::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MicrowaveOvenControl::Attributes::FeatureMap::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::FeatureMap::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::ClusterRevision::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MicrowaveOvenControl::Attributes::ClusterRevision::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::ClusterRevision::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +@end + @implementation MTRBaseClusterOperationalState - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h index 29f0d7e466b672..fdb2f4f4517955 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h @@ -220,6 +220,10 @@ @property (nonatomic, strong, readonly) MTRBaseDevice * device; @end +@interface MTRBaseClusterMicrowaveOvenControl () +@property (nonatomic, strong, readonly) MTRBaseDevice * device; +@end + @interface MTRBaseClusterOperationalState () @property (nonatomic, strong, readonly) MTRBaseDevice * device; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index a0320b33fd3b36..a14a13f4496c75 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -138,6 +138,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeAirQualityID MTR_PROVISIONALLY_AVAILABLE = 0x0000005B, MTRClusterIDTypeSmokeCOAlarmID MTR_PROVISIONALLY_AVAILABLE = 0x0000005C, MTRClusterIDTypeDishwasherAlarmID MTR_PROVISIONALLY_AVAILABLE = 0x0000005D, + MTRClusterIDTypeMicrowaveOvenControlID MTR_PROVISIONALLY_AVAILABLE = 0x0000005F, MTRClusterIDTypeOperationalStateID MTR_PROVISIONALLY_AVAILABLE = 0x00000060, MTRClusterIDTypeRVCOperationalStateID MTR_PROVISIONALLY_AVAILABLE = 0x00000061, MTRClusterIDTypeHEPAFilterMonitoringID MTR_PROVISIONALLY_AVAILABLE = 0x00000071, @@ -2435,6 +2436,19 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterDishwasherAlarmAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, MTRAttributeIDTypeClusterDishwasherAlarmAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster MicrowaveOvenControl attributes + MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeCookTimeID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterMicrowaveOvenControlAttributePowerSettingID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeMinPowerID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeMaxPowerID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + MTRAttributeIDTypeClusterMicrowaveOvenControlAttributePowerStepID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, + MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, + MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeAttributeListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster OperationalState attributes MTRAttributeIDTypeClusterOperationalStateAttributePhaseListID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRAttributeIDTypeClusterOperationalStateAttributeCurrentPhaseID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, @@ -5981,6 +5995,10 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterDishwasherAlarmCommandResetID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRCommandIDTypeClusterDishwasherAlarmCommandModifyEnabledAlarmsID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + // Cluster MicrowaveOvenControl commands + MTRCommandIDTypeClusterMicrowaveOvenControlCommandSetCookingParametersID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRCommandIDTypeClusterMicrowaveOvenControlCommandAddMoreTimeID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + // Cluster OperationalState commands MTRCommandIDTypeClusterOperationalStateCommandPauseID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRCommandIDTypeClusterOperationalStateCommandStopID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index c3c7c512f33813..d1b3725e829164 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -2835,6 +2835,56 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster Microwave Oven Control + * Attributes and commands for configuring the microwave oven control, and reporting cooking stats. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRClusterMicrowaveOvenControl : MTRCluster + +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; + +/** + * The device this cluster object is associated with. + */ +@property (nonatomic, readonly) MTRDevice * device MTR_PROVISIONALLY_AVAILABLE; + +- (void)setCookingParametersWithParams:(MTRMicrowaveOvenControlClusterSetCookingParametersParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)addMoreTimeWithParams:(MTRMicrowaveOvenControlClusterAddMoreTimeParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeCookTimeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributePowerSettingWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMinPowerWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMaxPowerWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributePowerStepWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + /** * Cluster Operational State * This cluster supports remotely monitoring and, where supported, changing the operational state of any device where a state machine is a part of the operation. diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index ae12459f547741..acc0dbd3f888e7 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -8265,6 +8265,131 @@ - (void)modifyEnabledAlarmsWithParams:(MTRDishwasherAlarmClusterModifyEnabledAla @end +@implementation MTRClusterMicrowaveOvenControl + +- (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue +{ + if (self = [super initWithEndpointID:endpointID queue:queue]) { + if (device == nil) { + return nil; + } + + _device = device; + } + return self; +} + +- (void)setCookingParametersWithParams:(MTRMicrowaveOvenControlClusterSetCookingParametersParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRMicrowaveOvenControlClusterSetCookingParametersParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = MicrowaveOvenControl::Commands::SetCookingParameters::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)addMoreTimeWithParams:(MTRMicrowaveOvenControlClusterAddMoreTimeParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRMicrowaveOvenControlClusterAddMoreTimeParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = MicrowaveOvenControl::Commands::AddMoreTime::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (NSDictionary * _Nullable)readAttributeCookTimeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMicrowaveOvenControlID) attributeID:@(MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeCookTimeID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributePowerSettingWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMicrowaveOvenControlID) attributeID:@(MTRAttributeIDTypeClusterMicrowaveOvenControlAttributePowerSettingID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeMinPowerWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMicrowaveOvenControlID) attributeID:@(MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeMinPowerID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeMaxPowerWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMicrowaveOvenControlID) attributeID:@(MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeMaxPowerID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributePowerStepWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMicrowaveOvenControlID) attributeID:@(MTRAttributeIDTypeClusterMicrowaveOvenControlAttributePowerStepID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMicrowaveOvenControlID) attributeID:@(MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeGeneratedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMicrowaveOvenControlID) attributeID:@(MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeAcceptedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMicrowaveOvenControlID) attributeID:@(MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeEventListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMicrowaveOvenControlID) attributeID:@(MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeAttributeListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMicrowaveOvenControlID) attributeID:@(MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeFeatureMapID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMicrowaveOvenControlID) attributeID:@(MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeClusterRevisionID) params:params]; +} + +@end + @implementation MTRClusterOperationalState - (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.swift b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.swift index 22ff7e4fd07c90..e8691c021be3d4 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.swift +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.swift @@ -368,6 +368,13 @@ extension MTRClusterDishwasherAlarm { } } +@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) +extension MTRClusterMicrowaveOvenControl { + public convenience init(device : MTRDevice, endpointID: UInt) { + self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! + } +} + @available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) extension MTRClusterOperationalState { public convenience init(device : MTRDevice, endpointID: UInt) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 6a2bb522b42aad..9e6b0e19d006a4 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -4831,6 +4831,70 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRMicrowaveOvenControlClusterSetCookingParametersParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nullable cookMode MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable cookTime MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable powerSetting MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRMicrowaveOvenControlClusterAddMoreTimeParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull timeToAdd MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTROperationalStateClusterPauseParams : NSObject /** diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 386d6e02f5799d..8828803e61d273 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -13102,6 +13102,185 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end +@implementation MTRMicrowaveOvenControlClusterSetCookingParametersParams +- (instancetype)init +{ + if (self = [super init]) { + + _cookMode = nil; + + _cookTime = nil; + + _powerSetting = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRMicrowaveOvenControlClusterSetCookingParametersParams alloc] init]; + + other.cookMode = self.cookMode; + other.cookTime = self.cookTime; + other.powerSetting = self.powerSetting; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: cookMode:%@; cookTime:%@; powerSetting:%@; >", NSStringFromClass([self class]), _cookMode, _cookTime, _powerSetting]; + return descriptionString; +} + +@end + +@implementation MTRMicrowaveOvenControlClusterSetCookingParametersParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::MicrowaveOvenControl::Commands::SetCookingParameters::Type encodableStruct; + ListFreer listFreer; + { + if (self.cookMode != nil) { + auto & definedValue_0 = encodableStruct.cookMode.Emplace(); + definedValue_0 = self.cookMode.unsignedCharValue; + } + } + { + if (self.cookTime != nil) { + auto & definedValue_0 = encodableStruct.cookTime.Emplace(); + definedValue_0 = self.cookTime.unsignedIntValue; + } + } + { + if (self.powerSetting != nil) { + auto & definedValue_0 = encodableStruct.powerSetting.Emplace(); + definedValue_0 = self.powerSetting.unsignedCharValue; + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRMicrowaveOvenControlClusterAddMoreTimeParams +- (instancetype)init +{ + if (self = [super init]) { + + _timeToAdd = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRMicrowaveOvenControlClusterAddMoreTimeParams alloc] init]; + + other.timeToAdd = self.timeToAdd; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: timeToAdd:%@; >", NSStringFromClass([self class]), _timeToAdd]; + return descriptionString; +} + +@end + +@implementation MTRMicrowaveOvenControlClusterAddMoreTimeParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::MicrowaveOvenControl::Commands::AddMoreTime::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.timeToAdd = self.timeToAdd.unsignedIntValue; + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + @implementation MTROperationalStateClusterPauseParams - (instancetype)init { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index cc23f560d8fee7..0698f0c97c7a3b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -826,6 +826,18 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRMicrowaveOvenControlClusterSetCookingParametersParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRMicrowaveOvenControlClusterAddMoreTimeParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + @interface MTROperationalStateClusterPauseParams (InternalMethods) - (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm index 9bfe9808a3d775..176f814e1f2695 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm @@ -482,6 +482,15 @@ static BOOL CommandNeedsTimedInvokeInDishwasherAlarmCluster(AttributeId aAttribu } } } +static BOOL CommandNeedsTimedInvokeInMicrowaveOvenControlCluster(AttributeId aAttributeId) +{ + using namespace Clusters::MicrowaveOvenControl; + switch (aAttributeId) { + default: { + return NO; + } + } +} static BOOL CommandNeedsTimedInvokeInOperationalStateCluster(AttributeId aAttributeId) { using namespace Clusters::OperationalState; @@ -1071,6 +1080,9 @@ BOOL MTRCommandNeedsTimedInvoke(NSNumber * _Nonnull aClusterID, NSNumber * _Nonn case Clusters::DishwasherAlarm::Id: { return CommandNeedsTimedInvokeInDishwasherAlarmCluster(commandID); } + case Clusters::MicrowaveOvenControl::Id: { + return CommandNeedsTimedInvokeInMicrowaveOvenControlCluster(commandID); + } case Clusters::OperationalState::Id: { return CommandNeedsTimedInvokeInOperationalStateCluster(commandID); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 62d6915ce98264..a99f502e7ef567 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -2039,6 +2039,18 @@ static id _Nullable DecodeEventPayloadForDishwasherAlarmCluster(EventId aEventId *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } +static id _Nullable DecodeEventPayloadForMicrowaveOvenControlCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::MicrowaveOvenControl; + switch (aEventId) { + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} static id _Nullable DecodeEventPayloadForOperationalStateCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::OperationalState; @@ -3453,6 +3465,9 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::DishwasherAlarm::Id: { return DecodeEventPayloadForDishwasherAlarmCluster(aPath.mEventId, aReader, aError); } + case Clusters::MicrowaveOvenControl::Id: { + return DecodeEventPayloadForMicrowaveOvenControlCluster(aPath.mEventId, aReader, aError); + } case Clusters::OperationalState::Id: { return DecodeEventPayloadForOperationalStateCluster(aPath.mEventId, aReader, aError); } diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 374c60ca85fee1..9b37a5f2b3634f 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -8316,6 +8316,229 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace DishwasherAlarm +namespace MicrowaveOvenControl { +namespace Attributes { + +namespace CookTime { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); +} + +} // namespace CookTime + +namespace PowerSetting { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace PowerSetting + +namespace MinPower { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace MinPower + +namespace MaxPower { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace MaxPower + +namespace PowerStep { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace PowerStep + +namespace FeatureMap { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace MicrowaveOvenControl + namespace OperationalState { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 154e8cd0f01329..db36e68bedfd0d 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -1613,6 +1613,47 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace DishwasherAlarm +namespace MicrowaveOvenControl { +namespace Attributes { + +namespace CookTime { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // elapsed_s +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace CookTime + +namespace PowerSetting { +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +} // namespace PowerSetting + +namespace MinPower { +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +} // namespace MinPower + +namespace MaxPower { +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +} // namespace MaxPower + +namespace PowerStep { +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +} // namespace PowerStep + +namespace FeatureMap { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace FeatureMap + +namespace ClusterRevision { +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace MicrowaveOvenControl + namespace OperationalState { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index e684a60678084e..8911dd4f10d819 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -457,6 +457,14 @@ void emberAfSmokeCoAlarmClusterInitCallback(chip::EndpointId endpoint); */ void emberAfDishwasherAlarmClusterInitCallback(chip::EndpointId endpoint); +/** @brief Microwave Oven Control Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfMicrowaveOvenControlClusterInitCallback(chip::EndpointId endpoint); + /** @brief Operational State Cluster Init * * Cluster Init @@ -4911,6 +4919,82 @@ void emberAfDishwasherAlarmClusterServerTickCallback(chip::EndpointId endpoint); */ void emberAfDishwasherAlarmClusterClientTickCallback(chip::EndpointId endpoint); +// +// Microwave Oven Control Cluster +// + +/** @brief Microwave Oven Control Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfMicrowaveOvenControlClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief Microwave Oven Control Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterMicrowaveOvenControlClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** @brief Microwave Oven Control Cluster Client Init + * + * Client Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfMicrowaveOvenControlClusterClientInitCallback(chip::EndpointId endpoint); + +/** @brief Microwave Oven Control Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param attributePath Concrete attribute path that changed + */ +void MatterMicrowaveOvenControlClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** @brief Microwave Oven Control Cluster Server Pre Attribute Changed + * + * Server Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status MatterMicrowaveOvenControlClusterServerPreAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Microwave Oven Control Cluster Client Pre Attribute Changed + * + * Client Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status MatterMicrowaveOvenControlClusterClientPreAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Microwave Oven Control Cluster Server Tick + * + * Server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfMicrowaveOvenControlClusterServerTickCallback(chip::EndpointId endpoint); + +/** @brief Microwave Oven Control Cluster Client Tick + * + * Client Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfMicrowaveOvenControlClusterClientTickCallback(chip::EndpointId endpoint); + // // Operational State Cluster // @@ -8857,6 +8941,18 @@ bool emberAfDishwasherAlarmClusterResetCallback( bool emberAfDishwasherAlarmClusterModifyEnabledAlarmsCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::DishwasherAlarm::Commands::ModifyEnabledAlarms::DecodableType & commandData); +/** + * @brief Microwave Oven Control Cluster SetCookingParameters Command callback (from client) + */ +bool emberAfMicrowaveOvenControlClusterSetCookingParametersCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::MicrowaveOvenControl::Commands::SetCookingParameters::DecodableType & commandData); +/** + * @brief Microwave Oven Control Cluster AddMoreTime Command callback (from client) + */ +bool emberAfMicrowaveOvenControlClusterAddMoreTimeCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::MicrowaveOvenControl::Commands::AddMoreTime::DecodableType & commandData); /** * @brief Door Lock Cluster LockDoor Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 3c99edccb8242c..7ce7b602e43144 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -1848,6 +1848,8 @@ enum class Feature : uint32_t }; } // namespace DishwasherAlarm +namespace MicrowaveOvenControl {} // namespace MicrowaveOvenControl + namespace OperationalState { // Enum for ErrorStateEnum diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index c094c10b39790b..1e1b2bd29c8733 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -12024,6 +12024,125 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace Events } // namespace DishwasherAlarm +namespace MicrowaveOvenControl { + +namespace Commands { +namespace SetCookingParameters { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kCookMode), cookMode); + encoder.Encode(to_underlying(Fields::kCookTime), cookTime); + encoder.Encode(to_underlying(Fields::kPowerSetting), powerSetting); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kCookMode)) + { + err = DataModel::Decode(reader, cookMode); + } + else if (__context_tag == to_underlying(Fields::kCookTime)) + { + err = DataModel::Decode(reader, cookTime); + } + else if (__context_tag == to_underlying(Fields::kPowerSetting)) + { + err = DataModel::Decode(reader, powerSetting); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SetCookingParameters. +namespace AddMoreTime { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kTimeToAdd), timeToAdd); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kTimeToAdd)) + { + err = DataModel::Decode(reader, timeToAdd); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace AddMoreTime. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::CookTime::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, cookTime); + case Attributes::PowerSetting::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, powerSetting); + case Attributes::MinPower::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, minPower); + case Attributes::MaxPower::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, maxPower); + case Attributes::PowerStep::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, powerStep); + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::EventList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventList); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, attributeList); + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, featureMap); + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, clusterRevision); + default: + return CHIP_NO_ERROR; + } +} +} // namespace Attributes + +namespace Events {} // namespace Events + +} // namespace MicrowaveOvenControl namespace OperationalState { namespace Structs {} // namespace Structs @@ -22970,6 +23089,13 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::MicrowaveOvenControl::Id: { + switch (aCommand) + { + default: + return false; + } + } case Clusters::OperationalState::Id: { switch (aCommand) { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index bc7968f384ba38..91c37ab7cf81c3 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -16876,6 +16876,218 @@ struct DecodableType } // namespace Notify } // namespace Events } // namespace DishwasherAlarm +namespace MicrowaveOvenControl { + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace SetCookingParameters { +struct Type; +struct DecodableType; +} // namespace SetCookingParameters + +namespace AddMoreTime { +struct Type; +struct DecodableType; +} // namespace AddMoreTime + +} // namespace Commands + +namespace Commands { +namespace SetCookingParameters { +enum class Fields : uint8_t +{ + kCookMode = 0, + kCookTime = 1, + kPowerSetting = 2, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SetCookingParameters::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } + + Optional cookMode; + Optional cookTime; + Optional powerSetting; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::SetCookingParameters::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } + + Optional cookMode; + Optional cookTime; + Optional powerSetting; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SetCookingParameters +namespace AddMoreTime { +enum class Fields : uint8_t +{ + kTimeToAdd = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::AddMoreTime::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } + + uint32_t timeToAdd = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::AddMoreTime::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } + + uint32_t timeToAdd = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace AddMoreTime +} // namespace Commands + +namespace Attributes { + +namespace CookTime { +struct TypeInfo +{ + using Type = uint32_t; + using DecodableType = uint32_t; + using DecodableArgType = uint32_t; + + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CookTime::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CookTime +namespace PowerSetting { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::PowerSetting::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace PowerSetting +namespace MinPower { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MinPower::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MinPower +namespace MaxPower { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MaxPower::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MaxPower +namespace PowerStep { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::PowerStep::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace PowerStep +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::CookTime::TypeInfo::DecodableType cookTime = static_cast(0); + Attributes::PowerSetting::TypeInfo::DecodableType powerSetting = static_cast(0); + Attributes::MinPower::TypeInfo::DecodableType minPower = static_cast(0); + Attributes::MaxPower::TypeInfo::DecodableType maxPower = static_cast(0); + Attributes::PowerStep::TypeInfo::DecodableType powerStep = static_cast(0); + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::EventList::TypeInfo::DecodableType eventList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + }; +}; +} // namespace Attributes +} // namespace MicrowaveOvenControl namespace OperationalState { namespace Structs { namespace ErrorStateStruct = Clusters::detail::Structs::ErrorStateStruct; diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index d58e6eb18dd62a..d6685e05984fe9 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -3025,6 +3025,56 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace DishwasherAlarm +namespace MicrowaveOvenControl { +namespace Attributes { + +namespace CookTime { +static constexpr AttributeId Id = 0x00000001; +} // namespace CookTime + +namespace PowerSetting { +static constexpr AttributeId Id = 0x00000002; +} // namespace PowerSetting + +namespace MinPower { +static constexpr AttributeId Id = 0x00000003; +} // namespace MinPower + +namespace MaxPower { +static constexpr AttributeId Id = 0x00000004; +} // namespace MaxPower + +namespace PowerStep { +static constexpr AttributeId Id = 0x00000005; +} // namespace PowerStep + +namespace GeneratedCommandList { +static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; +} // namespace GeneratedCommandList + +namespace AcceptedCommandList { +static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; +} // namespace AcceptedCommandList + +namespace EventList { +static constexpr AttributeId Id = Globals::Attributes::EventList::Id; +} // namespace EventList + +namespace AttributeList { +static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; +} // namespace AttributeList + +namespace FeatureMap { +static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; +} // namespace FeatureMap + +namespace ClusterRevision { +static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace MicrowaveOvenControl + namespace OperationalState { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index 903a673b79e570..008cb452bdbe88 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -184,6 +184,9 @@ static constexpr ClusterId Id = 0x0000005C; namespace DishwasherAlarm { static constexpr ClusterId Id = 0x0000005D; } // namespace DishwasherAlarm +namespace MicrowaveOvenControl { +static constexpr ClusterId Id = 0x0000005F; +} // namespace MicrowaveOvenControl namespace OperationalState { static constexpr ClusterId Id = 0x00000060; } // namespace OperationalState diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index 299da9e744f32c..f8aef6170b41a7 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -753,6 +753,20 @@ static constexpr CommandId Id = 0x00000001; } // namespace Commands } // namespace DishwasherAlarm +namespace MicrowaveOvenControl { +namespace Commands { + +namespace SetCookingParameters { +static constexpr CommandId Id = 0x00000000; +} // namespace SetCookingParameters + +namespace AddMoreTime { +static constexpr CommandId Id = 0x00000001; +} // namespace AddMoreTime + +} // namespace Commands +} // namespace MicrowaveOvenControl + namespace OperationalState { namespace Commands { diff --git a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h index f3dbf7e60bc35d..80240a4c92f836 100644 --- a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h +++ b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h @@ -362,6 +362,13 @@ #define CHIP_PRINTCLUSTER_DISHWASHER_ALARM_CLUSTER #endif +#if defined(ZCL_USING_MICROWAVE_OVEN_CONTROL_CLUSTER_SERVER) || defined(ZCL_USING_MICROWAVE_OVEN_CONTROL_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_MICROWAVE_OVEN_CONTROL_CLUSTER \ + { chip::app::Clusters::MicrowaveOvenControl::Id, "Microwave Oven Control" }, +#else +#define CHIP_PRINTCLUSTER_MICROWAVE_OVEN_CONTROL_CLUSTER +#endif + #if defined(ZCL_USING_OPERATIONAL_STATE_CLUSTER_SERVER) || defined(ZCL_USING_OPERATIONAL_STATE_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_CLUSTER { chip::app::Clusters::OperationalState::Id, "Operational State" }, #else @@ -719,6 +726,7 @@ CHIP_PRINTCLUSTER_AIR_QUALITY_CLUSTER \ CHIP_PRINTCLUSTER_SMOKE_CO_ALARM_CLUSTER \ CHIP_PRINTCLUSTER_DISHWASHER_ALARM_CLUSTER \ + CHIP_PRINTCLUSTER_MICROWAVE_OVEN_CONTROL_CLUSTER \ CHIP_PRINTCLUSTER_OPERATIONAL_STATE_CLUSTER \ CHIP_PRINTCLUSTER_OPERATIONAL_STATE_RVC_CLUSTER \ CHIP_PRINTCLUSTER_HEPA_FILTER_MONITORING_CLUSTER \ diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index a70cdbbca288c3..cc4b4110263688 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -87,6 +87,7 @@ | AirQuality | 0x005B | | SmokeCoAlarm | 0x005C | | DishwasherAlarm | 0x005D | +| MicrowaveOvenControl | 0x005F | | OperationalState | 0x0060 | | RvcOperationalState | 0x0061 | | HepaFilterMonitoring | 0x0071 | @@ -5311,6 +5312,107 @@ class DishwasherAlarmModifyEnabledAlarms : public ClusterCommand chip::app::Clusters::DishwasherAlarm::Commands::ModifyEnabledAlarms::Type mRequest; }; +/*----------------------------------------------------------------------------*\ +| Cluster MicrowaveOvenControl | 0x005F | +|------------------------------------------------------------------------------| +| Commands: | | +| * SetCookingParameters | 0x00 | +| * AddMoreTime | 0x01 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * CookTime | 0x0001 | +| * PowerSetting | 0x0002 | +| * MinPower | 0x0003 | +| * MaxPower | 0x0004 | +| * PowerStep | 0x0005 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Command SetCookingParameters + */ +class MicrowaveOvenControlSetCookingParameters : public ClusterCommand +{ +public: + MicrowaveOvenControlSetCookingParameters(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("set-cooking-parameters", credsIssuerConfig) + { + AddArgument("CookMode", 0, UINT8_MAX, &mRequest.cookMode); + AddArgument("CookTime", 0, UINT32_MAX, &mRequest.cookTime); + AddArgument("PowerSetting", 0, UINT8_MAX, &mRequest.powerSetting); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::MicrowaveOvenControl::Commands::SetCookingParameters::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::MicrowaveOvenControl::Commands::SetCookingParameters::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::MicrowaveOvenControl::Commands::SetCookingParameters::Type mRequest; +}; + +/* + * Command AddMoreTime + */ +class MicrowaveOvenControlAddMoreTime : public ClusterCommand +{ +public: + MicrowaveOvenControlAddMoreTime(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("add-more-time", credsIssuerConfig) + { + AddArgument("TimeToAdd", 0, UINT32_MAX, &mRequest.timeToAdd); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::MicrowaveOvenControl::Commands::AddMoreTime::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::MicrowaveOvenControl::Commands::AddMoreTime::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::MicrowaveOvenControl::Commands::AddMoreTime::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster OperationalState | 0x0060 | |------------------------------------------------------------------------------| @@ -15989,6 +16091,79 @@ void registerClusterDishwasherAlarm(Commands & commands, CredentialIssuerCommand commands.RegisterCluster(clusterName, clusterCommands); } +void registerClusterMicrowaveOvenControl(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::MicrowaveOvenControl; + + const char * clusterName = "MicrowaveOvenControl"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "cook-time", Attributes::CookTime::Id, credsIssuerConfig), // + make_unique(Id, "power-setting", Attributes::PowerSetting::Id, credsIssuerConfig), // + make_unique(Id, "min-power", Attributes::MinPower::Id, credsIssuerConfig), // + make_unique(Id, "max-power", Attributes::MaxPower::Id, credsIssuerConfig), // + make_unique(Id, "power-step", Attributes::PowerStep::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique>(Id, credsIssuerConfig), // + make_unique>(Id, "cook-time", 0, UINT32_MAX, Attributes::CookTime::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "power-setting", 0, UINT8_MAX, Attributes::PowerSetting::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "min-power", 0, UINT8_MAX, Attributes::MinPower::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>(Id, "max-power", 0, UINT8_MAX, Attributes::MaxPower::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>(Id, "power-step", 0, UINT8_MAX, Attributes::PowerStep::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "cook-time", Attributes::CookTime::Id, credsIssuerConfig), // + make_unique(Id, "power-setting", Attributes::PowerSetting::Id, credsIssuerConfig), // + make_unique(Id, "min-power", Attributes::MinPower::Id, credsIssuerConfig), // + make_unique(Id, "max-power", Attributes::MaxPower::Id, credsIssuerConfig), // + make_unique(Id, "power-step", Attributes::PowerStep::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +} void registerClusterOperationalState(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::OperationalState; @@ -21657,6 +21832,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterAirQuality(commands, credsIssuerConfig); registerClusterSmokeCoAlarm(commands, credsIssuerConfig); registerClusterDishwasherAlarm(commands, credsIssuerConfig); + registerClusterMicrowaveOvenControl(commands, credsIssuerConfig); registerClusterOperationalState(commands, credsIssuerConfig); registerClusterRvcOperationalState(commands, credsIssuerConfig); registerClusterHepaFilterMonitoring(commands, credsIssuerConfig); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 2b6081b77e0f4b..bfc126a803e51e 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -8761,6 +8761,67 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case MicrowaveOvenControl::Id: { + switch (path.mAttributeId) + { + case MicrowaveOvenControl::Attributes::CookTime::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CookTime", 1, value); + } + case MicrowaveOvenControl::Attributes::PowerSetting::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PowerSetting", 1, value); + } + case MicrowaveOvenControl::Attributes::MinPower::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MinPower", 1, value); + } + case MicrowaveOvenControl::Attributes::MaxPower::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MaxPower", 1, value); + } + case MicrowaveOvenControl::Attributes::PowerStep::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PowerStep", 1, value); + } + case MicrowaveOvenControl::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + } + case MicrowaveOvenControl::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + } + case MicrowaveOvenControl::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventList", 1, value); + } + case MicrowaveOvenControl::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AttributeList", 1, value); + } + case MicrowaveOvenControl::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case MicrowaveOvenControl::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } case OperationalState::Id: { switch (path.mAttributeId) { 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 6fa4deb1bb9bbd..1e434271064beb 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -90,6 +90,7 @@ | AirQuality | 0x005B | | SmokeCoAlarm | 0x005C | | DishwasherAlarm | 0x005D | +| MicrowaveOvenControl | 0x005F | | OperationalState | 0x0060 | | RvcOperationalState | 0x0061 | | HepaFilterMonitoring | 0x0071 | @@ -62529,6 +62530,1045 @@ class SubscribeAttributeDishwasherAlarmClusterRevision : public SubscribeAttribu #endif // MTR_ENABLE_PROVISIONAL #endif // MTR_ENABLE_PROVISIONAL +/*----------------------------------------------------------------------------*\ +| Cluster MicrowaveOvenControl | 0x005F | +|------------------------------------------------------------------------------| +| Commands: | | +| * SetCookingParameters | 0x00 | +| * AddMoreTime | 0x01 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * CookTime | 0x0001 | +| * PowerSetting | 0x0002 | +| * MinPower | 0x0003 | +| * MaxPower | 0x0004 | +| * PowerStep | 0x0005 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Command SetCookingParameters + */ +class MicrowaveOvenControlSetCookingParameters : public ClusterCommand { +public: + MicrowaveOvenControlSetCookingParameters() + : ClusterCommand("set-cooking-parameters") + { + AddArgument("CookMode", 0, UINT8_MAX, &mRequest.cookMode); + AddArgument("CookTime", 0, UINT32_MAX, &mRequest.cookTime); + AddArgument("PowerSetting", 0, UINT8_MAX, &mRequest.powerSetting); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::MicrowaveOvenControl::Commands::SetCookingParameters::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRMicrowaveOvenControlClusterSetCookingParametersParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + if (mRequest.cookMode.HasValue()) { + params.cookMode = [NSNumber numberWithUnsignedChar:mRequest.cookMode.Value()]; + } else { + params.cookMode = nil; + } + if (mRequest.cookTime.HasValue()) { + params.cookTime = [NSNumber numberWithUnsignedInt:mRequest.cookTime.Value()]; + } else { + params.cookTime = nil; + } + if (mRequest.powerSetting.HasValue()) { + params.powerSetting = [NSNumber numberWithUnsignedChar:mRequest.powerSetting.Value()]; + } else { + params.powerSetting = nil; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setCookingParametersWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::MicrowaveOvenControl::Commands::SetCookingParameters::Type mRequest; +}; + +/* + * Command AddMoreTime + */ +class MicrowaveOvenControlAddMoreTime : public ClusterCommand { +public: + MicrowaveOvenControlAddMoreTime() + : ClusterCommand("add-more-time") + { + AddArgument("TimeToAdd", 0, UINT32_MAX, &mRequest.timeToAdd); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::MicrowaveOvenControl::Commands::AddMoreTime::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRMicrowaveOvenControlClusterAddMoreTimeParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.timeToAdd = [NSNumber numberWithUnsignedInt:mRequest.timeToAdd]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster addMoreTimeWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::MicrowaveOvenControl::Commands::AddMoreTime::Type mRequest; +}; + +/* + * Attribute CookTime + */ +class ReadMicrowaveOvenControlCookTime : public ReadAttribute { +public: + ReadMicrowaveOvenControlCookTime() + : ReadAttribute("cook-time") + { + } + + ~ReadMicrowaveOvenControlCookTime() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::CookTime::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeCookTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.CookTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MicrowaveOvenControl CookTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMicrowaveOvenControlCookTime : public SubscribeAttribute { +public: + SubscribeAttributeMicrowaveOvenControlCookTime() + : SubscribeAttribute("cook-time") + { + } + + ~SubscribeAttributeMicrowaveOvenControlCookTime() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::CookTime::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeCookTimeWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.CookTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute PowerSetting + */ +class ReadMicrowaveOvenControlPowerSetting : public ReadAttribute { +public: + ReadMicrowaveOvenControlPowerSetting() + : ReadAttribute("power-setting") + { + } + + ~ReadMicrowaveOvenControlPowerSetting() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::PowerSetting::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributePowerSettingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.PowerSetting response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MicrowaveOvenControl PowerSetting read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMicrowaveOvenControlPowerSetting : public SubscribeAttribute { +public: + SubscribeAttributeMicrowaveOvenControlPowerSetting() + : SubscribeAttribute("power-setting") + { + } + + ~SubscribeAttributeMicrowaveOvenControlPowerSetting() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::PowerSetting::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributePowerSettingWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.PowerSetting response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute MinPower + */ +class ReadMicrowaveOvenControlMinPower : public ReadAttribute { +public: + ReadMicrowaveOvenControlMinPower() + : ReadAttribute("min-power") + { + } + + ~ReadMicrowaveOvenControlMinPower() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::MinPower::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMinPowerWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.MinPower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MicrowaveOvenControl MinPower read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMicrowaveOvenControlMinPower : public SubscribeAttribute { +public: + SubscribeAttributeMicrowaveOvenControlMinPower() + : SubscribeAttribute("min-power") + { + } + + ~SubscribeAttributeMicrowaveOvenControlMinPower() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::MinPower::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeMinPowerWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.MinPower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute MaxPower + */ +class ReadMicrowaveOvenControlMaxPower : public ReadAttribute { +public: + ReadMicrowaveOvenControlMaxPower() + : ReadAttribute("max-power") + { + } + + ~ReadMicrowaveOvenControlMaxPower() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::MaxPower::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMaxPowerWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.MaxPower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MicrowaveOvenControl MaxPower read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMicrowaveOvenControlMaxPower : public SubscribeAttribute { +public: + SubscribeAttributeMicrowaveOvenControlMaxPower() + : SubscribeAttribute("max-power") + { + } + + ~SubscribeAttributeMicrowaveOvenControlMaxPower() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::MaxPower::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeMaxPowerWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.MaxPower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute PowerStep + */ +class ReadMicrowaveOvenControlPowerStep : public ReadAttribute { +public: + ReadMicrowaveOvenControlPowerStep() + : ReadAttribute("power-step") + { + } + + ~ReadMicrowaveOvenControlPowerStep() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::PowerStep::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributePowerStepWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.PowerStep response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MicrowaveOvenControl PowerStep read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMicrowaveOvenControlPowerStep : public SubscribeAttribute { +public: + SubscribeAttributeMicrowaveOvenControlPowerStep() + : SubscribeAttribute("power-step") + { + } + + ~SubscribeAttributeMicrowaveOvenControlPowerStep() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::PowerStep::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributePowerStepWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.PowerStep response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadMicrowaveOvenControlGeneratedCommandList : public ReadAttribute { +public: + ReadMicrowaveOvenControlGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadMicrowaveOvenControlGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MicrowaveOvenControl GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMicrowaveOvenControlGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeMicrowaveOvenControlGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeMicrowaveOvenControlGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeGeneratedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadMicrowaveOvenControlAcceptedCommandList : public ReadAttribute { +public: + ReadMicrowaveOvenControlAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadMicrowaveOvenControlAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MicrowaveOvenControl AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMicrowaveOvenControlAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeMicrowaveOvenControlAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeMicrowaveOvenControlAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAcceptedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute EventList + */ +class ReadMicrowaveOvenControlEventList : public ReadAttribute { +public: + ReadMicrowaveOvenControlEventList() + : ReadAttribute("event-list") + { + } + + ~ReadMicrowaveOvenControlEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MicrowaveOvenControl EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMicrowaveOvenControlEventList : public SubscribeAttribute { +public: + SubscribeAttributeMicrowaveOvenControlEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeMicrowaveOvenControlEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeEventListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL + +/* + * Attribute AttributeList + */ +class ReadMicrowaveOvenControlAttributeList : public ReadAttribute { +public: + ReadMicrowaveOvenControlAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadMicrowaveOvenControlAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MicrowaveOvenControl AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMicrowaveOvenControlAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeMicrowaveOvenControlAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeMicrowaveOvenControlAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAttributeListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute FeatureMap + */ +class ReadMicrowaveOvenControlFeatureMap : public ReadAttribute { +public: + ReadMicrowaveOvenControlFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadMicrowaveOvenControlFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MicrowaveOvenControl FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMicrowaveOvenControlFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeMicrowaveOvenControlFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeMicrowaveOvenControlFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeFeatureMapWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadMicrowaveOvenControlClusterRevision : public ReadAttribute { +public: + ReadMicrowaveOvenControlClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadMicrowaveOvenControlClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MicrowaveOvenControl ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMicrowaveOvenControlClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeMicrowaveOvenControlClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeMicrowaveOvenControlClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeClusterRevisionWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + #if MTR_ENABLE_PROVISIONAL /*----------------------------------------------------------------------------*\ | Cluster OperationalState | 0x0060 | @@ -156252,6 +157292,47 @@ void registerClusterDishwasherAlarm(Commands & commands) commands.RegisterCluster(clusterName, clusterCommands); #endif // MTR_ENABLE_PROVISIONAL } +void registerClusterMicrowaveOvenControl(Commands & commands) +{ + using namespace chip::app::Clusters::MicrowaveOvenControl; + + const char * clusterName = "MicrowaveOvenControl"; + + commands_list clusterCommands = { + make_unique(Id), // + make_unique(), // + make_unique(), // + make_unique(Id), // + make_unique(Id), // + make_unique(Id), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +} void registerClusterOperationalState(Commands & commands) { #if MTR_ENABLE_PROVISIONAL @@ -159667,6 +160748,7 @@ void registerClusters(Commands & commands) registerClusterAirQuality(commands); registerClusterSmokeCoAlarm(commands); registerClusterDishwasherAlarm(commands); + registerClusterMicrowaveOvenControl(commands); registerClusterOperationalState(commands); registerClusterRvcOperationalState(commands); registerClusterHepaFilterMonitoring(commands); From e68186fff26d13716fb6433716b84ba6c3107903 Mon Sep 17 00:00:00 2001 From: Dieter Van der Meulen <87530904+dvdm-qorvo@users.noreply.github.com> Date: Tue, 31 Oct 2023 21:11:57 +0100 Subject: [PATCH 09/12] [QPG] QPG SDK feature updates. (#30094) * add option in build_examples.py script to update the SW version * enable commands, set featuremap bit for check-in support * Use schedule lambda when triggering commissioning cycle * Fixing the OTA build * implementation of GetNetworkInterfaces function * Fix for lock operation events that did not get triggered * Update light and lock ZAP files to align with latest Matter requirements * auto-start BLE commissioning only if NO fabrics known * enable ICD server feature on lock app * TotalOperationalHours attribute is disabled so don't store to NVM anymore * Add jammed lock event trigger on button. --- examples/lighting-app/qpg/args.gni | 2 - examples/lighting-app/qpg/src/AppTask.cpp | 20 +- examples/lighting-app/qpg/zap/light.matter | 26 -- examples/lighting-app/qpg/zap/light.zap | 276 ------------- examples/lock-app/qpg/args.gni | 3 +- examples/lock-app/qpg/include/AppConfig.h | 1 + examples/lock-app/qpg/include/AppTask.h | 2 + .../lock-app/qpg/include/BoltLockManager.h | 7 - examples/lock-app/qpg/src/AppTask.cpp | 44 +- examples/lock-app/qpg/src/BoltLockManager.cpp | 62 +-- examples/lock-app/qpg/src/ZclCallbacks.cpp | 18 +- examples/lock-app/qpg/zap/lock.matter | 77 +++- examples/lock-app/qpg/zap/lock.zap | 382 +++++++----------- scripts/build/build/targets.py | 2 + scripts/build/builders/qpg.py | 6 +- .../build/testdata/all_targets_linux_x64.txt | 2 +- src/platform/qpg/ConfigurationManagerImpl.cpp | 5 - .../qpg/DiagnosticDataProviderImpl.cpp | 23 ++ src/platform/qpg/DiagnosticDataProviderImpl.h | 1 + third_party/qpg_sdk/qpg_executable.gni | 21 - third_party/qpg_sdk/qpg_sdk.gni | 26 ++ 21 files changed, 343 insertions(+), 663 deletions(-) diff --git a/examples/lighting-app/qpg/args.gni b/examples/lighting-app/qpg/args.gni index e19f57f7d483d6..ea22dfd187fbb2 100644 --- a/examples/lighting-app/qpg/args.gni +++ b/examples/lighting-app/qpg/args.gni @@ -29,8 +29,6 @@ chip_stack_lock_tracking = "none" matter_device_vid = "0xFFF1" matter_device_pid = "0x8005" -matter_device_software_version = "0x0001" -matter_device_software_version_string = "1.0" pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" pw_assert_BACKEND = "$dir_pw_assert_log:check_backend" diff --git a/examples/lighting-app/qpg/src/AppTask.cpp b/examples/lighting-app/qpg/src/AppTask.cpp index c4fe7ff0c06e91..5781e4069ad1eb 100644 --- a/examples/lighting-app/qpg/src/AppTask.cpp +++ b/examples/lighting-app/qpg/src/AppTask.cpp @@ -257,15 +257,23 @@ void AppTask::InitServer(intptr_t arg) // Open commissioning after boot if no fabric was available if (chip::Server::GetInstance().GetFabricTable().FabricCount() == 0) { - PlatformMgr().ScheduleWork(OpenCommissioning, 0); + ChipLogProgress(NotSpecified, "No fabrics, starting commissioning."); + AppTask::OpenCommissioning((intptr_t) 0); } } void AppTask::OpenCommissioning(intptr_t arg) { // Enable BLE advertisements - chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow(); - ChipLogProgress(NotSpecified, "BLE advertising started. Waiting for Pairing."); + + SystemLayer().ScheduleLambda([] { + CHIP_ERROR err; + err = chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow(); + if (err == CHIP_NO_ERROR) + { + ChipLogProgress(NotSpecified, "BLE advertising started. Waiting for Pairing."); + } + }); } CHIP_ERROR AppTask::Init() @@ -486,10 +494,8 @@ void AppTask::FunctionHandler(AppEvent * aEvent) else { // Enable BLE advertisements and pairing window - if (chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow() == CHIP_NO_ERROR) - { - ChipLogProgress(NotSpecified, "BLE advertising started. Waiting for Pairing."); - } + AppTask::OpenCommissioning((intptr_t) 0); + ChipLogProgress(NotSpecified, "BLE advertising started. Waiting for Pairing."); } } else if (sAppTask.mFunctionTimerActive && sAppTask.mFunction == kFunction_SoftwareUpdate) diff --git a/examples/lighting-app/qpg/zap/light.matter b/examples/lighting-app/qpg/zap/light.matter index d0f37c17c22356..61efe83c64c161 100644 --- a/examples/lighting-app/qpg/zap/light.matter +++ b/examples/lighting-app/qpg/zap/light.matter @@ -206,9 +206,6 @@ server cluster LevelControl = 8 { readonly attribute int16u remainingTime = 1; readonly attribute int8u minLevel = 2; readonly attribute int8u maxLevel = 3; - readonly attribute int16u currentFrequency = 4; - readonly attribute int16u minFrequency = 5; - readonly attribute int16u maxFrequency = 6; attribute LevelControlOptions options = 15; attribute nullable int8u onLevel = 17; attribute access(write: manage) nullable int8u startUpCurrentLevel = 16384; @@ -957,7 +954,6 @@ server cluster GeneralDiagnostics = 51 { readonly attribute NetworkInterface networkInterfaces[] = 0; readonly attribute int16u rebootCount = 1; readonly attribute int64u upTime = 2; - readonly attribute int32u totalOperationalHours = 3; readonly attribute BootReasonEnum bootReason = 4; readonly attribute HardwareFaultEnum activeHardwareFaults[] = 5; readonly attribute RadioFaultEnum activeRadioFaults[] = 6; @@ -1873,7 +1869,6 @@ endpoint 0 { callback attribute networkInterfaces; callback attribute rebootCount default = 0x0000; callback attribute upTime default = 0x0000000000000000; - callback attribute totalOperationalHours default = 0x00000000; callback attribute bootReason; callback attribute activeHardwareFaults; callback attribute activeRadioFaults; @@ -2115,9 +2110,6 @@ endpoint 1 { ram attribute remainingTime default = 0x0000; ram attribute minLevel default = 0x01; ram attribute maxLevel default = 0xFE; - ram attribute currentFrequency default = 0x0000; - ram attribute minFrequency default = 0x0000; - ram attribute maxFrequency default = 0x0000; ram attribute options default = 0x00; ram attribute onLevel default = 0xFF; persist attribute startUpCurrentLevel default = 255; @@ -2149,24 +2141,6 @@ endpoint 1 { callback attribute clusterRevision default = 1; } - server cluster FixedLabel { - callback attribute labelList; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster UserLabel { - callback attribute labelList; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster ColorControl { ram attribute currentHue default = 0x00; ram attribute currentSaturation default = 0x00; diff --git a/examples/lighting-app/qpg/zap/light.zap b/examples/lighting-app/qpg/zap/light.zap index af746454e6158a..897774c9d8167a 100644 --- a/examples/lighting-app/qpg/zap/light.zap +++ b/examples/lighting-app/qpg/zap/light.zap @@ -1782,22 +1782,6 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "TotalOperationalHours", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "BootReason", "code": 4, @@ -4793,54 +4777,6 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "CurrentFrequency", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "MinFrequency", - "code": 5, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "MaxFrequency", - "code": 6, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "Options", "code": 15, @@ -5125,218 +5061,6 @@ } ] }, - { - "name": "Fixed Label", - "code": 64, - "mfgCode": null, - "define": "FIXED_LABEL_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "LabelList", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "User Label", - "code": 65, - "mfgCode": null, - "define": "USER_LABEL_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "LabelList", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, { "name": "Color Control", "code": 768, diff --git a/examples/lock-app/qpg/args.gni b/examples/lock-app/qpg/args.gni index 9a51da863c921f..d5dcdfe217c635 100644 --- a/examples/lock-app/qpg/args.gni +++ b/examples/lock-app/qpg/args.gni @@ -22,6 +22,7 @@ qpg_sdk_target = get_label_info(":sdk", "label_no_toolchain") chip_enable_ota_requestor = true chip_openthread_ftd = false enable_sleepy_device = true +chip_enable_icd_server = true # Disable lock tracking, since our FreeRTOS configuration does not set # INCLUDE_xSemaphoreGetMutexHolder @@ -29,8 +30,6 @@ chip_stack_lock_tracking = "none" matter_device_vid = "0xFFF1" matter_device_pid = "0x8006" -matter_device_software_version = "0x0001" -matter_device_software_version_string = "1.0" pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" pw_assert_BACKEND = "$dir_pw_assert_log:check_backend" diff --git a/examples/lock-app/qpg/include/AppConfig.h b/examples/lock-app/qpg/include/AppConfig.h index 2f2cb7cd385cf3..b5947d8641bad6 100644 --- a/examples/lock-app/qpg/include/AppConfig.h +++ b/examples/lock-app/qpg/include/AppConfig.h @@ -23,6 +23,7 @@ #define APP_TASK_NAME "APP" #define APP_LOCK_BUTTON BTN_SW4 #define APP_FUNCTION_BUTTON BTN_SW5 +#define APP_LOCK_JAMMED_BUTTON BTN_SW1 #define SYSTEM_STATE_LED LED_GREEN #define LOCK_STATE_LED LED_WHITE diff --git a/examples/lock-app/qpg/include/AppTask.h b/examples/lock-app/qpg/include/AppTask.h index 3219c5676036f9..3734eeadeef816 100644 --- a/examples/lock-app/qpg/include/AppTask.h +++ b/examples/lock-app/qpg/include/AppTask.h @@ -66,6 +66,7 @@ class AppTask static void FunctionTimerEventHandler(AppEvent * aEvent); static void FunctionHandler(AppEvent * aEvent); static void LockActionEventHandler(AppEvent * aEvent); + static void JammedLockEventHandler(AppEvent * aEvent); static void TimerEventHandler(chip::System::Layer * aLayer, void * aAppState); static void MatterEventHandler(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg); @@ -86,6 +87,7 @@ class AppTask Function_t mFunction; bool mFunctionTimerActive; bool mSyncClusterToButtonAction; + bool mNotifyState; chip::DeviceLayer::FactoryDataProvider mFactoryDataProvider; diff --git a/examples/lock-app/qpg/include/BoltLockManager.h b/examples/lock-app/qpg/include/BoltLockManager.h index c80e3555fc8d3d..0afef972db93b4 100644 --- a/examples/lock-app/qpg/include/BoltLockManager.h +++ b/examples/lock-app/qpg/include/BoltLockManager.h @@ -65,8 +65,6 @@ class BoltLockManager CHIP_ERROR Init(); bool IsUnlocked(); - void EnableAutoRelock(bool aOn); - void SetAutoLockDuration(uint32_t aDurationInSecs); bool IsActionInProgress(); bool InitiateAction(int32_t aActor, Action_t aAction); @@ -92,15 +90,10 @@ class BoltLockManager Callback_fn_initiated mActionInitiated_CB; Callback_fn_completed mActionCompleted_CB; - bool mAutoRelock; - uint32_t mAutoLockDuration; - bool mAutoLockTimerArmed; - void CancelTimer(void); void StartTimer(uint32_t aTimeoutMs); static void TimerEventHandler(TimerHandle_t xTimer); - static void AutoReLockTimerEventHandler(AppEvent * aEvent); static void ActuatorMovementTimerEventHandler(AppEvent * aEvent); static BoltLockManager sLock; diff --git a/examples/lock-app/qpg/src/AppTask.cpp b/examples/lock-app/qpg/src/AppTask.cpp index 3466d8c4a4c395..8bbd6b7ce19a8a 100644 --- a/examples/lock-app/qpg/src/AppTask.cpp +++ b/examples/lock-app/qpg/src/AppTask.cpp @@ -260,6 +260,23 @@ void AppTask::AppTaskMain(void * pvParameter) } } +void AppTask::JammedLockEventHandler(AppEvent * aEvent) +{ + SystemLayer().ScheduleLambda([] { + bool retVal; + + retVal = DoorLockServer::Instance().SendLockAlarmEvent(QPG_LOCK_ENDPOINT_ID, AlarmCodeEnum::kLockJammed); + if (!retVal) + { + ChipLogProgress(NotSpecified, "[BTN] Lock jammed event send failed"); + } + else + { + ChipLogProgress(NotSpecified, "[BTN] Lock jammed event sent"); + } + }); +} + void AppTask::LockActionEventHandler(AppEvent * aEvent) { bool initiated = false; @@ -302,7 +319,7 @@ void AppTask::LockActionEventHandler(AppEvent * aEvent) void AppTask::ButtonEventHandler(uint8_t btnIdx, bool btnPressed) { - if (btnIdx != APP_LOCK_BUTTON && btnIdx != APP_FUNCTION_BUTTON) + if (btnIdx != APP_LOCK_BUTTON && btnIdx != APP_FUNCTION_BUTTON && btnIdx != APP_LOCK_JAMMED_BUTTON) { return; } @@ -316,6 +333,10 @@ void AppTask::ButtonEventHandler(uint8_t btnIdx, bool btnPressed) { button_event.Handler = LockActionEventHandler; } + else if (btnIdx == APP_LOCK_JAMMED_BUTTON && btnPressed == true) + { + button_event.Handler = JammedLockEventHandler; + } else if (btnIdx == APP_FUNCTION_BUTTON) { // Hand off to Functionality handler - depends on duration of press @@ -511,6 +532,11 @@ void AppTask::ActionInitiated(BoltLockManager::Action_t aAction, int32_t aActor) sAppTask.mSyncClusterToButtonAction = true; } + if (aActor == AppEvent::kEventType_Lock) + { + sAppTask.mNotifyState = true; + } + qvIO_LedBlink(LOCK_STATE_LED, 50, 50); } @@ -532,10 +558,11 @@ void AppTask::ActionCompleted(BoltLockManager::Action_t aAction) qvIO_LedSet(LOCK_STATE_LED, false); } - if (sAppTask.mSyncClusterToButtonAction) + if (sAppTask.mSyncClusterToButtonAction || sAppTask.mNotifyState) { sAppTask.UpdateClusterState(); sAppTask.mSyncClusterToButtonAction = false; + sAppTask.mNotifyState = false; } } @@ -585,6 +612,7 @@ void AppTask::UpdateClusterState(void) auto newValue = BoltLockMgr().IsUnlocked() ? DoorLock::DlLockState::kUnlocked : DoorLock::DlLockState::kLocked; SystemLayer().ScheduleLambda([newValue] { + bool retVal = true; chip::app::DataModel::Nullable currentLockState; chip::app::Clusters::DoorLock::Attributes::LockState::Get(QPG_LOCK_ENDPOINT_ID, currentLockState); @@ -599,7 +627,17 @@ void AppTask::UpdateClusterState(void) else { ChipLogProgress(NotSpecified, "Updating LockState attribute"); - if (!DoorLockServer::Instance().SetLockState(QPG_LOCK_ENDPOINT_ID, newValue)) + if (sAppTask.mSyncClusterToButtonAction) + { + retVal = DoorLockServer::Instance().SetLockState(QPG_LOCK_ENDPOINT_ID, newValue, OperationSourceEnum::kManual); + } + + if (retVal && sAppTask.mNotifyState) + { + retVal = DoorLockServer::Instance().SetLockState(QPG_LOCK_ENDPOINT_ID, newValue, OperationSourceEnum::kRemote); + } + + if (!retVal) { ChipLogError(NotSpecified, "ERR: updating DoorLock"); } diff --git a/examples/lock-app/qpg/src/BoltLockManager.cpp b/examples/lock-app/qpg/src/BoltLockManager.cpp index 44bb81abaebdc8..e06c34535238c7 100644 --- a/examples/lock-app/qpg/src/BoltLockManager.cpp +++ b/examples/lock-app/qpg/src/BoltLockManager.cpp @@ -58,10 +58,7 @@ CHIP_ERROR BoltLockManager::Init() return APP_ERROR_CREATE_TIMER_FAILED; } - mState = kState_LockingCompleted; - mAutoLockTimerArmed = false; - mAutoRelock = false; - mAutoLockDuration = 0; + mState = kState_LockingCompleted; return CHIP_NO_ERROR; } @@ -82,16 +79,6 @@ bool BoltLockManager::IsUnlocked() return (mState == kState_UnlockingCompleted); } -void BoltLockManager::EnableAutoRelock(bool aOn) -{ - mAutoRelock = aOn; -} - -void BoltLockManager::SetAutoLockDuration(uint32_t aDurationInSecs) -{ - mAutoLockDuration = aDurationInSecs; -} - bool BoltLockManager::GetUser(uint16_t userIndex, EmberAfPluginDoorLockUserInfo & user) const { user = mUsers[userIndex - 1]; @@ -224,15 +211,6 @@ bool BoltLockManager::InitiateAction(int32_t aActor, Action_t aAction) if (action_initiated) { - if (mAutoLockTimerArmed && new_state == kState_LockingInitiated) - { - // If auto lock timer has been armed and someone initiates locking, - // cancel the timer and continue as normal. - mAutoLockTimerArmed = false; - - CancelTimer(); - } - StartTimer(ACTUATOR_MOVEMENT_PERIOS_MS); // Since the timer started successfully, update the state and trigger callback @@ -285,35 +263,10 @@ void BoltLockManager::TimerEventHandler(TimerHandle_t xTimer) AppEvent event; event.Type = AppEvent::kEventType_Timer; event.TimerEvent.Context = lock; - if (lock->mAutoLockTimerArmed) - { - event.Handler = AutoReLockTimerEventHandler; - } - else - { - event.Handler = ActuatorMovementTimerEventHandler; - } + event.Handler = ActuatorMovementTimerEventHandler; GetAppTask().PostEvent(&event); } -void BoltLockManager::AutoReLockTimerEventHandler(AppEvent * aEvent) -{ - BoltLockManager * lock = static_cast(aEvent->TimerEvent.Context); - int32_t actor = 0; - - // Make sure auto lock timer is still armed. - if (!lock->mAutoLockTimerArmed) - { - return; - } - - lock->mAutoLockTimerArmed = false; - - ChipLogProgress(NotSpecified, "Auto Re-Lock has been triggered!"); - - lock->InitiateAction(actor, LOCK_ACTION); -} - void BoltLockManager::ActuatorMovementTimerEventHandler(AppEvent * aEvent) { Action_t actionCompleted = INVALID_ACTION; @@ -337,16 +290,5 @@ void BoltLockManager::ActuatorMovementTimerEventHandler(AppEvent * aEvent) { lock->mActionCompleted_CB(actionCompleted); } - - if (lock->mAutoRelock && actionCompleted == UNLOCK_ACTION) - { - // Start the timer for auto relock - lock->StartTimer(lock->mAutoLockDuration * 1000); - - lock->mAutoLockTimerArmed = true; - - ChipLogProgress(NotSpecified, "Auto Re-lock enabled. Will be triggered in %" PRIu32 " seconds", - lock->mAutoLockDuration); - } } } diff --git a/examples/lock-app/qpg/src/ZclCallbacks.cpp b/examples/lock-app/qpg/src/ZclCallbacks.cpp index 25a06b533c5cad..51751c43ed4058 100644 --- a/examples/lock-app/qpg/src/ZclCallbacks.cpp +++ b/examples/lock-app/qpg/src/ZclCallbacks.cpp @@ -40,10 +40,10 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & switch (*value) { case to_underlying(DlLockState::kLocked): - BoltLockMgr().InitiateAction(0, BoltLockManager::LOCK_ACTION); + // BoltLockMgr().InitiateAction(0, BoltLockManager::LOCK_ACTION); break; case to_underlying(DlLockState::kUnlocked): - BoltLockMgr().InitiateAction(0, BoltLockManager::UNLOCK_ACTION); + // BoltLockMgr().InitiateAction(0, BoltLockManager::UNLOCK_ACTION); break; default: break; @@ -82,9 +82,11 @@ bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const N { bool returnValue = false; + ChipLogProgress(Zcl, "Door Lock App: Lock Command endpoint=%d", endpointId); + if (BoltLockMgr().ValidatePIN(pinCode, err)) { - BoltLockMgr().InitiateAction(0, BoltLockManager::LOCK_ACTION); + BoltLockMgr().InitiateAction(AppEvent::kEventType_Lock, BoltLockManager::LOCK_ACTION); returnValue = true; } @@ -97,9 +99,11 @@ bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const { bool returnValue = false; + ChipLogProgress(Zcl, "Door Lock App: UnLock Command endpoint=%d", endpointId); + if (BoltLockMgr().ValidatePIN(pinCode, err)) { - BoltLockMgr().InitiateAction(0, BoltLockManager::UNLOCK_ACTION); + BoltLockMgr().InitiateAction(AppEvent::kEventType_Lock, BoltLockManager::UNLOCK_ACTION); returnValue = true; } @@ -123,3 +127,9 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint) logOnFailure(DoorLock::Attributes::NumberOfCredentialsSupportedPerUser::Set(endpoint, CONFIG_LOCK_NUM_CREDENTIALS_PER_USER), "number of credentials per user"); } + +void emberAfPluginDoorLockOnAutoRelock(chip::EndpointId endpointId) +{ + // Apply the relock state in the application control + BoltLockMgr().InitiateAction(AppEvent::kEventType_Timer, BoltLockManager::LOCK_ACTION); +} diff --git a/examples/lock-app/qpg/zap/lock.matter b/examples/lock-app/qpg/zap/lock.matter index 573fbe867361c6..bb64f66facd5b1 100644 --- a/examples/lock-app/qpg/zap/lock.matter +++ b/examples/lock-app/qpg/zap/lock.matter @@ -790,7 +790,6 @@ server cluster GeneralDiagnostics = 51 { readonly attribute NetworkInterface networkInterfaces[] = 0; readonly attribute int16u rebootCount = 1; readonly attribute int64u upTime = 2; - readonly attribute int32u totalOperationalHours = 3; readonly attribute BootReasonEnum bootReason = 4; readonly attribute HardwareFaultEnum activeHardwareFaults[] = 5; readonly attribute RadioFaultEnum activeRadioFaults[] = 6; @@ -1277,6 +1276,51 @@ server cluster UserLabel = 65 { readonly attribute int16u clusterRevision = 65533; } +/** Allows servers to ensure that listed clients are notified when a server is available for communication. */ +server cluster IcdManagement = 70 { + bitmap Feature : bitmap32 { + kCheckInProtocolSupport = 0x1; + kUserActiveModeTrigger = 0x2; + kLongIdleTimeSupport = 0x4; + } + + bitmap UserActiveModeTriggerBitmap : bitmap32 { + kPowerCycle = 0x1; + kSettingsMenu = 0x2; + kCustomInstruction = 0x4; + kDeviceManual = 0x8; + kActuateSensor = 0x10; + kActuateSensorSeconds = 0x20; + kActuateSensorTimes = 0x40; + kActuateSensorLightsBlink = 0x80; + kResetButton = 0x100; + kResetButtonLightsBlink = 0x200; + kResetButtonSeconds = 0x400; + kResetButtonTimes = 0x800; + kSetupButton = 0x1000; + kSetupButtonSeconds = 0x2000; + kSetupButtonLightsBlink = 0x4000; + kSetupButtonTimes = 0x8000; + kAppDefinedButton = 0x10000; + } + + fabric_scoped struct MonitoringRegistrationStruct { + fabric_sensitive node_id checkInNodeID = 1; + fabric_sensitive int64u monitoredSubject = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute int32u idleModeDuration = 0; + readonly attribute int32u activeModeDuration = 1; + readonly attribute int16u activeModeThreshold = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + /** An interface to a generic way to secure a door */ server cluster DoorLock = 257 { enum AlarmCodeEnum : enum8 { @@ -1907,7 +1951,6 @@ endpoint 0 { callback attribute networkInterfaces; callback attribute rebootCount default = 0x0000; callback attribute upTime default = 0x0000000000000000; - callback attribute totalOperationalHours default = 0x00000000; callback attribute bootReason; callback attribute activeHardwareFaults; callback attribute activeRadioFaults; @@ -2086,6 +2129,18 @@ endpoint 0 { ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; } + + server cluster IcdManagement { + callback attribute idleModeDuration default = 1; + callback attribute activeModeDuration default = 300; + callback attribute activeModeThreshold default = 300; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0x0001; + ram attribute clusterRevision default = 2; + } } endpoint 1 { device type ma_doorlock = 10, version 1; @@ -2136,24 +2191,6 @@ endpoint 1 { callback attribute clusterRevision default = 1; } - server cluster FixedLabel { - callback attribute labelList; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster UserLabel { - callback attribute labelList; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster DoorLock { emits event DoorLockAlarm; emits event DoorStateChange; diff --git a/examples/lock-app/qpg/zap/lock.zap b/examples/lock-app/qpg/zap/lock.zap index fc0f478213e3be..ed241d2ab91866 100644 --- a/examples/lock-app/qpg/zap/lock.zap +++ b/examples/lock-app/qpg/zap/lock.zap @@ -1782,22 +1782,6 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "TotalOperationalHours", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "BootReason", "code": 4, @@ -4077,6 +4061,160 @@ "reportableChange": 0 } ] + }, + { + "name": "ICD Management", + "code": 70, + "mfgCode": null, + "define": "ICD_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "IdleModeDuration", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveModeDuration", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "300", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveModeThreshold", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "300", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] } ] }, @@ -4589,218 +4727,6 @@ } ] }, - { - "name": "Fixed Label", - "code": 64, - "mfgCode": null, - "define": "FIXED_LABEL_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "LabelList", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "User Label", - "code": 65, - "mfgCode": null, - "define": "USER_LABEL_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "LabelList", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, { "name": "Door Lock", "code": 257, diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 2160af0d1e0322..3a29eed2ffcfc3 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -576,6 +576,8 @@ def BuildQorvoTarget(): TargetPart('persistent-storage', app=QpgApp.PERSISTENT_STORAGE), ]) + target.AppendModifier('updateimage', update_image=True) + return target diff --git a/scripts/build/builders/qpg.py b/scripts/build/builders/qpg.py index 2c4f3ebf2e4884..67f224b80a4657 100644 --- a/scripts/build/builders/qpg.py +++ b/scripts/build/builders/qpg.py @@ -81,18 +81,22 @@ def __init__(self, runner, app: QpgApp = QpgApp.LIGHT, board: QpgBoard = QpgBoard.QPG6105, - enable_rpcs: bool = False): + enable_rpcs: bool = False, + update_image: bool = False): super(QpgBuilder, self).__init__( root=app.BuildRoot(root), runner=runner) self.app = app self.board = board self.enable_rpcs = enable_rpcs + self.update_image = update_image def GnBuildArgs(self): args = ['qpg_target_ic=\"%s\"' % self.board.GnArgName()] if self.enable_rpcs: args.append('import("//with_pw_rpc.gni")') + if self.update_image: + args.append('matter_device_software_version_string=\"1.1_OTA_TEST\" matter_device_software_version=4') return args def build_outputs(self): diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index b5402ab140189a..b5f8ad99719433 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -19,7 +19,7 @@ mbed-cy8cproto_062_4343w-{lock,light,all-clusters,all-clusters-minimal,pigweed,o mw320-all-clusters-app nrf-{nrf5340dk,nrf52840dk,nrf52840dongle}-{all-clusters,all-clusters-minimal,lock,light,light-switch,shell,pump,pump-controller,window-covering}[-rpc] nrf-native-posix-64-tests -qpg-qpg6105-{lock,light,shell,persistent-storage} +qpg-qpg6105-{lock,light,shell,persistent-storage}[-updateimage] stm32-stm32wb5mm-dk-light tizen-arm-{all-clusters,all-clusters-minimal,chip-tool,light,tests}[-no-ble][-no-thread][-no-wifi][-asan][-ubsan][-with-ui] telink-{tlsr9518adk80d,tlsr9528a}-{air-quality-sensor,all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,resource-monitoring,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-ota][-dfu][-shell][-rpc][-factory-data][-4mb] diff --git a/src/platform/qpg/ConfigurationManagerImpl.cpp b/src/platform/qpg/ConfigurationManagerImpl.cpp index 872b05cc6c08f6..a7a59bf1438483 100644 --- a/src/platform/qpg/ConfigurationManagerImpl.cpp +++ b/src/platform/qpg/ConfigurationManagerImpl.cpp @@ -70,11 +70,6 @@ CHIP_ERROR ConfigurationManagerImpl::Init() err = StoreRebootCount(1); SuccessOrExit(err); } - if (!QPGConfig::ConfigValueExists(QPGConfig::kCounterKey_TotalOperationalHours)) - { - err = StoreTotalOperationalHours(0); - SuccessOrExit(err); - } qvRebootReason = qvCHIP_GetResetReason(); diff --git a/src/platform/qpg/DiagnosticDataProviderImpl.cpp b/src/platform/qpg/DiagnosticDataProviderImpl.cpp index 1afd80c1e5181f..da5435009685cb 100644 --- a/src/platform/qpg/DiagnosticDataProviderImpl.cpp +++ b/src/platform/qpg/DiagnosticDataProviderImpl.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -181,5 +182,27 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetActiveNetworkFaults(GeneralFaultsname = Span(threadNetworkName, strlen(threadNetworkName)); + ifp->isOperational = true; + ifp->offPremiseServicesReachableIPv4.SetNull(); + ifp->offPremiseServicesReachableIPv6.SetNull(); + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kThread; + uint8_t macBuffer[ConfigurationManager::kPrimaryMACAddressLength]; + ConfigurationMgr().GetPrimary802154MACAddress(macBuffer); + ifp->hardwareAddress = ByteSpan(macBuffer, ConfigurationManager::kPrimaryMACAddressLength); +#else + ifp->isOperational = false; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kUnspecified; +#endif + *netifpp = ifp; + return CHIP_NO_ERROR; +} + } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/qpg/DiagnosticDataProviderImpl.h b/src/platform/qpg/DiagnosticDataProviderImpl.h index 7f0e9147c0b53b..2da5292409021d 100644 --- a/src/platform/qpg/DiagnosticDataProviderImpl.h +++ b/src/platform/qpg/DiagnosticDataProviderImpl.h @@ -54,6 +54,7 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider CHIP_ERROR GetActiveHardwareFaults(GeneralFaults & hardwareFaults) override; CHIP_ERROR GetActiveRadioFaults(GeneralFaults & radioFaults) override; CHIP_ERROR GetActiveNetworkFaults(GeneralFaults & networkFaults) override; + CHIP_ERROR GetNetworkInterfaces(NetworkInterface ** netifpp) override; }; /** diff --git a/third_party/qpg_sdk/qpg_executable.gni b/third_party/qpg_sdk/qpg_executable.gni index adfb2550a695ed..f759eddcea21ad 100644 --- a/third_party/qpg_sdk/qpg_executable.gni +++ b/third_party/qpg_sdk/qpg_executable.gni @@ -19,13 +19,6 @@ import("${build_root}/toolchain/flashable_executable.gni") import("${chip_root}/src/platform/device.gni") import("qpg_sdk.gni") -declare_args() { - matter_device_vid = "" - matter_device_pid = "" - matter_device_software_version = "" - matter_device_software_version_string = "" -} - # Run the generator script that takes a .HEX file and adds the OTA header to it. # # This requires a Python script, given by ota_header_generator, @@ -78,20 +71,6 @@ template("qpg_executable") { defines += invoker.defines } - # Overrule CHIPProjectConfig.h settings - if (matter_device_vid != "") { - defines += [ "CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID=${matter_device_vid}" ] - } - if (matter_device_pid != "") { - defines += [ "CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID=${matter_device_pid}" ] - } - if (matter_device_software_version_string != "") { - defines += [ "CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING=\"${matter_device_software_version_string}\"" ] - } - if (matter_device_software_version != "") { - defines += [ "CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION=${matter_device_software_version}" ] - } - # Copy flashing dependencies to the output directory so that the output # is collectively self-contained; this allows flashing to work reliably # even if the build and flashing steps take place on different machines diff --git a/third_party/qpg_sdk/qpg_sdk.gni b/third_party/qpg_sdk/qpg_sdk.gni index 67b0780d8fe731..d8898c3dabcf72 100644 --- a/third_party/qpg_sdk/qpg_sdk.gni +++ b/third_party/qpg_sdk/qpg_sdk.gni @@ -38,6 +38,12 @@ declare_args() { # Enable mbedtls HW acceleration mbedtls_alt_enabled = true + + # OTA parameters + matter_device_vid = "" + matter_device_pid = "" + matter_device_software_version = "" + matter_device_software_version_string = "" } assert(qpg_sdk_root != "", "qpg_sdk_root must be specified") @@ -92,6 +98,26 @@ template("qpg_sdk") { #MBed TLS built from third_party/mbedtls tree - OT config not used defines = [ "MBEDTLS_CONFIG_FILE=\"${qpg_target_ic}-mbedtls-config.h\"" ] + # Overrule CHIPProjectConfig.h settings + if (matter_device_vid != "") { + defines += [ "CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID=${matter_device_vid}" ] + } + if (matter_device_pid != "") { + defines += [ "CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID=${matter_device_pid}" ] + } + if (matter_device_software_version_string != "") { + defines += [ "CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING=\"${matter_device_software_version_string}\"" ] + } + if (matter_device_software_version != "") { + defines += [ "CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION=${matter_device_software_version}" ] + } + + if (qpg_target_ic == "qpg6200") { + defines += [ "QPG_6200" ] + } else { + include_dirs += [ "${qpg_sdk_root}/Components/ThirdParty/Silex/cryptosoc/mbedtls_alt_3.3.0" ] + } + if (mbedtls_alt_enabled) { defines += [ "QORVO_CRYPTO_ENGINE" ] } else { From 2bd5940b970b97f5fcf58e8deec6e3d8877b6a46 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 31 Oct 2023 16:51:30 -0400 Subject: [PATCH 10/12] Fix ZAP CI. (#30138) More PRs landed that have merge conflicts with each other. --- .../MTRAttributeTLVValueDecoder.mm | 10 +++ .../zap-generated/cluster/Commands.h | 62 +++++++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index fe63b938dd74d2..f6594bfd3a1e5a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -6463,6 +6463,7 @@ static id _Nullable DecodeAttributeValueForMicrowaveOvenControlCluster(Attribute { using namespace Clusters::MicrowaveOvenControl; switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL case Attributes::CookTime::Id: { using TypeInfo = Attributes::CookTime::TypeInfo; TypeInfo::DecodableType cppValue; @@ -6474,6 +6475,8 @@ static id _Nullable DecodeAttributeValueForMicrowaveOvenControlCluster(Attribute value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL case Attributes::PowerSetting::Id: { using TypeInfo = Attributes::PowerSetting::TypeInfo; TypeInfo::DecodableType cppValue; @@ -6485,6 +6488,8 @@ static id _Nullable DecodeAttributeValueForMicrowaveOvenControlCluster(Attribute value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL case Attributes::MinPower::Id: { using TypeInfo = Attributes::MinPower::TypeInfo; TypeInfo::DecodableType cppValue; @@ -6496,6 +6501,8 @@ static id _Nullable DecodeAttributeValueForMicrowaveOvenControlCluster(Attribute value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL case Attributes::MaxPower::Id: { using TypeInfo = Attributes::MaxPower::TypeInfo; TypeInfo::DecodableType cppValue; @@ -6507,6 +6514,8 @@ static id _Nullable DecodeAttributeValueForMicrowaveOvenControlCluster(Attribute value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL case Attributes::PowerStep::Id: { using TypeInfo = Attributes::PowerStep::TypeInfo; TypeInfo::DecodableType cppValue; @@ -6518,6 +6527,7 @@ static id _Nullable DecodeAttributeValueForMicrowaveOvenControlCluster(Attribute value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } +#endif // MTR_ENABLE_PROVISIONAL default: { break; } 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 1e434271064beb..8886f8061f74eb 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -62530,6 +62530,7 @@ class SubscribeAttributeDishwasherAlarmClusterRevision : public SubscribeAttribu #endif // MTR_ENABLE_PROVISIONAL #endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL /*----------------------------------------------------------------------------*\ | Cluster MicrowaveOvenControl | 0x005F | |------------------------------------------------------------------------------| @@ -62553,6 +62554,7 @@ class SubscribeAttributeDishwasherAlarmClusterRevision : public SubscribeAttribu | Events: | | \*----------------------------------------------------------------------------*/ +#if MTR_ENABLE_PROVISIONAL /* * Command SetCookingParameters */ @@ -62616,6 +62618,8 @@ class MicrowaveOvenControlSetCookingParameters : public ClusterCommand { chip::app::Clusters::MicrowaveOvenControl::Commands::SetCookingParameters::Type mRequest; }; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL /* * Command AddMoreTime */ @@ -62663,6 +62667,10 @@ class MicrowaveOvenControlAddMoreTime : public ClusterCommand { chip::app::Clusters::MicrowaveOvenControl::Commands::AddMoreTime::Type mRequest; }; +#endif // MTR_ENABLE_PROVISIONAL + +#if MTR_ENABLE_PROVISIONAL + /* * Attribute CookTime */ @@ -62745,6 +62753,9 @@ class SubscribeAttributeMicrowaveOvenControlCookTime : public SubscribeAttribute } }; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + /* * Attribute PowerSetting */ @@ -62827,6 +62838,9 @@ class SubscribeAttributeMicrowaveOvenControlPowerSetting : public SubscribeAttri } }; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + /* * Attribute MinPower */ @@ -62909,6 +62923,9 @@ class SubscribeAttributeMicrowaveOvenControlMinPower : public SubscribeAttribute } }; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + /* * Attribute MaxPower */ @@ -62991,6 +63008,9 @@ class SubscribeAttributeMicrowaveOvenControlMaxPower : public SubscribeAttribute } }; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + /* * Attribute PowerStep */ @@ -63073,6 +63093,9 @@ class SubscribeAttributeMicrowaveOvenControlPowerStep : public SubscribeAttribut } }; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + /* * Attribute GeneratedCommandList */ @@ -63155,6 +63178,9 @@ class SubscribeAttributeMicrowaveOvenControlGeneratedCommandList : public Subscr } }; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + /* * Attribute AcceptedCommandList */ @@ -63237,6 +63263,7 @@ class SubscribeAttributeMicrowaveOvenControlAcceptedCommandList : public Subscri } }; +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL /* @@ -63322,6 +63349,7 @@ class SubscribeAttributeMicrowaveOvenControlEventList : public SubscribeAttribut }; #endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL /* * Attribute AttributeList @@ -63405,6 +63433,9 @@ class SubscribeAttributeMicrowaveOvenControlAttributeList : public SubscribeAttr } }; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + /* * Attribute FeatureMap */ @@ -63487,6 +63518,9 @@ class SubscribeAttributeMicrowaveOvenControlFeatureMap : public SubscribeAttribu } }; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + /* * Attribute ClusterRevision */ @@ -63569,6 +63603,8 @@ class SubscribeAttributeMicrowaveOvenControlClusterRevision : public SubscribeAt } }; +#endif // MTR_ENABLE_PROVISIONAL +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL /*----------------------------------------------------------------------------*\ | Cluster OperationalState | 0x0060 | @@ -157294,44 +157330,70 @@ void registerClusterDishwasherAlarm(Commands & commands) } void registerClusterMicrowaveOvenControl(Commands & commands) { +#if MTR_ENABLE_PROVISIONAL using namespace chip::app::Clusters::MicrowaveOvenControl; const char * clusterName = "MicrowaveOvenControl"; commands_list clusterCommands = { make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL make_unique(Id), // make_unique(Id), // make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // #endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL }; commands.RegisterCluster(clusterName, clusterCommands); +#endif // MTR_ENABLE_PROVISIONAL } void registerClusterOperationalState(Commands & commands) { From e2d18726c6a8ee49a0ed4fa7a942cdf7c9b0f5ea Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs <112982107+lpbeliveau-silabs@users.noreply.github.com> Date: Tue, 31 Oct 2023 18:33:50 -0400 Subject: [PATCH 11/12] [Scenes] CHIP config table size (#30095) * Added a CHIP config allowing to configure the maximum number of scenes per endpoint in flash. This also behaves as a default scene table size in the event the zap config isn't used at build * Aligned assert text with actual assert check * Update src/lib/core/CHIPConfig.h Co-authored-by: Tennessee Carmel-Veilleux * Decreased CHIP CONFIG Max table size and added a value for test --------- Co-authored-by: Tennessee Carmel-Veilleux --- src/app/clusters/scenes-server/SceneTableImpl.cpp | 2 +- src/app/clusters/scenes-server/SceneTableImpl.h | 11 ++++++++++- src/lib/core/CHIPConfig.h | 14 ++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/app/clusters/scenes-server/SceneTableImpl.cpp b/src/app/clusters/scenes-server/SceneTableImpl.cpp index f1900416c4499b..7f5870f0ecf2b3 100644 --- a/src/app/clusters/scenes-server/SceneTableImpl.cpp +++ b/src/app/clusters/scenes-server/SceneTableImpl.cpp @@ -284,7 +284,7 @@ struct FabricSceneData : public PersistentData uint8_t scene_count = 0; uint16_t max_scenes_per_fabric; uint16_t max_scenes_per_endpoint; - SceneStorageId scene_map[kMaxScenesPerFabric]; + SceneStorageId scene_map[CHIP_CONFIG_MAX_SCENES_TABLE_SIZE]; FabricSceneData(EndpointId endpoint = kInvalidEndpointId, FabricIndex fabric = kUndefinedFabricIndex, uint16_t maxScenesPerFabric = kMaxScenesPerFabric, uint16_t maxScenesPerEndpoint = kMaxScenesPerEndpoint) : diff --git a/src/app/clusters/scenes-server/SceneTableImpl.h b/src/app/clusters/scenes-server/SceneTableImpl.h index 60a378f43c3ce8..9f659fab068f50 100644 --- a/src/app/clusters/scenes-server/SceneTableImpl.h +++ b/src/app/clusters/scenes-server/SceneTableImpl.h @@ -28,8 +28,17 @@ namespace chip { namespace scenes { -static constexpr uint16_t kMaxScenesPerFabric = (MATTER_SCENES_TABLE_SIZE - 1) / 2; +#ifdef MATTER_SCENES_TABLE_SIZE static constexpr uint16_t kMaxScenesPerEndpoint = MATTER_SCENES_TABLE_SIZE; +#else +static constexpr uint16_t kMaxScenesPerEndpoint = CHIP_CONFIG_MAX_SCENES_TABLE_SIZE; +#endif + +static_assert(kMaxScenesPerEndpoint <= CHIP_CONFIG_MAX_SCENES_TABLE_SIZE, + "CHIP_CONFIG_MAX_SCENES_TABLE_SIZE is smaller than the zap configuration, please increase " + "CHIP_CONFIG_MAX_SCENES_TABLE_SIZE in CHIPConfig.h if you really need more scenes"); +static_assert(kMaxScenesPerEndpoint >= 16, "Per spec, kMaxScenesPerEndpoint must be at least 16"); +static constexpr uint16_t kMaxScenesPerFabric = (kMaxScenesPerEndpoint - 1) / 2; using clusterId = chip::ClusterId; diff --git a/src/lib/core/CHIPConfig.h b/src/lib/core/CHIPConfig.h index 60efb7118bb72f..2024f9dab62591 100644 --- a/src/lib/core/CHIPConfig.h +++ b/src/lib/core/CHIPConfig.h @@ -1443,6 +1443,20 @@ extern const char CHIP_NON_PRODUCTION_MARKER[]; #define CHIP_CONFIG_MAX_SCENES_CONCURRENT_ITERATORS 2 #endif +/** + * @ def CHIP_CONFIG_MAX_SCENES_TABLE_SIZE + * + * @brief This defines how many scenes a single endpoint is allowed to allocate in flash memory. This value MUST at least 16 + * per spec and MUST be increased to allow for configuring a greater scene table size from Zap. + */ +#ifndef CHIP_CONFIG_MAX_SCENES_TABLE_SIZE +#if CHIP_CONFIG_TEST +#define CHIP_CONFIG_MAX_SCENES_TABLE_SIZE 24 +#else +#define CHIP_CONFIG_MAX_SCENES_TABLE_SIZE 16 +#endif // CHIP_CONFIG_TEST +#endif // CHIP_CONFIG_MAX_SCENES_TABLE_SIZE + /** * @def CHIP_CONFIG_TIME_ZONE_LIST_MAX_SIZE * From 07309d5e8411d7ad63c9564ac0a5005d75a54960 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Tue, 31 Oct 2023 16:14:38 -0700 Subject: [PATCH 12/12] Update json and tlv library name to match with its namespace (#30130) --- scripts/build/builders/android.py | 8 ++++---- .../build/testdata/dry_run_android-arm64-chip-tool.txt | 4 ++-- src/controller/java/BUILD.gn | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/build/builders/android.py b/scripts/build/builders/android.py index b5d2f1834c5ddb..19080a52f90027 100644 --- a/scripts/build/builders/android.py +++ b/scripts/build/builders/android.py @@ -237,8 +237,8 @@ def copyToSrcAndroid(self): "CHIPController.jar": "src/controller/java/CHIPController.jar", "OnboardingPayload.jar": "src/controller/java/OnboardingPayload.jar", "AndroidPlatform.jar": "src/platform/android/AndroidPlatform.jar", - "libCHIPJson.jar": "src/controller/java/libCHIPJson.jar", - "libCHIPTlv.jar": "src/controller/java/libCHIPTlv.jar", + "libMatterJson.jar": "src/controller/java/libMatterJson.jar", + "libMatterTlv.jar": "src/controller/java/libMatterTlv.jar", "CHIPClusters.jar": "src/controller/java/CHIPClusters.jar", "CHIPClusterID.jar": "src/controller/java/CHIPClusterID.jar", } @@ -568,8 +568,8 @@ def build_outputs(self): "CHIPController.jar": os.path.join( self.output_dir, "lib", "src/controller/java/CHIPController.jar" ), - "libCHIPTlv.jar": os.path.join( - self.output_dir, "lib", "src/controller/java/libCHIPTlv.jar" + "libMatterTlv.jar": os.path.join( + self.output_dir, "lib", "src/controller/java/libMatterTlv.jar" ), "AndroidPlatform.jar": os.path.join( self.output_dir, "lib", "src/platform/android/AndroidPlatform.jar" diff --git a/scripts/build/testdata/dry_run_android-arm64-chip-tool.txt b/scripts/build/testdata/dry_run_android-arm64-chip-tool.txt index c2810269aa0f57..8ff2afd8d8bb76 100644 --- a/scripts/build/testdata/dry_run_android-arm64-chip-tool.txt +++ b/scripts/build/testdata/dry_run_android-arm64-chip-tool.txt @@ -29,9 +29,9 @@ cp {out}/android-arm64-chip-tool/lib/src/controller/java/OnboardingPayload.jar { cp {out}/android-arm64-chip-tool/lib/src/platform/android/AndroidPlatform.jar {root}/examples/android/CHIPTool/app/libs/AndroidPlatform.jar -cp {out}/android-arm64-chip-tool/lib/src/controller/java/libCHIPJson.jar {root}/examples/android/CHIPTool/app/libs/libCHIPJson.jar +cp {out}/android-arm64-chip-tool/lib/src/controller/java/libMatterJson.jar {root}/examples/android/CHIPTool/app/libs/libMatterJson.jar -cp {out}/android-arm64-chip-tool/lib/src/controller/java/libCHIPTlv.jar {root}/examples/android/CHIPTool/app/libs/libCHIPTlv.jar +cp {out}/android-arm64-chip-tool/lib/src/controller/java/libMatterTlv.jar {root}/examples/android/CHIPTool/app/libs/libMatterTlv.jar cp {out}/android-arm64-chip-tool/lib/src/controller/java/CHIPClusters.jar {root}/examples/android/CHIPTool/app/libs/CHIPClusters.jar diff --git a/src/controller/java/BUILD.gn b/src/controller/java/BUILD.gn index 71c2a8b07bcbf5..5dbd5c90ff8ca3 100644 --- a/src/controller/java/BUILD.gn +++ b/src/controller/java/BUILD.gn @@ -177,7 +177,7 @@ if (chip_link_tests) { } kotlin_library("tlv") { - output_name = "libCHIPTlv.jar" + output_name = "libMatterTlv.jar" sources = [ "src/matter/tlv/Element.kt", @@ -236,7 +236,7 @@ kotlin_library("tlv_read_write_test") { } kotlin_library("jsontlv") { - output_name = "libCHIPJson.jar" + output_name = "libMatterJson.jar" deps = [ ":tlv",