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 a7b2a1a7b228da..4e8dd35960d890 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 @@ -1971,17 +1971,26 @@ server cluster MediaPlayback = 1286 { } server cluster ModeSelect = 80 { + bitmap ModeSelectFeature : BITMAP32 { + kDeponoff = 0x1; + } + struct ModeOptionStruct { CHAR_STRING<32> label = 0; INT8U mode = 1; INT32U semanticTag = 2; } - readonly attribute int8u currentMode = 0; - readonly attribute ModeOptionStruct supportedModes[] = 1; - attribute int8u onMode = 2; - readonly attribute int8u startUpMode = 3; - readonly attribute char_string<32> description = 4; + readonly attribute char_string<32> description = 0; + readonly attribute nullable enum16 standardNamespace = 1; + readonly attribute ModeOptionStruct supportedModes[] = 2; + readonly attribute int8u currentMode = 3; + readonly attribute nullable int8u startUpMode = 4; + attribute nullable int8u onMode = 5; + readonly global attribute command_id generatedCommandList[] = 65528; + readonly global attribute command_id acceptedCommandList[] = 65529; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; readonly global attribute int16u clusterRevision = 65533; request struct ChangeToModeRequest { 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 513cf3c479e308..c74772c8bc26f7 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 @@ -7963,7 +7963,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "0x00", @@ -8032,6 +8032,51 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "ServerGeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientGeneratedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, @@ -8462,11 +8507,11 @@ "mfgCode": null, "side": "server", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -8477,11 +8522,11 @@ "mfgCode": null, "side": "server", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -8492,11 +8537,11 @@ "mfgCode": null, "side": "server", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -8889,6 +8934,66 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "ServerGeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientGeneratedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -10376,7 +10481,7 @@ "commands": [], "attributes": [ { - "name": "CurrentMode", + "name": "Description", "code": 0, "mfgCode": null, "side": "server", @@ -10384,19 +10489,19 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "Coffee", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "SupportedModes", + "name": "StandardNamespace", "code": 1, "mfgCode": null, "side": "server", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -10406,12 +10511,12 @@ "reportableChange": 0 }, { - "name": "OnMode", + "name": "SupportedModes", "code": 2, "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -10421,7 +10526,7 @@ "reportableChange": 0 }, { - "name": "StartUpMode", + "name": "CurrentMode", "code": 3, "mfgCode": null, "side": "server", @@ -10436,15 +10541,90 @@ "reportableChange": 0 }, { - "name": "Description", + "name": "StartUpMode", "code": 4, "mfgCode": null, "side": "server", "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnMode", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "Coffee", + "defaultValue": "255", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerGeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientGeneratedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "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", + "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", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -14661,6 +14841,66 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "ServerGeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientGeneratedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, diff --git a/src/app/clusters/on-off-server/on-off-server.cpp b/src/app/clusters/on-off-server/on-off-server.cpp index 4dde061e4c38b4..cf7780e63ed749 100644 --- a/src/app/clusters/on-off-server/on-off-server.cpp +++ b/src/app/clusters/on-off-server/on-off-server.cpp @@ -41,6 +41,7 @@ #include "on-off-server.h" #include +#include #include #include #include @@ -165,6 +166,21 @@ EmberAfStatus OnOffServer::setOnOffValue(chip::EndpointId endpoint, uint8_t comm { emberAfOnOffClusterLevelControlEffectCallback(endpoint, newValue); } +#endif +#ifdef EMBER_AF_PLUGIN_MODE_SELECT + // If OnMode is not a null value, then change the current mode to it. + ModeSelect::Attributes::OnMode::TypeInfo::Type onMode; + status = ModeSelect::Attributes::OnMode::Get(endpoint, onMode); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + emberAfOnOffClusterPrintln("ERR: reading onMode %x", status); + return status; + } + if (!onMode.IsNull()) + { + emberAfOnOffClusterPrintln("Changing Current Mode to %x", onMode.Value()); + status = ModeSelect::Attributes::CurrentMode::Set(endpoint, onMode.Value()); + } #endif } else // Set Off @@ -260,7 +276,7 @@ void OnOffServer::initOnOffServer(chip::EndpointId endpoint) break; } } - status = Attributes::OnOff::Set(endpoint, updatedOnOff); + status = setOnOffValue(endpoint, updatedOnOff, false); } } } diff --git a/src/app/tests/suites/TestModeSelectCluster.yaml b/src/app/tests/suites/TestModeSelectCluster.yaml index 000d0be8f02914..a27f110eb5aaf6 100644 --- a/src/app/tests/suites/TestModeSelectCluster.yaml +++ b/src/app/tests/suites/TestModeSelectCluster.yaml @@ -27,31 +27,18 @@ tests: values: - name: "nodeId" value: nodeId - - - label: "Read CurrentMode" - command: "readAttribute" - attribute: "CurrentMode" - response: - value: 0 - - - label: "Read OnMode" + - label: "Read Description" command: "readAttribute" - attribute: "OnMode" + attribute: "Description" response: - value: 0 + value: "Coffee" - - label: "Read StartUpMode" + - label: "Read StandardNamespace" command: "readAttribute" - attribute: "StartUpMode" + attribute: "StandardNamespace" response: value: 0 - - label: "Read Description" - command: "readAttribute" - attribute: "Description" - response: - value: "Coffee" - - label: "Read SupportedModes" command: "readAttribute" attribute: "SupportedModes" @@ -67,6 +54,24 @@ tests: - minLength: 3 - maxLength: 3 + - label: "Read CurrentMode" + command: "readAttribute" + attribute: "CurrentMode" + response: + value: 0 + + - label: "Read StartUpMode" + command: "readAttribute" + attribute: "StartUpMode" + response: + value: 0 + + - label: "Read OnMode" + command: "readAttribute" + attribute: "OnMode" + response: + value: null + - label: "Change to Supported Mode" command: "changeToMode" arguments: @@ -79,6 +84,7 @@ tests: attribute: "CurrentMode" response: value: 4 + saveAs: currentModeBeforeToggle - label: "Change to Unsupported Mode" command: "changeToMode" @@ -88,3 +94,44 @@ tests: value: 2 response: error: CONSTRAINT_ERROR + + - label: "Toggle OnOff" + cluster: "On/Off" + command: "off" + + - label: "Toggle OnOff" + cluster: "On/Off" + command: "on" + + - label: "Verify Current Mode does not change when OnMode is null" + command: "readAttribute" + attribute: "CurrentMode" + response: + value: currentModeBeforeToggle + + - label: "Change OnMode" + command: "writeAttribute" + attribute: "OnMode" + arguments: + value: 7 + + - label: "Verify OnMode" + command: "readAttribute" + attribute: "OnMode" + response: + saveAs: OnModeValue + value: 7 + + - label: "Toggle OnOff" + cluster: "On/Off" + command: "off" + + - label: "Toggle OnOff" + cluster: "On/Off" + command: "on" + + - label: "Verify Current Mode Changes if OnMode is not null" + command: "readAttribute" + attribute: "CurrentMode" + response: + value: OnModeValue diff --git a/src/app/tests/suites/include/ValueChecker.h b/src/app/tests/suites/include/ValueChecker.h index 540546667a70d2..d952d0d7557de3 100644 --- a/src/app/tests/suites/include/ValueChecker.h +++ b/src/app/tests/suites/include/ValueChecker.h @@ -83,6 +83,20 @@ class ValueChecker return CheckValue(itemName, current.Raw(), expected); } + // Allow an expected value that is a nullable wrapped around the actual + // value (e.g. a SaveAs from reading a different attribute that has a value + // space that includes null). In that case we check that: + // 1) The nullable is not in fact null. + // + // 2) The value in the nullable matches our test value. + template + bool CheckValue(const char * itemName, T current, const chip::app::DataModel::Nullable & expected) + { + auto nullableName = std::string(itemName); + nullableName += " expected value"; + return CheckValueNonNull(nullableName.c_str(), expected) && CheckValue(itemName, current, expected.Value()); + } + template bool CheckValue(const char * itemName, chip::BitFlags current, chip::BitFlags expected) { diff --git a/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml index a5b26f35bf3200..6b41513b2990ad 100644 --- a/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml @@ -41,11 +41,12 @@ limitations under the License. true Attributes and commands for selecting a mode from a list of supported options. - CurrentMode - SupportedModes - OnMode - StartUpMode - Description + Description + StandardNamespace + SupportedModes + CurrentMode + StartUpMode + OnMode @@ -56,4 +57,9 @@ limitations under the License. + + + + + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index b3ff0e5efaa6d2..b7cebe1026fa11 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -2366,20 +2366,26 @@ client cluster MediaPlayback = 1286 { } client cluster ModeSelect = 80 { + bitmap ModeSelectFeature : BITMAP32 { + kDeponoff = 0x1; + } + struct ModeOptionStruct { CHAR_STRING<32> label = 0; INT8U mode = 1; INT32U semanticTag = 2; } - readonly attribute int8u currentMode = 0; - readonly attribute ModeOptionStruct supportedModes[] = 1; - attribute int8u onMode = 2; - readonly attribute int8u startUpMode = 3; - readonly attribute char_string<32> description = 4; + readonly attribute char_string<32> description = 0; + readonly attribute nullable enum16 standardNamespace = 1; + readonly attribute ModeOptionStruct supportedModes[] = 2; + readonly attribute int8u currentMode = 3; + readonly attribute nullable int8u startUpMode = 4; + attribute nullable int8u onMode = 5; readonly global attribute command_id generatedCommandList[] = 65528; readonly global attribute command_id acceptedCommandList[] = 65529; readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; readonly global attribute int16u clusterRevision = 65533; request struct ChangeToModeRequest { diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 0bb7b5c8ddb9fc..5d4c79a993d5bc 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -8517,6 +8517,21 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -8544,7 +8559,7 @@ "commands": [], "attributes": [ { - "name": "CurrentMode", + "name": "Description", "code": 0, "mfgCode": null, "side": "server", @@ -8559,7 +8574,7 @@ "reportableChange": 0 }, { - "name": "SupportedModes", + "name": "StandardNamespace", "code": 1, "mfgCode": null, "side": "server", @@ -8574,22 +8589,22 @@ "reportableChange": 0 }, { - "name": "OnMode", + "name": "SupportedModes", "code": 2, "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "255", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "StartUpMode", + "name": "CurrentMode", "code": 3, "mfgCode": null, "side": "server", @@ -8604,7 +8619,7 @@ "reportableChange": 0 }, { - "name": "Description", + "name": "StartUpMode", "code": 4, "mfgCode": null, "side": "server", @@ -8618,6 +8633,21 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "OnMode", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "GeneratedCommandList", "code": 65528, @@ -8668,7 +8698,7 @@ "code": 65532, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -11460,7 +11490,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11475,7 +11505,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11490,7 +11520,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -18057,4 +18087,4 @@ } ], "log": [] -} +} \ No newline at end of file diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 638540db118491..f68a1c8cff23e5 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -8095,8 +8095,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR using namespace app::Clusters::ModeSelect; switch (aPath.mAttributeId) { - case Attributes::CurrentMode::Id: { - using TypeInfo = Attributes::CurrentMode::TypeInfo; + case Attributes::Description::Id: { + using TypeInfo = Attributes::Description::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8104,10 +8104,29 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + return value; + } + case Attributes::StandardNamespace::Id: { + using TypeInfo = Attributes::StandardNamespace::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } return value; } case Attributes::SupportedModes::Id: { @@ -8162,8 +8181,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } return value; } - case Attributes::OnMode::Id: { - using TypeInfo = Attributes::OnMode::TypeInfo; + case Attributes::CurrentMode::Id: { + using TypeInfo = Attributes::CurrentMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8186,14 +8205,21 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } return value; } - case Attributes::Description::Id: { - using TypeInfo = Attributes::Description::TypeInfo; + case Attributes::OnMode::Id: { + using TypeInfo = Attributes::OnMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8201,7 +8227,17 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } return value; } case Attributes::GeneratedCommandList::Id: { @@ -8276,6 +8312,21 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } return value; } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } case Attributes::ClusterRevision::Id: { using TypeInfo = Attributes::ClusterRevision::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/controller/java/zap-generated/CHIPCallbackTypes.h b/src/controller/java/zap-generated/CHIPCallbackTypes.h index 0950abbcf460ed..cb52ddf1a4f5cd 100644 --- a/src/controller/java/zap-generated/CHIPCallbackTypes.h +++ b/src/controller/java/zap-generated/CHIPCallbackTypes.h @@ -835,22 +835,26 @@ typedef void (*CHIPMediaPlaybackClusterAttributeListAttributeCallbackType)( typedef void (*CHIPMediaPlaybackClusterClusterRevisionAttributeCallbackType)( void *, chip::app::Clusters::MediaPlayback::Attributes::ClusterRevision::TypeInfo::DecodableArgType); -typedef void (*CHIPModeSelectClusterCurrentModeAttributeCallbackType)( - void *, chip::app::Clusters::ModeSelect::Attributes::CurrentMode::TypeInfo::DecodableArgType); +typedef void (*CHIPModeSelectClusterDescriptionAttributeCallbackType)( + void *, chip::app::Clusters::ModeSelect::Attributes::Description::TypeInfo::DecodableArgType); +typedef void (*CHIPModeSelectClusterStandardNamespaceAttributeCallbackType)( + void *, chip::app::Clusters::ModeSelect::Attributes::StandardNamespace::TypeInfo::DecodableArgType); typedef void (*CHIPModeSelectClusterSupportedModesAttributeCallbackType)( void *, const chip::app::Clusters::ModeSelect::Attributes::SupportedModes::TypeInfo::DecodableType &); -typedef void (*CHIPModeSelectClusterOnModeAttributeCallbackType)( - void *, chip::app::Clusters::ModeSelect::Attributes::OnMode::TypeInfo::DecodableArgType); +typedef void (*CHIPModeSelectClusterCurrentModeAttributeCallbackType)( + void *, chip::app::Clusters::ModeSelect::Attributes::CurrentMode::TypeInfo::DecodableArgType); typedef void (*CHIPModeSelectClusterStartUpModeAttributeCallbackType)( void *, chip::app::Clusters::ModeSelect::Attributes::StartUpMode::TypeInfo::DecodableArgType); -typedef void (*CHIPModeSelectClusterDescriptionAttributeCallbackType)( - void *, chip::app::Clusters::ModeSelect::Attributes::Description::TypeInfo::DecodableArgType); +typedef void (*CHIPModeSelectClusterOnModeAttributeCallbackType)( + void *, chip::app::Clusters::ModeSelect::Attributes::OnMode::TypeInfo::DecodableArgType); typedef void (*CHIPModeSelectClusterGeneratedCommandListAttributeCallbackType)( void *, const chip::app::Clusters::ModeSelect::Attributes::GeneratedCommandList::TypeInfo::DecodableType &); typedef void (*CHIPModeSelectClusterAcceptedCommandListAttributeCallbackType)( void *, const chip::app::Clusters::ModeSelect::Attributes::AcceptedCommandList::TypeInfo::DecodableType &); typedef void (*CHIPModeSelectClusterAttributeListAttributeCallbackType)( void *, const chip::app::Clusters::ModeSelect::Attributes::AttributeList::TypeInfo::DecodableType &); +typedef void (*CHIPModeSelectClusterFeatureMapAttributeCallbackType)( + void *, chip::app::Clusters::ModeSelect::Attributes::FeatureMap::TypeInfo::DecodableArgType); typedef void (*CHIPModeSelectClusterClusterRevisionAttributeCallbackType)( void *, chip::app::Clusters::ModeSelect::Attributes::ClusterRevision::TypeInfo::DecodableArgType); typedef void (*CHIPNetworkCommissioningClusterConnectNetworkResponseCallbackType)( diff --git a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp index fb6bbb96483f6e..7a1a6d0395f110 100644 --- a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp @@ -2620,8 +2620,16 @@ JNI_METHOD(void, ModeSelectCluster, writeOnModeAttribute) std::vector> cleanupByteArrays; std::vector> cleanupStrings; - cppValue = - static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + if (value == nullptr) + { + cppValue.SetNull(); + } + else + { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = static_cast>( + chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + } std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index da5d045ebf991f..a605129092dbef 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -12116,6 +12116,73 @@ void CHIPMediaPlaybackAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPModeSelectStandardNamespaceAttributeCallback::CHIPModeSelectStandardNamespaceAttributeCallback(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"); + } +} + +CHIPModeSelectStandardNamespaceAttributeCallback::~CHIPModeSelectStandardNamespaceAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPModeSelectStandardNamespaceAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + CHIPModeSelectSupportedModesAttributeCallback::CHIPModeSelectSupportedModesAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -12214,6 +12281,134 @@ void CHIPModeSelectSupportedModesAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPModeSelectStartUpModeAttributeCallback::CHIPModeSelectStartUpModeAttributeCallback(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"); + } +} + +CHIPModeSelectStartUpModeAttributeCallback::~CHIPModeSelectStartUpModeAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPModeSelectStartUpModeAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPModeSelectOnModeAttributeCallback::CHIPModeSelectOnModeAttributeCallback(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"); + } +} + +CHIPModeSelectOnModeAttributeCallback::~CHIPModeSelectOnModeAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPModeSelectOnModeAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + CHIPModeSelectGeneratedCommandListAttributeCallback::CHIPModeSelectGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.h b/src/controller/java/zap-generated/CHIPReadCallbacks.h index 86e2f26577f120..0ee1f7d24d7d2c 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -5036,6 +5036,36 @@ class CHIPMediaPlaybackAttributeListAttributeCallback bool keepAlive; }; +class CHIPModeSelectStandardNamespaceAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPModeSelectStandardNamespaceAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPModeSelectStandardNamespaceAttributeCallback(); + + static void maybeDestroy(CHIPModeSelectStandardNamespaceAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + class CHIPModeSelectSupportedModesAttributeCallback : public chip::Callback::Callback { @@ -5069,6 +5099,65 @@ class CHIPModeSelectSupportedModesAttributeCallback bool keepAlive; }; +class CHIPModeSelectStartUpModeAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPModeSelectStartUpModeAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPModeSelectStartUpModeAttributeCallback(); + + static void maybeDestroy(CHIPModeSelectStartUpModeAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPModeSelectOnModeAttributeCallback : public chip::Callback::Callback +{ +public: + CHIPModeSelectOnModeAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPModeSelectOnModeAttributeCallback(); + + static void maybeDestroy(CHIPModeSelectOnModeAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + class CHIPModeSelectGeneratedCommandListAttributeCallback : public chip::Callback::Callback { diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 9d630477075b9b..b591c9b7f39264 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -11053,6 +11053,14 @@ private native void changeToMode( Integer newMode, @Nullable Integer timedInvokeTimeoutMs); + public interface StandardNamespaceAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + public interface SupportedModesAttributeCallback { void onSuccess(List valueList); @@ -11061,6 +11069,22 @@ public interface SupportedModesAttributeCallback { default void onSubscriptionEstablished() {} } + public interface StartUpModeAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface OnModeAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + public interface GeneratedCommandListAttributeCallback { void onSuccess(List valueList); @@ -11085,13 +11109,22 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished() {} } - public void readCurrentModeAttribute(IntegerAttributeCallback callback) { - readCurrentModeAttribute(chipClusterPtr, callback); + public void readDescriptionAttribute(CharStringAttributeCallback callback) { + readDescriptionAttribute(chipClusterPtr, callback); } - public void subscribeCurrentModeAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeCurrentModeAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeDescriptionAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeDescriptionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readStandardNamespaceAttribute(StandardNamespaceAttributeCallback callback) { + readStandardNamespaceAttribute(chipClusterPtr, callback); + } + + public void subscribeStandardNamespaceAttribute( + StandardNamespaceAttributeCallback callback, int minInterval, int maxInterval) { + subscribeStandardNamespaceAttribute(chipClusterPtr, callback, minInterval, maxInterval); } public void readSupportedModesAttribute(SupportedModesAttributeCallback callback) { @@ -11103,40 +11136,40 @@ public void subscribeSupportedModesAttribute( subscribeSupportedModesAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readOnModeAttribute(IntegerAttributeCallback callback) { - readOnModeAttribute(chipClusterPtr, callback); - } - - public void writeOnModeAttribute(DefaultClusterCallback callback, Integer value) { - writeOnModeAttribute(chipClusterPtr, callback, value, null); - } - - public void writeOnModeAttribute( - DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - writeOnModeAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + public void readCurrentModeAttribute(IntegerAttributeCallback callback) { + readCurrentModeAttribute(chipClusterPtr, callback); } - public void subscribeOnModeAttribute( + public void subscribeCurrentModeAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeOnModeAttribute(chipClusterPtr, callback, minInterval, maxInterval); + subscribeCurrentModeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readStartUpModeAttribute(IntegerAttributeCallback callback) { + public void readStartUpModeAttribute(StartUpModeAttributeCallback callback) { readStartUpModeAttribute(chipClusterPtr, callback); } public void subscribeStartUpModeAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { + StartUpModeAttributeCallback callback, int minInterval, int maxInterval) { subscribeStartUpModeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readDescriptionAttribute(CharStringAttributeCallback callback) { - readDescriptionAttribute(chipClusterPtr, callback); + public void readOnModeAttribute(OnModeAttributeCallback callback) { + readOnModeAttribute(chipClusterPtr, callback); } - public void subscribeDescriptionAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - subscribeDescriptionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void writeOnModeAttribute(DefaultClusterCallback callback, Integer value) { + writeOnModeAttribute(chipClusterPtr, callback, value, null); + } + + public void writeOnModeAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeOnModeAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeOnModeAttribute( + OnModeAttributeCallback callback, int minInterval, int maxInterval) { + subscribeOnModeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { @@ -11166,6 +11199,15 @@ public void subscribeAttributeListAttribute( 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); } @@ -11175,11 +11217,23 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readCurrentModeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + private native void readDescriptionAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); - private native void subscribeCurrentModeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + private native void subscribeDescriptionAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readStandardNamespaceAttribute( + long chipClusterPtr, StandardNamespaceAttributeCallback callback); + + private native void subscribeStandardNamespaceAttribute( + long chipClusterPtr, + StandardNamespaceAttributeCallback callback, + int minInterval, + int maxInterval); private native void readSupportedModesAttribute( long chipClusterPtr, SupportedModesAttributeCallback callback); @@ -11190,32 +11244,32 @@ private native void subscribeSupportedModesAttribute( int minInterval, int maxInterval); - private native void readOnModeAttribute(long chipClusterPtr, IntegerAttributeCallback callback); - - private native void writeOnModeAttribute( - long chipClusterPtr, - DefaultClusterCallback callback, - Integer value, - @Nullable Integer timedWriteTimeoutMs); + private native void readCurrentModeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); - private native void subscribeOnModeAttribute( + private native void subscribeCurrentModeAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readStartUpModeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, StartUpModeAttributeCallback callback); private native void subscribeStartUpModeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); - - private native void readDescriptionAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void subscribeDescriptionAttribute( long chipClusterPtr, - CharStringAttributeCallback callback, + StartUpModeAttributeCallback callback, int minInterval, int maxInterval); + private native void readOnModeAttribute(long chipClusterPtr, OnModeAttributeCallback callback); + + private native void writeOnModeAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeOnModeAttribute( + long chipClusterPtr, OnModeAttributeCallback callback, int minInterval, int maxInterval); + private native void readGeneratedCommandListAttribute( long chipClusterPtr, GeneratedCommandListAttributeCallback callback); @@ -11243,6 +11297,12 @@ private native void subscribeAttributeListAttribute( 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); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java index b3185a5503cc04..b7fb7d3aec606f 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java @@ -1433,19 +1433,22 @@ public static String attributeIdToName(long clusterId, long attributeId) { } if (clusterId == 80L) { if (attributeId == 0L) { - return "CurrentMode"; + return "Description"; } if (attributeId == 1L) { - return "SupportedModes"; + return "StandardNamespace"; } if (attributeId == 2L) { - return "OnMode"; + return "SupportedModes"; } if (attributeId == 3L) { - return "StartUpMode"; + return "CurrentMode"; } if (attributeId == 4L) { - return "Description"; + return "StartUpMode"; + } + if (attributeId == 5L) { + return "OnMode"; } if (attributeId == 65528L) { return "GeneratedCommandList"; @@ -1456,6 +1459,9 @@ public static String attributeIdToName(long clusterId, long attributeId) { if (attributeId == 65531L) { return "AttributeList"; } + if (attributeId == 65532L) { + return "FeatureMap"; + } if (attributeId == 65533L) { return "ClusterRevision"; } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java index d912c0484aa130..cf907dfea85668 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java @@ -5120,18 +5120,31 @@ public Map> getReadAttributeMap() { "readClusterRevisionAttribute", readMediaPlaybackClusterRevisionAttributeInteractionInfo); readAttributeMap.put("mediaPlayback", readMediaPlaybackInteractionInfo); Map readModeSelectInteractionInfo = new LinkedHashMap<>(); - Map readModeSelectCurrentModeCommandParams = + Map readModeSelectDescriptionCommandParams = new LinkedHashMap(); - InteractionInfo readModeSelectCurrentModeAttributeInteractionInfo = + InteractionInfo readModeSelectDescriptionAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ModeSelectCluster) cluster) - .readCurrentModeAttribute((ChipClusters.IntegerAttributeCallback) callback); + .readDescriptionAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readModeSelectDescriptionCommandParams); + readModeSelectInteractionInfo.put( + "readDescriptionAttribute", readModeSelectDescriptionAttributeInteractionInfo); + Map readModeSelectStandardNamespaceCommandParams = + new LinkedHashMap(); + InteractionInfo readModeSelectStandardNamespaceAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ModeSelectCluster) cluster) + .readStandardNamespaceAttribute( + (ChipClusters.ModeSelectCluster.StandardNamespaceAttributeCallback) callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readModeSelectCurrentModeCommandParams); + readModeSelectStandardNamespaceCommandParams); readModeSelectInteractionInfo.put( - "readCurrentModeAttribute", readModeSelectCurrentModeAttributeInteractionInfo); + "readStandardNamespaceAttribute", readModeSelectStandardNamespaceAttributeInteractionInfo); Map readModeSelectSupportedModesCommandParams = new LinkedHashMap(); InteractionInfo readModeSelectSupportedModesAttributeInteractionInfo = @@ -5146,42 +5159,44 @@ public Map> getReadAttributeMap() { readModeSelectSupportedModesCommandParams); readModeSelectInteractionInfo.put( "readSupportedModesAttribute", readModeSelectSupportedModesAttributeInteractionInfo); - Map readModeSelectOnModeCommandParams = + Map readModeSelectCurrentModeCommandParams = new LinkedHashMap(); - InteractionInfo readModeSelectOnModeAttributeInteractionInfo = + InteractionInfo readModeSelectCurrentModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ModeSelectCluster) cluster) - .readOnModeAttribute((ChipClusters.IntegerAttributeCallback) callback); + .readCurrentModeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readModeSelectOnModeCommandParams); + readModeSelectCurrentModeCommandParams); readModeSelectInteractionInfo.put( - "readOnModeAttribute", readModeSelectOnModeAttributeInteractionInfo); + "readCurrentModeAttribute", readModeSelectCurrentModeAttributeInteractionInfo); Map readModeSelectStartUpModeCommandParams = new LinkedHashMap(); InteractionInfo readModeSelectStartUpModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ModeSelectCluster) cluster) - .readStartUpModeAttribute((ChipClusters.IntegerAttributeCallback) callback); + .readStartUpModeAttribute( + (ChipClusters.ModeSelectCluster.StartUpModeAttributeCallback) callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readModeSelectStartUpModeCommandParams); readModeSelectInteractionInfo.put( "readStartUpModeAttribute", readModeSelectStartUpModeAttributeInteractionInfo); - Map readModeSelectDescriptionCommandParams = + Map readModeSelectOnModeCommandParams = new LinkedHashMap(); - InteractionInfo readModeSelectDescriptionAttributeInteractionInfo = + InteractionInfo readModeSelectOnModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ModeSelectCluster) cluster) - .readDescriptionAttribute((ChipClusters.CharStringAttributeCallback) callback); + .readOnModeAttribute( + (ChipClusters.ModeSelectCluster.OnModeAttributeCallback) callback); }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readModeSelectDescriptionCommandParams); + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readModeSelectOnModeCommandParams); readModeSelectInteractionInfo.put( - "readDescriptionAttribute", readModeSelectDescriptionAttributeInteractionInfo); + "readOnModeAttribute", readModeSelectOnModeAttributeInteractionInfo); Map readModeSelectGeneratedCommandListCommandParams = new LinkedHashMap(); InteractionInfo readModeSelectGeneratedCommandListAttributeInteractionInfo = @@ -5229,6 +5244,18 @@ public Map> getReadAttributeMap() { readModeSelectAttributeListCommandParams); readModeSelectInteractionInfo.put( "readAttributeListAttribute", readModeSelectAttributeListAttributeInteractionInfo); + Map readModeSelectFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readModeSelectFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ModeSelectCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readModeSelectFeatureMapCommandParams); + readModeSelectInteractionInfo.put( + "readFeatureMapAttribute", readModeSelectFeatureMapAttributeInteractionInfo); Map readModeSelectClusterRevisionCommandParams = new LinkedHashMap(); InteractionInfo readModeSelectClusterRevisionAttributeInteractionInfo = diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index de3c329f8ea2ac..532da158fd2628 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -3471,36 +3471,42 @@ class ChipClusters: }, "attributes": { 0x00000000: { - "attributeName": "CurrentMode", + "attributeName": "Description", "attributeId": 0x00000000, - "type": "int", + "type": "str", "reportable": True, }, 0x00000001: { - "attributeName": "SupportedModes", + "attributeName": "StandardNamespace", "attributeId": 0x00000001, - "type": "", + "type": "int", "reportable": True, }, 0x00000002: { - "attributeName": "OnMode", + "attributeName": "SupportedModes", "attributeId": 0x00000002, - "type": "int", + "type": "", "reportable": True, - "writable": True, }, 0x00000003: { - "attributeName": "StartUpMode", + "attributeName": "CurrentMode", "attributeId": 0x00000003, "type": "int", "reportable": True, }, 0x00000004: { - "attributeName": "Description", + "attributeName": "StartUpMode", "attributeId": 0x00000004, - "type": "str", + "type": "int", "reportable": True, }, + 0x00000005: { + "attributeName": "OnMode", + "attributeId": 0x00000005, + "type": "int", + "reportable": True, + "writable": True, + }, 0x0000FFF8: { "attributeName": "GeneratedCommandList", "attributeId": 0x0000FFF8, @@ -3519,6 +3525,12 @@ class ChipClusters: "type": "int", "reportable": True, }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, 0x0000FFFD: { "attributeName": "ClusterRevision", "attributeId": 0x0000FFFD, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index cd64d8bd92bbda..d76c0c80695f4b 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -15601,11 +15601,12 @@ class ModeSelect(Cluster): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000000, Type=uint), - ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000001, Type=typing.List[ModeSelect.Structs.ModeOptionStruct]), - ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000002, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000003, Type=uint), - ClusterObjectFieldDescriptor(Label="description", Tag=0x00000004, Type=str), + ClusterObjectFieldDescriptor(Label="description", Tag=0x00000000, Type=str), + ClusterObjectFieldDescriptor(Label="standardNamespace", Tag=0x00000001, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000002, Type=typing.List[ModeSelect.Structs.ModeOptionStruct]), + ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000003, Type=uint), + ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000004, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000005, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), @@ -15613,11 +15614,12 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - currentMode: 'uint' = None - supportedModes: 'typing.List[ModeSelect.Structs.ModeOptionStruct]' = None - onMode: 'typing.Optional[uint]' = None - startUpMode: 'uint' = None description: 'str' = None + standardNamespace: 'typing.Union[Nullable, uint]' = None + supportedModes: 'typing.List[ModeSelect.Structs.ModeOptionStruct]' = None + currentMode: 'uint' = None + startUpMode: 'typing.Union[None, Nullable, uint]' = None + onMode: 'typing.Union[None, Nullable, uint]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None attributeList: 'typing.List[uint]' = None @@ -15675,7 +15677,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: class Attributes: @dataclass - class CurrentMode(ClusterAttributeDescriptor): + class Description(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x0050 @@ -15686,12 +15688,12 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) + return ClusterObjectFieldDescriptor(Type=str) - value: 'uint' = 0 + value: 'str' = "" @dataclass - class SupportedModes(ClusterAttributeDescriptor): + class StandardNamespace(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x0050 @@ -15702,12 +15704,12 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[ModeSelect.Structs.ModeOptionStruct]) + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, uint]) - value: 'typing.List[ModeSelect.Structs.ModeOptionStruct]' = field(default_factory=lambda: []) + value: 'typing.Union[Nullable, uint]' = NullValue @dataclass - class OnMode(ClusterAttributeDescriptor): + class SupportedModes(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x0050 @@ -15718,12 +15720,12 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=typing.List[ModeSelect.Structs.ModeOptionStruct]) - value: 'typing.Optional[uint]' = None + value: 'typing.List[ModeSelect.Structs.ModeOptionStruct]' = field(default_factory=lambda: []) @dataclass - class StartUpMode(ClusterAttributeDescriptor): + class CurrentMode(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x0050 @@ -15739,7 +15741,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = 0 @dataclass - class Description(ClusterAttributeDescriptor): + class StartUpMode(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x0050 @@ -15750,9 +15752,25 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=str) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - value: 'str' = "" + value: 'typing.Union[None, Nullable, uint]' = None + + @dataclass + class OnMode(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0050 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000005 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) + + value: 'typing.Union[None, Nullable, uint]' = None @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm index d79b4446a3e749..37e7f6048f4c69 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm @@ -6736,15 +6736,30 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader case Clusters::ModeSelect::Id: { using namespace Clusters::ModeSelect; switch (aPath.mAttributeId) { - case Attributes::CurrentMode::Id: { - using TypeInfo = Attributes::CurrentMode::TypeInfo; + case Attributes::Description::Id: { + using TypeInfo = Attributes::Description::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSString * _Nonnull value; + value = [[NSString alloc] initWithBytes:cppValue.data() length:cppValue.size() encoding:NSUTF8StringEncoding]; + return value; + } + case Attributes::StandardNamespace::Id: { + using TypeInfo = Attributes::StandardNamespace::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } return value; } case Attributes::SupportedModes::Id: { @@ -6778,8 +6793,8 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader } return value; } - case Attributes::OnMode::Id: { - using TypeInfo = Attributes::OnMode::TypeInfo; + case Attributes::CurrentMode::Id: { + using TypeInfo = Attributes::CurrentMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -6796,19 +6811,27 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } - case Attributes::Description::Id: { - using TypeInfo = Attributes::Description::TypeInfo; + case Attributes::OnMode::Id: { + using TypeInfo = Attributes::OnMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSString * _Nonnull value; - value = [[NSString alloc] initWithBytes:cppValue.data() length:cppValue.size() encoding:NSUTF8StringEncoding]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } case Attributes::GeneratedCommandList::Id: { @@ -6889,6 +6912,17 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader } return value; } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } case Attributes::ClusterRevision::Id: { using TypeInfo = Attributes::ClusterRevision::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index c1b010af58cd53..ed6c0e230bc548 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -7177,22 +7177,40 @@ NS_ASSUME_NONNULL_BEGIN - (void)changeToModeWithParams:(CHIPModeSelectClusterChangeToModeParams *)params completionHandler:(StatusCompletion)completionHandler; -- (void)readAttributeCurrentModeWithCompletionHandler:(void (^)( - NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)readAttributeDescriptionWithCompletionHandler:(void (^)( + NSString * _Nullable value, NSError * _Nullable error))completionHandler; /** * This API does not support setting autoResubscribe to NO in the * CHIPSubscribeParams. */ -- (void)subscribeAttributeCurrentModeWithMinInterval:(NSNumber * _Nonnull)minInterval +- (void)subscribeAttributeDescriptionWithMinInterval:(NSNumber * _Nonnull)minInterval maxInterval:(NSNumber * _Nonnull)maxInterval params:(CHIPSubscribeParams * _Nullable)params subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; -+ (void)readAttributeCurrentModeWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeDescriptionWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completionHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + (void (^)(NSString * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeStandardNamespaceWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeStandardNamespaceWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeStandardNamespaceWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; - (void)readAttributeSupportedModesWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; @@ -7212,21 +7230,22 @@ NS_ASSUME_NONNULL_BEGIN completionHandler: (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; -- (void)readAttributeOnModeWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; -- (void)writeAttributeOnModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)readAttributeCurrentModeWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; /** * This API does not support setting autoResubscribe to NO in the * CHIPSubscribeParams. */ -- (void)subscribeAttributeOnModeWithMinInterval:(NSNumber * _Nonnull)minInterval - maxInterval:(NSNumber * _Nonnull)maxInterval - params:(CHIPSubscribeParams * _Nullable)params - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; -+ (void)readAttributeOnModeWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)subscribeAttributeCurrentModeWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeCurrentModeWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; - (void)readAttributeStartUpModeWithCompletionHandler:(void (^)( NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; @@ -7245,22 +7264,21 @@ NS_ASSUME_NONNULL_BEGIN completionHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; -- (void)readAttributeDescriptionWithCompletionHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)readAttributeOnModeWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; /** * This API does not support setting autoResubscribe to NO in the * CHIPSubscribeParams. */ -- (void)subscribeAttributeDescriptionWithMinInterval:(NSNumber * _Nonnull)minInterval - maxInterval:(NSNumber * _Nonnull)maxInterval - params:(CHIPSubscribeParams * _Nullable)params - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler; -+ (void)readAttributeDescriptionWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completionHandler: - (void (^)(NSString * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)subscribeAttributeOnModeWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeOnModeWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; - (void)readAttributeGeneratedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; @@ -7318,6 +7336,23 @@ NS_ASSUME_NONNULL_BEGIN completionHandler: (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)readAttributeFeatureMapWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeFeatureMapWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + - (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; /** @@ -15377,6 +15412,10 @@ typedef NS_ENUM(uint8_t, CHIPGroupKeyManagementGroupKeySecurityPolicy) { CHIPGroupKeyManagementGroupKeySecurityPolicyCacheAndSync = 0x01, }; +typedef NS_OPTIONS(uint32_t, CHIPModeSelectFeature) { + CHIPModeSelectFeatureDEPONOFF = 0x1, +}; + typedef NS_ENUM(uint8_t, CHIPDoorLockDlAlarmCode) { CHIPDoorLockDlAlarmCodeLockJammed = 0x00, CHIPDoorLockDlAlarmCodeLockFactoryReset = 0x01, diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index 280d1b663da5c9..59abda05bde02f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -26666,58 +26666,121 @@ new CHIPCommandSuccessCallbackBridge( }); } -- (void)readAttributeCurrentModeWithCompletionHandler:(void (^)( - NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +- (void)readAttributeDescriptionWithCompletionHandler:(void (^)( + NSString * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = ModeSelect::Attributes::CurrentMode::TypeInfo; - auto successFn = Callback::FromCancelable(success); + new CHIPCharStringAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = ModeSelect::Attributes::Description::TypeInfo; + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)subscribeAttributeCurrentModeWithMinInterval:(NSNumber * _Nonnull)minInterval +- (void)subscribeAttributeDescriptionWithMinInterval:(NSNumber * _Nonnull)minInterval maxInterval:(NSNumber * _Nonnull)maxInterval params:(CHIPSubscribeParams * _Nullable)params subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPInt8uAttributeCallbackSubscriptionBridge( + new CHIPCharStringAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { // We don't support disabling auto-resubscribe. return CHIP_ERROR_INVALID_ARGUMENT; } - using TypeInfo = ModeSelect::Attributes::CurrentMode::TypeInfo; - auto successFn = Callback::FromCancelable(success); + using TypeInfo = ModeSelect::Attributes::Description::TypeInfo; + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - CHIPInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + CHIPCharStringAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); }, subscriptionEstablishedHandler); } -+ (void)readAttributeCurrentModeWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer ++ (void)readAttributeDescriptionWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completionHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler + (void (^)(NSString * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + new CHIPCharStringAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { if (attributeCacheContainer.cppAttributeCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = ModeSelect::Attributes::CurrentMode::TypeInfo; + using TypeInfo = ModeSelect::Attributes::Description::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); TypeInfo::DecodableType value; CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeStandardNamespaceWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPNullableInt16uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = ModeSelect::Attributes::StandardNamespace::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeStandardNamespaceWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPNullableInt16uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = ModeSelect::Attributes::StandardNamespace::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPNullableInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeStandardNamespaceWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPNullableInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ModeSelect::Attributes::StandardNamespace::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); if (err == CHIP_NO_ERROR) { successFn->mCall(successFn->mContext, value); } @@ -26791,39 +26854,22 @@ new CHIPModeSelectSupportedModesListAttributeCallbackBridge( }); } -- (void)readAttributeOnModeWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +- (void)readAttributeCurrentModeWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = ModeSelect::Attributes::OnMode::TypeInfo; + using TypeInfo = ModeSelect::Attributes::CurrentMode::TypeInfo; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeOnModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ModeSelect::Attributes::OnMode::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributeOnModeWithMinInterval:(NSNumber * _Nonnull)minInterval - maxInterval:(NSNumber * _Nonnull)maxInterval - params:(CHIPSubscribeParams * _Nullable)params - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +- (void)subscribeAttributeCurrentModeWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { new CHIPInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, @@ -26832,7 +26878,7 @@ new CHIPInt8uAttributeCallbackSubscriptionBridge( // We don't support disabling auto-resubscribe. return CHIP_ERROR_INVALID_ARGUMENT; } - using TypeInfo = ModeSelect::Attributes::OnMode::TypeInfo; + using TypeInfo = ModeSelect::Attributes::CurrentMode::TypeInfo; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, @@ -26844,15 +26890,16 @@ new CHIPInt8uAttributeCallbackSubscriptionBridge( subscriptionEstablishedHandler); } -+ (void)readAttributeOnModeWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler ++ (void)readAttributeCurrentModeWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { new CHIPInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { if (attributeCacheContainer.cppAttributeCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = ModeSelect::Attributes::OnMode::TypeInfo; + using TypeInfo = ModeSelect::Attributes::CurrentMode::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -26871,12 +26918,13 @@ new CHIPInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su - (void)readAttributeStartUpModeWithCompletionHandler:(void (^)( NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = ModeSelect::Attributes::StartUpMode::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); + new CHIPNullableInt8uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = ModeSelect::Attributes::StartUpMode::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); } - (void)subscribeAttributeStartUpModeWithMinInterval:(NSNumber * _Nonnull)minInterval @@ -26885,7 +26933,7 @@ - (void)subscribeAttributeStartUpModeWithMinInterval:(NSNumber * _Nonnull)minInt subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPInt8uAttributeCallbackSubscriptionBridge( + new CHIPNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { @@ -26893,11 +26941,11 @@ new CHIPInt8uAttributeCallbackSubscriptionBridge( return CHIP_ERROR_INVALID_ARGUMENT; } using TypeInfo = ModeSelect::Attributes::StartUpMode::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - CHIPInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + CHIPNullableInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); }, @@ -26910,7 +26958,7 @@ + (void)readAttributeStartUpModeWithAttributeCache:(CHIPAttributeCacheContainer completionHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + new CHIPNullableInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { if (attributeCacheContainer.cppAttributeCache) { chip::app::ConcreteAttributePath path; using TypeInfo = ModeSelect::Attributes::StartUpMode::TypeInfo; @@ -26919,7 +26967,7 @@ new CHIPInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su path.mAttributeId = TypeInfo::GetAttributeId(); TypeInfo::DecodableType value; CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); if (err == CHIP_NO_ERROR) { successFn->mCall(successFn->mContext, value); } @@ -26929,58 +26977,80 @@ new CHIPInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su }); } -- (void)readAttributeDescriptionWithCompletionHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))completionHandler +- (void)readAttributeOnModeWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPCharStringAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = ModeSelect::Attributes::Description::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); + new CHIPNullableInt8uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = ModeSelect::Attributes::OnMode::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); } -- (void)subscribeAttributeDescriptionWithMinInterval:(NSNumber * _Nonnull)minInterval - maxInterval:(NSNumber * _Nonnull)maxInterval - params:(CHIPSubscribeParams * _Nullable)params - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler +- (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { - new CHIPCharStringAttributeCallbackSubscriptionBridge( + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ModeSelect::Attributes::OnMode::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedCharValue; + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeOnModeWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { // We don't support disabling auto-resubscribe. return CHIP_ERROR_INVALID_ARGUMENT; } - using TypeInfo = ModeSelect::Attributes::Description::TypeInfo; - auto successFn = Callback::FromCancelable(success); + using TypeInfo = ModeSelect::Attributes::OnMode::TypeInfo; + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - CHIPCharStringAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + CHIPNullableInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); }, subscriptionEstablishedHandler); } -+ (void)readAttributeDescriptionWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completionHandler: - (void (^)(NSString * _Nullable value, NSError * _Nullable error))completionHandler ++ (void)readAttributeOnModeWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPCharStringAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + new CHIPNullableInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { if (attributeCacheContainer.cppAttributeCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = ModeSelect::Attributes::Description::TypeInfo; + using TypeInfo = ModeSelect::Attributes::OnMode::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); TypeInfo::DecodableType value; CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); if (err == CHIP_NO_ERROR) { successFn->mCall(successFn->mContext, value); } @@ -27183,6 +27253,66 @@ new CHIPModeSelectAttributeListListAttributeCallbackBridge( }); } +- (void)readAttributeFeatureMapWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt32uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = ModeSelect::Attributes::FeatureMap::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPInt32uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = ModeSelect::Attributes::FeatureMap::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPInt32uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeFeatureMapWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ModeSelect::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + - (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h index 85fdde05e6b7fb..c6753ae1bb6de0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h @@ -697,13 +697,15 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTestModeSelect : CHIPModeSelect -- (void)writeAttributeCurrentModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSupportedModesWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeDescriptionWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeStandardNamespaceWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeSupportedModesWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeCurrentModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm index 3eea99930f40c3..87bfd9a92e852f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm @@ -9250,7 +9250,7 @@ @implementation CHIPTestModeSelect return &_cppCluster; } -- (void)writeAttributeCurrentModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeDescriptionWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -9259,9 +9259,32 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ModeSelect::Attributes::CurrentMode::TypeInfo; + using TypeInfo = ModeSelect::Attributes::Description::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = [self asCharSpan:value]; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeStandardNamespaceWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ModeSelect::Attributes::StandardNamespace::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedShortValue; + } auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); @@ -9309,7 +9332,7 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeCurrentModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -9318,7 +9341,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ModeSelect::Attributes::StartUpMode::TypeInfo; + using TypeInfo = ModeSelect::Attributes::CurrentMode::TypeInfo; TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; auto successFn = Callback::FromCancelable(success); @@ -9327,7 +9350,7 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeDescriptionWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -9336,9 +9359,14 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ModeSelect::Attributes::Description::TypeInfo; + using TypeInfo = ModeSelect::Attributes::StartUpMode::TypeInfo; TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedCharValue; + } auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); @@ -9462,6 +9490,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ModeSelect::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 172fdd10c9f847..180ffae02bacba 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -48739,21 +48739,21 @@ - (void)testSendClusterTestModeSelectCluster_000000_WaitForCommissionee } - (void)testSendClusterTestModeSelectCluster_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read CurrentMode"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read Description"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read CurrentMode Error: %@", err); + [cluster readAttributeDescriptionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read Description Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); + XCTAssertTrue([actualValue isEqualToString:@"Coffee"]); } [expectation fulfill]; @@ -48763,21 +48763,22 @@ - (void)testSendClusterTestModeSelectCluster_000001_ReadAttribute } - (void)testSendClusterTestModeSelectCluster_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read OnMode"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read StandardNamespace"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read OnMode Error: %@", err); + [cluster readAttributeStandardNamespaceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read StandardNamespace Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedShortValue], 0U); } [expectation fulfill]; @@ -48787,21 +48788,30 @@ - (void)testSendClusterTestModeSelectCluster_000002_ReadAttribute } - (void)testSendClusterTestModeSelectCluster_000003_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read StartUpMode"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read SupportedModes"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeStartUpModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read StartUpMode Error: %@", err); + [cluster readAttributeSupportedModesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read SupportedModes Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertEqual([actualValue unsignedCharValue], 0); + XCTAssertEqual([actualValue count], 3); + XCTAssertTrue([((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).label isEqualToString:@"Black"]); + XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).mode unsignedCharValue], 0); + XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).semanticTag unsignedIntValue], 0UL); + XCTAssertTrue([((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).label isEqualToString:@"Cappuccino"]); + XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).mode unsignedCharValue], 4); + XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).semanticTag unsignedIntValue], 0UL); + XCTAssertTrue([((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).label isEqualToString:@"Espresso"]); + XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).mode unsignedCharValue], 7); + XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).semanticTag unsignedIntValue], 0UL); } [expectation fulfill]; @@ -48811,21 +48821,21 @@ - (void)testSendClusterTestModeSelectCluster_000003_ReadAttribute } - (void)testSendClusterTestModeSelectCluster_000004_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read Description"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read CurrentMode"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeDescriptionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read Description Error: %@", err); + [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CurrentMode Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertTrue([actualValue isEqualToString:@"Coffee"]); + XCTAssertEqual([actualValue unsignedCharValue], 0); } [expectation fulfill]; @@ -48835,30 +48845,22 @@ - (void)testSendClusterTestModeSelectCluster_000004_ReadAttribute } - (void)testSendClusterTestModeSelectCluster_000005_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read SupportedModes"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read StartUpMode"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeSupportedModesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read SupportedModes Error: %@", err); + [cluster readAttributeStartUpModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read StartUpMode Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertEqual([actualValue count], 3); - XCTAssertTrue([((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).label isEqualToString:@"Black"]); - XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).mode unsignedCharValue], 0); - XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).semanticTag unsignedIntValue], 0UL); - XCTAssertTrue([((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).label isEqualToString:@"Cappuccino"]); - XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).mode unsignedCharValue], 4); - XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).semanticTag unsignedIntValue], 0UL); - XCTAssertTrue([((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).label isEqualToString:@"Espresso"]); - XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).mode unsignedCharValue], 7); - XCTAssertEqual([((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).semanticTag unsignedIntValue], 0UL); + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedCharValue], 0); } [expectation fulfill]; @@ -48866,7 +48868,31 @@ - (void)testSendClusterTestModeSelectCluster_000005_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestModeSelectCluster_000006_ChangeToMode +- (void)testSendClusterTestModeSelectCluster_000006_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read OnMode"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOnModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read OnMode Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertTrue(actualValue == nil); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestModeSelectCluster_000007_ChangeToMode { XCTestExpectation * expectation = [self expectationWithDescription:@"Change to Supported Mode"]; @@ -48888,7 +48914,8 @@ - (void)testSendClusterTestModeSelectCluster_000006_ChangeToMode [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestModeSelectCluster_000007_ReadAttribute +NSNumber * _Nonnull currentModeBeforeToggle; +- (void)testSendClusterTestModeSelectCluster_000008_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Verify Current Mode Change"]; @@ -48906,13 +48933,17 @@ - (void)testSendClusterTestModeSelectCluster_000007_ReadAttribute id actualValue = value; XCTAssertEqual([actualValue unsignedCharValue], 4); } + { + id actualValue = value; + currentModeBeforeToggle = actualValue; + } [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestModeSelectCluster_000008_ChangeToMode +- (void)testSendClusterTestModeSelectCluster_000009_ChangeToMode { XCTestExpectation * expectation = [self expectationWithDescription:@"Change to Unsupported Mode"]; @@ -48933,6 +48964,182 @@ - (void)testSendClusterTestModeSelectCluster_000008_ChangeToMode [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTestModeSelectCluster_000010_Off +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Toggle OnOff"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Toggle OnOff Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestModeSelectCluster_000011_On +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Toggle OnOff"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Toggle OnOff Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestModeSelectCluster_000012_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Verify Current Mode does not change when OnMode is null"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify Current Mode does not change when OnMode is null Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqualObjects(actualValue, currentModeBeforeToggle); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestModeSelectCluster_000013_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Change OnMode"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id onModeArgument; + onModeArgument = [NSNumber numberWithUnsignedChar:7]; + [cluster writeAttributeOnModeWithValue:onModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Change OnMode Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +NSNumber * _Nullable OnModeValue; +- (void)testSendClusterTestModeSelectCluster_000014_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Verify OnMode"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOnModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify OnMode Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedCharValue], 7); + } + { + id actualValue = value; + OnModeValue = actualValue; + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestModeSelectCluster_000015_Off +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Toggle OnOff"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Toggle OnOff Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestModeSelectCluster_000016_On +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Toggle OnOff"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Toggle OnOff Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestModeSelectCluster_000017_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Verify Current Mode Changes if OnMode is not null"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify Current Mode Changes if OnMode is not null Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqualObjects(actualValue, OnModeValue); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} - (void)testSendClusterTestBinding_000000_WaitForCommissionee { diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index bbed336be01103..079fa1e2f326d6 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -291,189 +291,192 @@ /* 379 - Description, */ \ 6, 'C', 'o', 'f', 'f', 'e', 'e', \ \ + /* 386 - FeatureMap, */ \ + 0x00, 0x00, 0x00, 0x01, \ + \ /* Endpoint: 1, Cluster: Door Lock (server), big-endian */ \ \ - /* 386 - DoorOpenEvents, */ \ + /* 390 - DoorOpenEvents, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 390 - DoorClosedEvents, */ \ + /* 394 - DoorClosedEvents, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 394 - Language, */ \ + /* 398 - Language, */ \ 2, 'e', 'n', \ \ - /* 397 - AutoRelockTime, */ \ + /* 401 - AutoRelockTime, */ \ 0x00, 0x00, 0x00, 0x60, \ \ - /* 401 - FeatureMap, */ \ + /* 405 - FeatureMap, */ \ 0x00, 0x00, 0x01, 0x03, \ \ /* Endpoint: 1, Cluster: Window Covering (server), big-endian */ \ \ - /* 405 - FeatureMap, */ \ + /* 409 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x17, \ \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server), big-endian */ \ \ - /* 409 - LifetimeRunningHours, */ \ + /* 413 - LifetimeRunningHours, */ \ 0x00, 0x00, 0x00, \ \ - /* 412 - Power, */ \ + /* 416 - Power, */ \ 0x00, 0x00, 0x00, \ \ - /* 415 - LifetimeEnergyConsumed, */ \ + /* 419 - LifetimeEnergyConsumed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 419 - FeatureMap, */ \ + /* 423 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Thermostat (server), big-endian */ \ \ - /* 423 - FeatureMap, */ \ + /* 427 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0B, \ \ /* Endpoint: 1, Cluster: IAS Zone (server), big-endian */ \ \ - /* 427 - IAS CIE address, */ \ + /* 431 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Media Playback (server), big-endian */ \ \ - /* 435 - StartTime, */ \ + /* 439 - StartTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, \ \ - /* 443 - Duration, */ \ + /* 447 - Duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 451 - PlaybackSpeed, */ \ + /* 455 - PlaybackSpeed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 455 - SeekRangeEnd, */ \ + /* 459 - SeekRangeEnd, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 463 - SeekRangeStart, */ \ + /* 467 - SeekRangeStart, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Content Launcher (server), big-endian */ \ \ - /* 471 - SupportedStreamingProtocols, */ \ + /* 475 - SupportedStreamingProtocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Test Cluster (server), big-endian */ \ \ - /* 475 - bitmap32, */ \ + /* 479 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 479 - bitmap64, */ \ + /* 483 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 487 - int24u, */ \ + /* 491 - int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 490 - int32u, */ \ + /* 494 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 494 - int40u, */ \ + /* 498 - int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 499 - int48u, */ \ + /* 503 - int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 505 - int56u, */ \ + /* 509 - int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 512 - int64u, */ \ + /* 516 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 520 - int24s, */ \ + /* 524 - int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 523 - int32s, */ \ + /* 527 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 527 - int40s, */ \ + /* 531 - int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 532 - int48s, */ \ + /* 536 - int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 538 - int56s, */ \ + /* 542 - int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 545 - int64s, */ \ + /* 549 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 553 - float_single, */ \ + /* 557 - float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 557 - float_double, */ \ + /* 561 - float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 565 - epoch_us, */ \ + /* 569 - epoch_us, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 573 - epoch_s, */ \ + /* 577 - epoch_s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 577 - nullable_bitmap32, */ \ + /* 581 - nullable_bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 581 - nullable_bitmap64, */ \ + /* 585 - nullable_bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 589 - nullable_int24u, */ \ + /* 593 - nullable_int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 592 - nullable_int32u, */ \ + /* 596 - nullable_int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 596 - nullable_int40u, */ \ + /* 600 - nullable_int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 601 - nullable_int48u, */ \ + /* 605 - nullable_int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 607 - nullable_int56u, */ \ + /* 611 - nullable_int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 614 - nullable_int64u, */ \ + /* 618 - nullable_int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 622 - nullable_int24s, */ \ + /* 626 - nullable_int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 625 - nullable_int32s, */ \ + /* 629 - nullable_int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 629 - nullable_int40s, */ \ + /* 633 - nullable_int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 634 - nullable_int48s, */ \ + /* 638 - nullable_int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 640 - nullable_int56s, */ \ + /* 644 - nullable_int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 647 - nullable_int64s, */ \ + /* 651 - nullable_int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 655 - nullable_float_single, */ \ + /* 659 - nullable_float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 659 - nullable_float_double, */ \ + /* 663 - nullable_float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server), big-endian */ \ \ - /* 667 - measurement type, */ \ + /* 671 - measurement type, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 671 - total active power, */ \ + /* 675 - total active power, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 2, Cluster: On/Off (server), big-endian */ \ \ - /* 675 - FeatureMap, */ \ + /* 679 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } @@ -743,195 +746,198 @@ /* 379 - Description, */ \ 6, 'C', 'o', 'f', 'f', 'e', 'e', \ \ + /* 386 - FeatureMap, */ \ + 0x01, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 1, Cluster: Door Lock (server), little-endian */ \ \ - /* 386 - DoorOpenEvents, */ \ + /* 390 - DoorOpenEvents, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 390 - DoorClosedEvents, */ \ + /* 394 - DoorClosedEvents, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 394 - Language, */ \ + /* 398 - Language, */ \ 2, 'e', 'n', \ \ - /* 397 - AutoRelockTime, */ \ + /* 401 - AutoRelockTime, */ \ 0x60, 0x00, 0x00, 0x00, \ \ - /* 401 - FeatureMap, */ \ + /* 405 - FeatureMap, */ \ 0x03, 0x01, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Window Covering (server), little-endian */ \ \ - /* 405 - FeatureMap, */ \ + /* 409 - FeatureMap, */ \ 0x17, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server), little-endian */ \ \ - /* 409 - LifetimeRunningHours, */ \ + /* 413 - LifetimeRunningHours, */ \ 0x00, 0x00, 0x00, \ \ - /* 412 - Power, */ \ + /* 416 - Power, */ \ 0x00, 0x00, 0x00, \ \ - /* 415 - LifetimeEnergyConsumed, */ \ + /* 419 - LifetimeEnergyConsumed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 419 - FeatureMap, */ \ + /* 423 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Thermostat (server), little-endian */ \ \ - /* 423 - FeatureMap, */ \ + /* 427 - FeatureMap, */ \ 0x0B, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: IAS Zone (server), little-endian */ \ \ - /* 427 - IAS CIE address, */ \ + /* 431 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Media Playback (server), little-endian */ \ \ - /* 435 - StartTime, */ \ + /* 439 - StartTime, */ \ 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 443 - Duration, */ \ + /* 447 - Duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 451 - PlaybackSpeed, */ \ + /* 455 - PlaybackSpeed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 455 - SeekRangeEnd, */ \ + /* 459 - SeekRangeEnd, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 463 - SeekRangeStart, */ \ + /* 467 - SeekRangeStart, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Content Launcher (server), little-endian */ \ \ - /* 471 - SupportedStreamingProtocols, */ \ + /* 475 - SupportedStreamingProtocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Test Cluster (server), little-endian */ \ \ - /* 475 - bitmap32, */ \ + /* 479 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 479 - bitmap64, */ \ + /* 483 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 487 - int24u, */ \ + /* 491 - int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 490 - int32u, */ \ + /* 494 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 494 - int40u, */ \ + /* 498 - int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 499 - int48u, */ \ + /* 503 - int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 505 - int56u, */ \ + /* 509 - int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 512 - int64u, */ \ + /* 516 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 520 - int24s, */ \ + /* 524 - int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 523 - int32s, */ \ + /* 527 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 527 - int40s, */ \ + /* 531 - int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 532 - int48s, */ \ + /* 536 - int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 538 - int56s, */ \ + /* 542 - int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 545 - int64s, */ \ + /* 549 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 553 - float_single, */ \ + /* 557 - float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 557 - float_double, */ \ + /* 561 - float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 565 - epoch_us, */ \ + /* 569 - epoch_us, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 573 - epoch_s, */ \ + /* 577 - epoch_s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 577 - nullable_bitmap32, */ \ + /* 581 - nullable_bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 581 - nullable_bitmap64, */ \ + /* 585 - nullable_bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 589 - nullable_int24u, */ \ + /* 593 - nullable_int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 592 - nullable_int32u, */ \ + /* 596 - nullable_int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 596 - nullable_int40u, */ \ + /* 600 - nullable_int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 601 - nullable_int48u, */ \ + /* 605 - nullable_int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 607 - nullable_int56u, */ \ + /* 611 - nullable_int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 614 - nullable_int64u, */ \ + /* 618 - nullable_int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 622 - nullable_int24s, */ \ + /* 626 - nullable_int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 625 - nullable_int32s, */ \ + /* 629 - nullable_int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 629 - nullable_int40s, */ \ + /* 633 - nullable_int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 634 - nullable_int48s, */ \ + /* 638 - nullable_int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 640 - nullable_int56s, */ \ + /* 644 - nullable_int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 647 - nullable_int64s, */ \ + /* 651 - nullable_int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 655 - nullable_float_single, */ \ + /* 659 - nullable_float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 659 - nullable_float_double, */ \ + /* 663 - nullable_float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server), little-endian */ \ \ - /* 667 - measurement type, */ \ + /* 671 - measurement type, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 671 - total active power, */ \ + /* 675 - total active power, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 2, Cluster: On/Off (server), little-endian */ \ \ - /* 675 - FeatureMap, */ \ + /* 679 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (133) +#define GENERATED_DEFAULTS_COUNT (134) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -1027,7 +1033,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 629 +#define GENERATED_ATTRIBUTE_COUNT 631 #define GENERATED_ATTRIBUTES \ { \ \ @@ -1340,8 +1346,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: On/Off (server) */ \ - { 0x00000000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* OnOff */ \ - { 0x00004000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* GlobalSceneControl */ \ + { 0x00000000, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(TOKENIZE), ZAP_SIMPLE_DEFAULT(0x00) }, /* OnOff */ \ + { 0x00004000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* GlobalSceneControl */ \ { 0x00004001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OnTime */ \ { 0x00004002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OffWaitTime */ \ { 0x00004003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ @@ -1442,21 +1448,25 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Mode Select (server) */ \ - { 0x00000000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* CurrentMode */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SupportedModes */ \ - { 0x00000002, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OnMode */ \ - { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* StartUpMode */ \ - { 0x00000004, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(379) }, /* Description */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(379) }, /* Description */ \ + { 0x00000001, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0) }, /* StandardNamespace */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SupportedModes */ \ + { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* CurrentMode */ \ + { 0x00000004, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0) }, /* StartUpMode */ \ + { 0x00000005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(255) }, /* OnMode */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(386) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Door Lock (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(2) }, /* LockState */ \ { 0x00000001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LockType */ \ { 0x00000002, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ActuatorEnabled */ \ { 0x00000003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_EMPTY_DEFAULT() }, /* DoorState */ \ - { 0x00000004, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(386) }, /* DoorOpenEvents */ \ + { 0x00000004, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(390) }, /* DoorOpenEvents */ \ { 0x00000005, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(390) }, /* DoorClosedEvents */ \ + ZAP_LONG_DEFAULTS_INDEX(394) }, /* DoorClosedEvents */ \ { 0x00000006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* OpenPeriod */ \ { 0x00000011, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(10) }, /* NumberOfTotalUsersSupported */ \ { 0x00000012, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(10) }, /* NumberOfPINUsersSupported */ \ @@ -1469,8 +1479,8 @@ { 0x00000019, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(20) }, /* MaxRFIDCodeLength */ \ { 0x0000001A, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(10) }, /* MinRFIDCodeLength */ \ { 0x0000001B, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(1) }, /* CredentialRulesSupport */ \ - { 0x00000021, ZAP_TYPE(CHAR_STRING), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(394) }, /* Language */ \ - { 0x00000023, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(397) }, /* AutoRelockTime */ \ + { 0x00000021, ZAP_TYPE(CHAR_STRING), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(398) }, /* Language */ \ + { 0x00000023, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(401) }, /* AutoRelockTime */ \ { 0x00000024, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(6) }, /* SoundVolume */ \ { 0x00000025, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -1488,7 +1498,7 @@ ZAP_MIN_MAX_DEFAULTS_INDEX(9) }, /* UserCodeTemporaryDisableTime */ \ { 0x00000033, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* RequirePINforRemoteOperation */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(401) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(405) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Window Covering (server) */ \ @@ -1524,7 +1534,7 @@ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(10) }, /* Mode */ \ { 0x0000001A, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* SafetyStatus */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(405) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(409) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Barrier Control (server) */ \ @@ -1554,16 +1564,16 @@ { 0x00000013, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Capacity */ \ { 0x00000014, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Speed */ \ { 0x00000015, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(409) }, /* LifetimeRunningHours */ \ - { 0x00000016, ZAP_TYPE(INT24U), 3, 0, ZAP_LONG_DEFAULTS_INDEX(412) }, /* Power */ \ + ZAP_LONG_DEFAULTS_INDEX(413) }, /* LifetimeRunningHours */ \ + { 0x00000016, ZAP_TYPE(INT24U), 3, 0, ZAP_LONG_DEFAULTS_INDEX(416) }, /* Power */ \ { 0x00000017, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(415) }, /* LifetimeEnergyConsumed */ \ + ZAP_LONG_DEFAULTS_INDEX(419) }, /* LifetimeEnergyConsumed */ \ { 0x00000020, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(11) }, /* OperationMode */ \ { 0x00000021, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(12) }, /* ControlMode */ \ { 0x00000022, ZAP_TYPE(BITMAP16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* AlarmMask */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(419) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(423) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ @@ -1593,7 +1603,7 @@ { 0x00000020, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* start of week */ \ { 0x00000021, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(7) }, /* number of weekly transitions */ \ { 0x00000022, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(4) }, /* number of daily transitions */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(423) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(427) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ @@ -1716,7 +1726,7 @@ { 0x00000001, ZAP_TYPE(ENUM16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* zone type */ \ { 0x00000002, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* zone status */ \ { 0x00000010, ZAP_TYPE(NODE_ID), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(427) }, /* IAS CIE address */ \ + ZAP_LONG_DEFAULTS_INDEX(431) }, /* IAS CIE address */ \ { 0x00000011, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xff) }, /* Zone ID */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ @@ -1735,11 +1745,11 @@ \ /* Endpoint: 1, Cluster: Media Playback (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* CurrentState */ \ - { 0x00000001, ZAP_TYPE(EPOCH_US), 8, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_LONG_DEFAULTS_INDEX(435) }, /* StartTime */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_LONG_DEFAULTS_INDEX(443) }, /* Duration */ \ - { 0x00000004, ZAP_TYPE(SINGLE), 4, 0, ZAP_LONG_DEFAULTS_INDEX(451) }, /* PlaybackSpeed */ \ - { 0x00000005, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_LONG_DEFAULTS_INDEX(455) }, /* SeekRangeEnd */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_LONG_DEFAULTS_INDEX(463) }, /* SeekRangeStart */ \ + { 0x00000001, ZAP_TYPE(EPOCH_US), 8, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_LONG_DEFAULTS_INDEX(439) }, /* StartTime */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_LONG_DEFAULTS_INDEX(447) }, /* Duration */ \ + { 0x00000004, ZAP_TYPE(SINGLE), 4, 0, ZAP_LONG_DEFAULTS_INDEX(455) }, /* PlaybackSpeed */ \ + { 0x00000005, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_LONG_DEFAULTS_INDEX(459) }, /* SeekRangeEnd */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_LONG_DEFAULTS_INDEX(467) }, /* SeekRangeStart */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Media Input (server) */ \ @@ -1756,7 +1766,7 @@ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AcceptHeader */ \ { 0x00000001, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(471) }, /* SupportedStreamingProtocols */ \ + ZAP_LONG_DEFAULTS_INDEX(475) }, /* SupportedStreamingProtocols */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Audio Output (server) */ \ @@ -1785,28 +1795,28 @@ { 0x00000000, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(false) }, /* boolean */ \ { 0x00000001, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap8 */ \ { 0x00000002, ZAP_TYPE(BITMAP16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap16 */ \ - { 0x00000003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(475) }, /* bitmap32 */ \ - { 0x00000004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(479) }, /* bitmap64 */ \ + { 0x00000003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(479) }, /* bitmap32 */ \ + { 0x00000004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(483) }, /* bitmap64 */ \ { 0x00000005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8u */ \ { 0x00000006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16u */ \ - { 0x00000007, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(487) }, /* int24u */ \ - { 0x00000008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(490) }, /* int32u */ \ - { 0x00000009, ZAP_TYPE(INT40U), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(494) }, /* int40u */ \ - { 0x0000000A, ZAP_TYPE(INT48U), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(499) }, /* int48u */ \ - { 0x0000000B, ZAP_TYPE(INT56U), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(505) }, /* int56u */ \ - { 0x0000000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(512) }, /* int64u */ \ + { 0x00000007, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(491) }, /* int24u */ \ + { 0x00000008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(494) }, /* int32u */ \ + { 0x00000009, ZAP_TYPE(INT40U), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(498) }, /* int40u */ \ + { 0x0000000A, ZAP_TYPE(INT48U), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(503) }, /* int48u */ \ + { 0x0000000B, ZAP_TYPE(INT56U), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(509) }, /* int56u */ \ + { 0x0000000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(516) }, /* int64u */ \ { 0x0000000D, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8s */ \ { 0x0000000E, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16s */ \ - { 0x0000000F, ZAP_TYPE(INT24S), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(520) }, /* int24s */ \ - { 0x00000010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(523) }, /* int32s */ \ - { 0x00000011, ZAP_TYPE(INT40S), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(527) }, /* int40s */ \ - { 0x00000012, ZAP_TYPE(INT48S), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(532) }, /* int48s */ \ - { 0x00000013, ZAP_TYPE(INT56S), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(538) }, /* int56s */ \ - { 0x00000014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(545) }, /* int64s */ \ + { 0x0000000F, ZAP_TYPE(INT24S), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(524) }, /* int24s */ \ + { 0x00000010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(527) }, /* int32s */ \ + { 0x00000011, ZAP_TYPE(INT40S), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(531) }, /* int40s */ \ + { 0x00000012, ZAP_TYPE(INT48S), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(536) }, /* int48s */ \ + { 0x00000013, ZAP_TYPE(INT56S), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(542) }, /* int56s */ \ + { 0x00000014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(549) }, /* int64s */ \ { 0x00000015, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum8 */ \ { 0x00000016, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum16 */ \ - { 0x00000017, ZAP_TYPE(SINGLE), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(553) }, /* float_single */ \ - { 0x00000018, ZAP_TYPE(DOUBLE), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(557) }, /* float_double */ \ + { 0x00000017, ZAP_TYPE(SINGLE), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(557) }, /* float_single */ \ + { 0x00000018, ZAP_TYPE(DOUBLE), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(561) }, /* float_double */ \ { 0x00000019, ZAP_TYPE(OCTET_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* octet_string */ \ { 0x0000001A, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* list_int8u */ \ @@ -1819,8 +1829,8 @@ { 0x0000001E, ZAP_TYPE(CHAR_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* char_string */ \ { 0x0000001F, ZAP_TYPE(LONG_CHAR_STRING), 1002, ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* long_char_string */ \ - { 0x00000020, ZAP_TYPE(EPOCH_US), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(565) }, /* epoch_us */ \ - { 0x00000021, ZAP_TYPE(EPOCH_S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(573) }, /* epoch_s */ \ + { 0x00000020, ZAP_TYPE(EPOCH_US), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(569) }, /* epoch_us */ \ + { 0x00000021, ZAP_TYPE(EPOCH_S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(577) }, /* epoch_s */ \ { 0x00000022, ZAP_TYPE(VENDOR_ID), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* vendor_id */ \ { 0x00000023, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* list_nullables_and_optionals_struct */ \ @@ -1852,49 +1862,49 @@ { 0x00008002, ZAP_TYPE(BITMAP16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_bitmap16 */ \ { 0x00008003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(577) }, /* nullable_bitmap32 */ \ + ZAP_LONG_DEFAULTS_INDEX(581) }, /* nullable_bitmap32 */ \ { 0x00008004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(581) }, /* nullable_bitmap64 */ \ + ZAP_LONG_DEFAULTS_INDEX(585) }, /* nullable_bitmap64 */ \ { 0x00008005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int8u */ \ { 0x00008006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int16u */ \ { 0x00008007, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(589) }, /* nullable_int24u */ \ + ZAP_LONG_DEFAULTS_INDEX(593) }, /* nullable_int24u */ \ { 0x00008008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(592) }, /* nullable_int32u */ \ + ZAP_LONG_DEFAULTS_INDEX(596) }, /* nullable_int32u */ \ { 0x00008009, ZAP_TYPE(INT40U), 5, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(596) }, /* nullable_int40u */ \ + ZAP_LONG_DEFAULTS_INDEX(600) }, /* nullable_int40u */ \ { 0x0000800A, ZAP_TYPE(INT48U), 6, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(601) }, /* nullable_int48u */ \ + ZAP_LONG_DEFAULTS_INDEX(605) }, /* nullable_int48u */ \ { 0x0000800B, ZAP_TYPE(INT56U), 7, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(607) }, /* nullable_int56u */ \ + ZAP_LONG_DEFAULTS_INDEX(611) }, /* nullable_int56u */ \ { 0x0000800C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(614) }, /* nullable_int64u */ \ + ZAP_LONG_DEFAULTS_INDEX(618) }, /* nullable_int64u */ \ { 0x0000800D, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int8s */ \ { 0x0000800E, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int16s */ \ { 0x0000800F, ZAP_TYPE(INT24S), 3, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(622) }, /* nullable_int24s */ \ + ZAP_LONG_DEFAULTS_INDEX(626) }, /* nullable_int24s */ \ { 0x00008010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(625) }, /* nullable_int32s */ \ + ZAP_LONG_DEFAULTS_INDEX(629) }, /* nullable_int32s */ \ { 0x00008011, ZAP_TYPE(INT40S), 5, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(629) }, /* nullable_int40s */ \ + ZAP_LONG_DEFAULTS_INDEX(633) }, /* nullable_int40s */ \ { 0x00008012, ZAP_TYPE(INT48S), 6, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(634) }, /* nullable_int48s */ \ + ZAP_LONG_DEFAULTS_INDEX(638) }, /* nullable_int48s */ \ { 0x00008013, ZAP_TYPE(INT56S), 7, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(640) }, /* nullable_int56s */ \ + ZAP_LONG_DEFAULTS_INDEX(644) }, /* nullable_int56s */ \ { 0x00008014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(647) }, /* nullable_int64s */ \ + ZAP_LONG_DEFAULTS_INDEX(651) }, /* nullable_int64s */ \ { 0x00008015, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_enum8 */ \ { 0x00008016, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_enum16 */ \ { 0x00008017, ZAP_TYPE(SINGLE), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(655) }, /* nullable_float_single */ \ + ZAP_LONG_DEFAULTS_INDEX(659) }, /* nullable_float_single */ \ { 0x00008018, ZAP_TYPE(DOUBLE), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(659) }, /* nullable_float_double */ \ + ZAP_LONG_DEFAULTS_INDEX(663) }, /* nullable_float_double */ \ { 0x00008019, ZAP_TYPE(OCTET_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_EMPTY_DEFAULT() }, /* nullable_octet_string */ \ { 0x0000801E, ZAP_TYPE(CHAR_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ @@ -1919,8 +1929,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ - { 0x00000000, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(667) }, /* measurement type */ \ - { 0x00000304, ZAP_TYPE(INT32S), 4, 0, ZAP_LONG_DEFAULTS_INDEX(671) }, /* total active power */ \ + { 0x00000000, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(671) }, /* measurement type */ \ + { 0x00000304, ZAP_TYPE(INT32S), 4, 0, ZAP_LONG_DEFAULTS_INDEX(675) }, /* total active power */ \ { 0x00000505, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xffff) }, /* rms voltage */ \ { 0x00000506, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* rms voltage min */ \ { 0x00000507, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* rms voltage max */ \ @@ -1943,7 +1953,7 @@ { 0x00004002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OffWaitTime */ \ { 0x00004003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(675) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(679) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ @@ -2856,8 +2866,8 @@ /* Endpoint: 1, Cluster: Mode Select (server) */ \ .clusterId = 0x00000050, \ .attributes = ZAP_ATTRIBUTE_INDEX(272), \ - .attributeCount = 6, \ - .clusterSize = 38, \ + .attributeCount = 8, \ + .clusterSize = 44, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 125 ) ,\ @@ -2866,7 +2876,7 @@ { \ /* Endpoint: 1, Cluster: Door Lock (server) */ \ .clusterId = 0x00000101, \ - .attributes = ZAP_ATTRIBUTE_INDEX(278), \ + .attributes = ZAP_ATTRIBUTE_INDEX(280), \ .attributeCount = 32, \ .clusterSize = 54, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2877,7 +2887,7 @@ { \ /* Endpoint: 1, Cluster: Window Covering (server) */ \ .clusterId = 0x00000102, \ - .attributes = ZAP_ATTRIBUTE_INDEX(310), \ + .attributes = ZAP_ATTRIBUTE_INDEX(312), \ .attributeCount = 20, \ .clusterSize = 35, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2888,7 +2898,7 @@ { \ /* Endpoint: 1, Cluster: Barrier Control (server) */ \ .clusterId = 0x00000103, \ - .attributes = ZAP_ATTRIBUTE_INDEX(330), \ + .attributes = ZAP_ATTRIBUTE_INDEX(332), \ .attributeCount = 5, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2899,7 +2909,7 @@ { \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ .clusterId = 0x00000200, \ - .attributes = ZAP_ATTRIBUTE_INDEX(335), \ + .attributes = ZAP_ATTRIBUTE_INDEX(337), \ .attributeCount = 26, \ .clusterSize = 54, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2910,7 +2920,7 @@ { \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ .clusterId = 0x00000201, \ - .attributes = ZAP_ATTRIBUTE_INDEX(361), \ + .attributes = ZAP_ATTRIBUTE_INDEX(363), \ .attributeCount = 19, \ .clusterSize = 34, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2921,7 +2931,7 @@ { \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ .clusterId = 0x00000204, \ - .attributes = ZAP_ATTRIBUTE_INDEX(380), \ + .attributes = ZAP_ATTRIBUTE_INDEX(382), \ .attributeCount = 4, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2932,7 +2942,7 @@ { \ /* Endpoint: 1, Cluster: Color Control (server) */ \ .clusterId = 0x00000300, \ - .attributes = ZAP_ATTRIBUTE_INDEX(384), \ + .attributes = ZAP_ATTRIBUTE_INDEX(386), \ .attributeCount = 53, \ .clusterSize = 341, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2943,7 +2953,7 @@ { \ /* Endpoint: 1, Cluster: Illuminance Measurement (server) */ \ .clusterId = 0x00000400, \ - .attributes = ZAP_ATTRIBUTE_INDEX(437), \ + .attributes = ZAP_ATTRIBUTE_INDEX(439), \ .attributeCount = 6, \ .clusterSize = 11, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2954,7 +2964,7 @@ { \ /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ .clusterId = 0x00000402, \ - .attributes = ZAP_ATTRIBUTE_INDEX(443), \ + .attributes = ZAP_ATTRIBUTE_INDEX(445), \ .attributeCount = 5, \ .clusterSize = 10, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2965,7 +2975,7 @@ { \ /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ .clusterId = 0x00000403, \ - .attributes = ZAP_ATTRIBUTE_INDEX(448), \ + .attributes = ZAP_ATTRIBUTE_INDEX(450), \ .attributeCount = 4, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2976,7 +2986,7 @@ { \ /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ .clusterId = 0x00000404, \ - .attributes = ZAP_ATTRIBUTE_INDEX(452), \ + .attributes = ZAP_ATTRIBUTE_INDEX(454), \ .attributeCount = 5, \ .clusterSize = 10, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2987,7 +2997,7 @@ { \ /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ .clusterId = 0x00000405, \ - .attributes = ZAP_ATTRIBUTE_INDEX(457), \ + .attributes = ZAP_ATTRIBUTE_INDEX(459), \ .attributeCount = 5, \ .clusterSize = 10, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2998,7 +3008,7 @@ { \ /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(462), \ + .attributes = ZAP_ATTRIBUTE_INDEX(464), \ .attributeCount = 4, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -3009,7 +3019,7 @@ { \ /* Endpoint: 1, Cluster: IAS Zone (server) */ \ .clusterId = 0x00000500, \ - .attributes = ZAP_ATTRIBUTE_INDEX(466), \ + .attributes = ZAP_ATTRIBUTE_INDEX(468), \ .attributeCount = 6, \ .clusterSize = 16, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ @@ -3020,7 +3030,7 @@ { \ /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ .clusterId = 0x00000503, \ - .attributes = ZAP_ATTRIBUTE_INDEX(472), \ + .attributes = ZAP_ATTRIBUTE_INDEX(474), \ .attributeCount = 2, \ .clusterSize = 35, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3031,7 +3041,7 @@ { \ /* Endpoint: 1, Cluster: Channel (server) */ \ .clusterId = 0x00000504, \ - .attributes = ZAP_ATTRIBUTE_INDEX(474), \ + .attributes = ZAP_ATTRIBUTE_INDEX(476), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3042,7 +3052,7 @@ { \ /* Endpoint: 1, Cluster: Target Navigator (server) */ \ .clusterId = 0x00000505, \ - .attributes = ZAP_ATTRIBUTE_INDEX(476), \ + .attributes = ZAP_ATTRIBUTE_INDEX(478), \ .attributeCount = 3, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3053,7 +3063,7 @@ { \ /* Endpoint: 1, Cluster: Media Playback (server) */ \ .clusterId = 0x00000506, \ - .attributes = ZAP_ATTRIBUTE_INDEX(479), \ + .attributes = ZAP_ATTRIBUTE_INDEX(481), \ .attributeCount = 7, \ .clusterSize = 39, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3064,7 +3074,7 @@ { \ /* Endpoint: 1, Cluster: Media Input (server) */ \ .clusterId = 0x00000507, \ - .attributes = ZAP_ATTRIBUTE_INDEX(486), \ + .attributes = ZAP_ATTRIBUTE_INDEX(488), \ .attributeCount = 3, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3075,7 +3085,7 @@ { \ /* Endpoint: 1, Cluster: Low Power (server) */ \ .clusterId = 0x00000508, \ - .attributes = ZAP_ATTRIBUTE_INDEX(489), \ + .attributes = ZAP_ATTRIBUTE_INDEX(491), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3086,7 +3096,7 @@ { \ /* Endpoint: 1, Cluster: Keypad Input (server) */ \ .clusterId = 0x00000509, \ - .attributes = ZAP_ATTRIBUTE_INDEX(490), \ + .attributes = ZAP_ATTRIBUTE_INDEX(492), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3097,7 +3107,7 @@ { \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ .clusterId = 0x0000050A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(491), \ + .attributes = ZAP_ATTRIBUTE_INDEX(493), \ .attributeCount = 3, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3108,7 +3118,7 @@ { \ /* Endpoint: 1, Cluster: Audio Output (server) */ \ .clusterId = 0x0000050B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(494), \ + .attributes = ZAP_ATTRIBUTE_INDEX(496), \ .attributeCount = 3, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3119,7 +3129,7 @@ { \ /* Endpoint: 1, Cluster: Application Launcher (server) */ \ .clusterId = 0x0000050C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(497), \ + .attributes = ZAP_ATTRIBUTE_INDEX(499), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3130,7 +3140,7 @@ { \ /* Endpoint: 1, Cluster: Application Basic (server) */ \ .clusterId = 0x0000050D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(499), \ + .attributes = ZAP_ATTRIBUTE_INDEX(501), \ .attributeCount = 8, \ .clusterSize = 106, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3141,7 +3151,7 @@ { \ /* Endpoint: 1, Cluster: Account Login (server) */ \ .clusterId = 0x0000050E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(507), \ + .attributes = ZAP_ATTRIBUTE_INDEX(509), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3152,7 +3162,7 @@ { \ /* Endpoint: 1, Cluster: Test Cluster (server) */ \ .clusterId = 0x0000050F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(508), \ + .attributes = ZAP_ATTRIBUTE_INDEX(510), \ .attributeCount = 81, \ .clusterSize = 2285, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3163,7 +3173,7 @@ { \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ .clusterId = 0x00000B04, \ - .attributes = ZAP_ATTRIBUTE_INDEX(589), \ + .attributes = ZAP_ATTRIBUTE_INDEX(591), \ .attributeCount = 12, \ .clusterSize = 28, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3174,7 +3184,7 @@ { \ /* Endpoint: 2, Cluster: Groups (server) */ \ .clusterId = 0x00000004, \ - .attributes = ZAP_ATTRIBUTE_INDEX(601), \ + .attributes = ZAP_ATTRIBUTE_INDEX(603), \ .attributeCount = 2, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -3185,7 +3195,7 @@ { \ /* Endpoint: 2, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(603), \ + .attributes = ZAP_ATTRIBUTE_INDEX(605), \ .attributeCount = 7, \ .clusterSize = 13, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -3196,7 +3206,7 @@ { \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(610), \ + .attributes = ZAP_ATTRIBUTE_INDEX(612), \ .attributeCount = 5, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3207,7 +3217,7 @@ { \ /* Endpoint: 2, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(615), \ + .attributes = ZAP_ATTRIBUTE_INDEX(617), \ .attributeCount = 4, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -3218,7 +3228,7 @@ { \ /* Endpoint: 65534, Cluster: Network Commissioning (server) */ \ .clusterId = 0x00000031, \ - .attributes = ZAP_ATTRIBUTE_INDEX(619), \ + .attributes = ZAP_ATTRIBUTE_INDEX(621), \ .attributeCount = 10, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3237,7 +3247,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 26, 598 }, { ZAP_CLUSTER_INDEX(26), 44, 3319 }, { ZAP_CLUSTER_INDEX(70), 4, 21 }, \ + { ZAP_CLUSTER_INDEX(0), 26, 598 }, { ZAP_CLUSTER_INDEX(26), 44, 3325 }, { ZAP_CLUSTER_INDEX(70), 4, 21 }, \ { ZAP_CLUSTER_INDEX(74), 1, 0 }, \ } @@ -3250,7 +3260,7 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, #define ATTRIBUTE_SINGLETONS_SIZE (39) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (3938) +#define ATTRIBUTE_MAX_SIZE (3944) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (4) diff --git a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h index 0d1ed3f8fd3dde..be05e5d61d1b55 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h @@ -661,11 +661,12 @@ // Client attributes // Server attributes -#define ZCL_CURRENT_MODE_ATTRIBUTE_ID (0x0000) -#define ZCL_SUPPORTED_MODES_ATTRIBUTE_ID (0x0001) -#define ZCL_ON_MODE_ATTRIBUTE_ID (0x0002) -#define ZCL_START_UP_MODE_ATTRIBUTE_ID (0x0003) -#define ZCL_MODE_DESCRIPTION_ATTRIBUTE_ID (0x0004) +#define ZCL_MODE_DESCRIPTION_ATTRIBUTE_ID (0x0000) +#define ZCL_STANDARD_NAMESPACE_ATTRIBUTE_ID (0x0001) +#define ZCL_SUPPORTED_MODES_ATTRIBUTE_ID (0x0002) +#define ZCL_CURRENT_MODE_ATTRIBUTE_ID (0x0003) +#define ZCL_START_UP_MODE_ATTRIBUTE_ID (0x0004) +#define ZCL_ON_MODE_ATTRIBUTE_ID (0x0005) // Attribute ids for cluster: Shade Configuration 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 7bf0f6c52799e8..196bd9a7ffb77e 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 @@ -13273,38 +13273,90 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) namespace ModeSelect { namespace Attributes { -namespace CurrentMode { +namespace Description { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - using Traits = NumericAttributeTraits; + uint8_t zclString[32 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_DATA_TYPE); + memcpy(value.data(), &zclString[1], 32); + value.reduce_size(length); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + uint8_t zclString[32 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace Description + +namespace StandardNamespace { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_ENUM16_ATTRIBUTE_TYPE); } -} // namespace CurrentMode +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_ENUM16_ATTRIBUTE_TYPE); +} -namespace OnMode { +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace StandardNamespace + +namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { @@ -13333,28 +13385,31 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -} // namespace OnMode +} // namespace CurrentMode namespace StartUpMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } @@ -13364,37 +13419,79 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + } // namespace StartUpMode -namespace Description { +namespace OnMode { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - uint8_t zclString[32 + 1]; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, zclString, sizeof(zclString)); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) + if (Traits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} - VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_DATA_TYPE); - memcpy(value.data(), &zclString[1], 32); - value.reduce_size(length); - return status; +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { - static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - uint8_t zclString[32 + 1]; - emberAfCopyInt8u(zclString, 0, static_cast(value.size())); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); } -} // namespace Description +} // namespace OnMode namespace FeatureMap { 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 db6e51b8e891ab..59370c671dd012 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 @@ -2387,25 +2387,36 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); namespace ModeSelect { namespace Attributes { +namespace Description { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace Description + +namespace StandardNamespace { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // enum16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +} // namespace StandardNamespace + namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace CurrentMode -namespace OnMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); -} // namespace OnMode - namespace StartUpMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace StartUpMode -namespace Description { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); -} // namespace Description +namespace OnMode { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +} // namespace OnMode namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 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 d3207eef9140c3..d37115f911985b 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 @@ -941,6 +941,12 @@ namespace BooleanState { } // namespace BooleanState namespace ModeSelect { + +// Bitmap for ModeSelectFeature +enum class ModeSelectFeature : uint32_t +{ + kDeponoff = 0x1, +}; } // namespace ModeSelect namespace ShadeConfiguration { 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 6402c10a79f0a8..9bb9e4aa96ba8f 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 @@ -11696,20 +11696,23 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { - case Attributes::CurrentMode::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, currentMode)); + case Attributes::Description::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, description)); + break; + case Attributes::StandardNamespace::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, standardNamespace)); break; case Attributes::SupportedModes::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, supportedModes)); break; - case Attributes::OnMode::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, onMode)); + case Attributes::CurrentMode::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, currentMode)); break; case Attributes::StartUpMode::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, startUpMode)); break; - case Attributes::Description::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, description)); + case Attributes::OnMode::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, onMode)); break; case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); 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 1fb260967210aa..b7aa0cee8eb298 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 @@ -16958,18 +16958,31 @@ struct DecodableType namespace Attributes { -namespace CurrentMode { +namespace Description { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; + using Type = chip::CharSpan; + using DecodableType = chip::CharSpan; + using DecodableArgType = chip::CharSpan; static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::CurrentMode::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::Description::Id; } static constexpr bool MustUseTimedWrite() { return false; } + static constexpr size_t MaxLength() { return 32; } }; -} // namespace CurrentMode +} // namespace Description +namespace StandardNamespace { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::StandardNamespace::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace StandardNamespace namespace SupportedModes { struct TypeInfo { @@ -16984,7 +16997,7 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace SupportedModes -namespace OnMode { +namespace CurrentMode { struct TypeInfo { using Type = uint8_t; @@ -16992,35 +17005,34 @@ struct TypeInfo using DecodableArgType = uint8_t; static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::OnMode::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CurrentMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; -} // namespace OnMode +} // namespace CurrentMode namespace StartUpMode { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::StartUpMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace StartUpMode -namespace Description { +namespace OnMode { struct TypeInfo { - using Type = chip::CharSpan; - using DecodableType = chip::CharSpan; - using DecodableArgType = chip::CharSpan; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::Description::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::OnMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } - static constexpr size_t MaxLength() { return 32; } }; -} // namespace Description +} // namespace OnMode namespace GeneratedCommandList { struct TypeInfo { @@ -17090,11 +17102,12 @@ struct TypeInfo CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - Attributes::CurrentMode::TypeInfo::DecodableType currentMode = static_cast(0); - Attributes::SupportedModes::TypeInfo::DecodableType supportedModes; - Attributes::OnMode::TypeInfo::DecodableType onMode = static_cast(0); - Attributes::StartUpMode::TypeInfo::DecodableType startUpMode = static_cast(0); Attributes::Description::TypeInfo::DecodableType description; + Attributes::StandardNamespace::TypeInfo::DecodableType standardNamespace; + Attributes::SupportedModes::TypeInfo::DecodableType supportedModes; + Attributes::CurrentMode::TypeInfo::DecodableType currentMode = static_cast(0); + Attributes::StartUpMode::TypeInfo::DecodableType startUpMode; + Attributes::OnMode::TypeInfo::DecodableType onMode; Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::AttributeList::TypeInfo::DecodableType attributeList; diff --git a/zzz_generated/app-common/app-common/zap-generated/enums.h b/zzz_generated/app-common/app-common/zap-generated/enums.h index 041edefe735bab..e2fd7404f342ba 100644 --- a/zzz_generated/app-common/app-common/zap-generated/enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/enums.h @@ -846,6 +846,8 @@ enum EmberAfWiFiVersionType : uint8_t #define EMBER_AF_MODE_FOR_SEQUENCE_HEAT_SETPOINT_FIELD_PRESENT_OFFSET (0) #define EMBER_AF_MODE_FOR_SEQUENCE_COOL_SETPOINT_FIELD_PRESENT (2) #define EMBER_AF_MODE_FOR_SEQUENCE_COOL_SETPOINT_FIELD_PRESENT_OFFSET (1) +#define EMBER_AF_MODE_SELECT_FEATURE_DEPONOFF (1) +#define EMBER_AF_MODE_SELECT_FEATURE_DEPONOFF_OFFSET (0) #define EMBER_AF_NETWORK_COMMISSIONING_FEATURE_WI_FI_NETWORK_INTERFACE (1) #define EMBER_AF_NETWORK_COMMISSIONING_FEATURE_WI_FI_NETWORK_INTERFACE_OFFSET (0) #define EMBER_AF_NETWORK_COMMISSIONING_FEATURE_THREAD_NETWORK_INTERFACE (2) 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 5b0a2deac5d8fd..35fc05d30b1f2c 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 @@ -2656,25 +2656,29 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; namespace ModeSelect { namespace Attributes { -namespace CurrentMode { +namespace Description { static constexpr AttributeId Id = 0x00000000; -} // namespace CurrentMode +} // namespace Description -namespace SupportedModes { +namespace StandardNamespace { static constexpr AttributeId Id = 0x00000001; -} // namespace SupportedModes +} // namespace StandardNamespace -namespace OnMode { +namespace SupportedModes { static constexpr AttributeId Id = 0x00000002; -} // namespace OnMode +} // namespace SupportedModes -namespace StartUpMode { +namespace CurrentMode { static constexpr AttributeId Id = 0x00000003; -} // namespace StartUpMode +} // namespace CurrentMode -namespace Description { +namespace StartUpMode { static constexpr AttributeId Id = 0x00000004; -} // namespace Description +} // namespace StartUpMode + +namespace OnMode { +static constexpr AttributeId Id = 0x00000005; +} // namespace OnMode namespace GeneratedCommandList { static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; diff --git a/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.h b/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.h index 85fdde05e6b7fb..c6753ae1bb6de0 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.h @@ -697,13 +697,15 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTestModeSelect : CHIPModeSelect -- (void)writeAttributeCurrentModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSupportedModesWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeDescriptionWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeStandardNamespaceWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeSupportedModesWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeCurrentModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end diff --git a/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.mm b/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.mm index 3eea99930f40c3..87bfd9a92e852f 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.mm +++ b/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.mm @@ -9250,7 +9250,7 @@ @implementation CHIPTestModeSelect return &_cppCluster; } -- (void)writeAttributeCurrentModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeDescriptionWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -9259,9 +9259,32 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ModeSelect::Attributes::CurrentMode::TypeInfo; + using TypeInfo = ModeSelect::Attributes::Description::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = [self asCharSpan:value]; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeStandardNamespaceWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ModeSelect::Attributes::StandardNamespace::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedShortValue; + } auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); @@ -9309,7 +9332,7 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeCurrentModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -9318,7 +9341,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ModeSelect::Attributes::StartUpMode::TypeInfo; + using TypeInfo = ModeSelect::Attributes::CurrentMode::TypeInfo; TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; auto successFn = Callback::FromCancelable(success); @@ -9327,7 +9350,7 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeDescriptionWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -9336,9 +9359,14 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ModeSelect::Attributes::Description::TypeInfo; + using TypeInfo = ModeSelect::Attributes::StartUpMode::TypeInfo; TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedCharValue; + } auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); @@ -9462,6 +9490,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ModeSelect::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( diff --git a/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h index e31f0207eab1c7..e5b2fae755e46c 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h @@ -34568,11 +34568,12 @@ class SubscribeAttributeMediaPlaybackClusterRevision : public ModelCommand { | * ChangeToMode | 0x00 | |------------------------------------------------------------------------------| | Attributes: | | -| * CurrentMode | 0x0000 | -| * SupportedModes | 0x0001 | -| * OnMode | 0x0002 | -| * StartUpMode | 0x0003 | -| * Description | 0x0004 | +| * Description | 0x0000 | +| * StandardNamespace | 0x0001 | +| * SupportedModes | 0x0002 | +| * CurrentMode | 0x0003 | +| * StartUpMode | 0x0004 | +| * OnMode | 0x0005 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * AttributeList | 0xFFFB | @@ -34617,18 +34618,18 @@ class ModeSelectChangeToMode : public ModelCommand { }; /* - * Attribute CurrentMode + * Attribute Description */ -class ReadModeSelectCurrentMode : public ModelCommand { +class ReadModeSelectDescription : public ModelCommand { public: - ReadModeSelectCurrentMode() + ReadModeSelectDescription() : ModelCommand("read") { - AddArgument("attr-name", "current-mode"); + AddArgument("attr-name", "description"); ModelCommand::AddArguments(); } - ~ReadModeSelectCurrentMode() {} + ~ReadModeSelectDescription() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { @@ -34637,30 +34638,30 @@ class ReadModeSelectCurrentMode : public ModelCommand { dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.CurrentMode response %@", [value description]); + [cluster readAttributeDescriptionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.Description response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "ModeSelect CurrentMode Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ModeSelect Description Error: %s", chip::ErrorStr(err)); SetCommandExitStatus(err); }]; return err; } }; -class SubscribeAttributeModeSelectCurrentMode : public ModelCommand { +class SubscribeAttributeModeSelectDescription : public ModelCommand { public: - SubscribeAttributeModeSelectCurrentMode() + SubscribeAttributeModeSelectDescription() : ModelCommand("subscribe") { - AddArgument("attr-name", "current-mode"); + AddArgument("attr-name", "description"); AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); AddArgument("wait", 0, 1, &mWait); ModelCommand::AddArguments(); } - ~SubscribeAttributeModeSelectCurrentMode() {} + ~SubscribeAttributeModeSelectDescription() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { @@ -34668,12 +34669,12 @@ class SubscribeAttributeModeSelectCurrentMode : public ModelCommand { dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - [cluster subscribeAttributeCurrentModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeDescriptionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:NULL - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.CurrentMode response %@", [value description]); + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.Description response %@", [value description]); SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); }]; @@ -34692,18 +34693,18 @@ class SubscribeAttributeModeSelectCurrentMode : public ModelCommand { }; /* - * Attribute SupportedModes + * Attribute StandardNamespace */ -class ReadModeSelectSupportedModes : public ModelCommand { +class ReadModeSelectStandardNamespace : public ModelCommand { public: - ReadModeSelectSupportedModes() + ReadModeSelectStandardNamespace() : ModelCommand("read") { - AddArgument("attr-name", "supported-modes"); + AddArgument("attr-name", "standard-namespace"); ModelCommand::AddArguments(); } - ~ReadModeSelectSupportedModes() {} + ~ReadModeSelectStandardNamespace() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { @@ -34712,30 +34713,30 @@ class ReadModeSelectSupportedModes : public ModelCommand { dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeSupportedModesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.SupportedModes response %@", [value description]); + [cluster readAttributeStandardNamespaceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.StandardNamespace response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "ModeSelect SupportedModes Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ModeSelect StandardNamespace Error: %s", chip::ErrorStr(err)); SetCommandExitStatus(err); }]; return err; } }; -class SubscribeAttributeModeSelectSupportedModes : public ModelCommand { +class SubscribeAttributeModeSelectStandardNamespace : public ModelCommand { public: - SubscribeAttributeModeSelectSupportedModes() + SubscribeAttributeModeSelectStandardNamespace() : ModelCommand("subscribe") { - AddArgument("attr-name", "supported-modes"); + AddArgument("attr-name", "standard-namespace"); AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); AddArgument("wait", 0, 1, &mWait); ModelCommand::AddArguments(); } - ~SubscribeAttributeModeSelectSupportedModes() {} + ~SubscribeAttributeModeSelectStandardNamespace() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { @@ -34743,14 +34744,14 @@ class SubscribeAttributeModeSelectSupportedModes : public ModelCommand { dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - [cluster subscribeAttributeSupportedModesWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:NULL - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.SupportedModes response %@", [value description]); - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - }]; + [cluster subscribeAttributeStandardNamespaceWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:NULL + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.StandardNamespace response %@", [value description]); + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + }]; return CHIP_NO_ERROR; } @@ -34767,18 +34768,18 @@ class SubscribeAttributeModeSelectSupportedModes : public ModelCommand { }; /* - * Attribute OnMode + * Attribute SupportedModes */ -class ReadModeSelectOnMode : public ModelCommand { +class ReadModeSelectSupportedModes : public ModelCommand { public: - ReadModeSelectOnMode() + ReadModeSelectSupportedModes() : ModelCommand("read") { - AddArgument("attr-name", "on-mode"); + AddArgument("attr-name", "supported-modes"); ModelCommand::AddArguments(); } - ~ReadModeSelectOnMode() {} + ~ReadModeSelectSupportedModes() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { @@ -34787,79 +34788,120 @@ class ReadModeSelectOnMode : public ModelCommand { dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeOnModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.OnMode response %@", [value description]); + [cluster readAttributeSupportedModesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.SupportedModes response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "ModeSelect OnMode Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ModeSelect SupportedModes Error: %s", chip::ErrorStr(err)); SetCommandExitStatus(err); }]; return err; } }; -class WriteModeSelectOnMode : public ModelCommand { +class SubscribeAttributeModeSelectSupportedModes : public ModelCommand { public: - WriteModeSelectOnMode() - : ModelCommand("write") + SubscribeAttributeModeSelectSupportedModes() + : ModelCommand("subscribe") { - AddArgument("attr-name", "on-mode"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); + AddArgument("attr-name", "supported-modes"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("wait", 0, 1, &mWait); ModelCommand::AddArguments(); } - ~WriteModeSelectOnMode() {} + ~SubscribeAttributeModeSelectSupportedModes() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) WriteAttribute (0x00000002) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + [cluster subscribeAttributeSupportedModesWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:NULL + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.SupportedModes response %@", [value description]); + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + }]; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + return CHIP_NO_ERROR; + } - [cluster writeAttributeOnModeWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "ModeSelect OnMode Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } private: - uint8_t mValue; + uint16_t mMinInterval; + uint16_t mMaxInterval; + bool mWait; }; -class SubscribeAttributeModeSelectOnMode : public ModelCommand { +/* + * Attribute CurrentMode + */ +class ReadModeSelectCurrentMode : public ModelCommand { public: - SubscribeAttributeModeSelectOnMode() + ReadModeSelectCurrentMode() + : ModelCommand("read") + { + AddArgument("attr-name", "current-mode"); + ModelCommand::AddArguments(); + } + + ~ReadModeSelectCurrentMode() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.CurrentMode response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + ChipLogError(chipTool, "ModeSelect CurrentMode Error: %s", chip::ErrorStr(err)); + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeModeSelectCurrentMode : public ModelCommand { +public: + SubscribeAttributeModeSelectCurrentMode() : ModelCommand("subscribe") { - AddArgument("attr-name", "on-mode"); + AddArgument("attr-name", "current-mode"); AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); AddArgument("wait", 0, 1, &mWait); ModelCommand::AddArguments(); } - ~SubscribeAttributeModeSelectOnMode() {} + ~SubscribeAttributeModeSelectCurrentMode() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - [cluster subscribeAttributeOnModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:NULL - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.OnMode response %@", [value description]); - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - }]; + [cluster subscribeAttributeCurrentModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:NULL + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.CurrentMode response %@", [value description]); + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + }]; return CHIP_NO_ERROR; } @@ -34891,7 +34933,7 @@ class ReadModeSelectStartUpMode : public ModelCommand { CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x00000004) on endpoint %" PRIu16, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; @@ -34923,7 +34965,7 @@ class SubscribeAttributeModeSelectStartUpMode : public ModelCommand { CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000004) on endpoint %" PRIu16, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; @@ -34951,65 +34993,99 @@ class SubscribeAttributeModeSelectStartUpMode : public ModelCommand { }; /* - * Attribute Description + * Attribute OnMode */ -class ReadModeSelectDescription : public ModelCommand { +class ReadModeSelectOnMode : public ModelCommand { public: - ReadModeSelectDescription() + ReadModeSelectOnMode() : ModelCommand("read") { - AddArgument("attr-name", "description"); + AddArgument("attr-name", "on-mode"); ModelCommand::AddArguments(); } - ~ReadModeSelectDescription() {} + ~ReadModeSelectOnMode() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x00000004) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x00000005) on endpoint %" PRIu16, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeDescriptionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.Description response %@", [value description]); + [cluster readAttributeOnModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.OnMode response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "ModeSelect Description Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ModeSelect OnMode Error: %s", chip::ErrorStr(err)); SetCommandExitStatus(err); }]; return err; } }; -class SubscribeAttributeModeSelectDescription : public ModelCommand { +class WriteModeSelectOnMode : public ModelCommand { public: - SubscribeAttributeModeSelectDescription() + WriteModeSelectOnMode() + : ModelCommand("write") + { + AddArgument("attr-name", "on-mode"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteModeSelectOnMode() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000050) WriteAttribute (0x00000005) on endpoint %" PRIu16, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + + NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeOnModeWithValue:value + completionHandler:^(NSError * _Nullable error) { + err = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "ModeSelect OnMode Error: %s", chip::ErrorStr(err)); + SetCommandExitStatus(err); + }]; + return err; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeModeSelectOnMode : public ModelCommand { +public: + SubscribeAttributeModeSelectOnMode() : ModelCommand("subscribe") { - AddArgument("attr-name", "description"); + AddArgument("attr-name", "on-mode"); AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); AddArgument("wait", 0, 1, &mWait); ModelCommand::AddArguments(); } - ~SubscribeAttributeModeSelectDescription() {} + ~SubscribeAttributeModeSelectOnMode() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000004) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000005) on endpoint %" PRIu16, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - [cluster subscribeAttributeDescriptionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:NULL - reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.Description response %@", [value description]); - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - }]; + [cluster subscribeAttributeOnModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:NULL + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.OnMode response %@", [value description]); + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + }]; return CHIP_NO_ERROR; } @@ -35252,6 +35328,81 @@ class SubscribeAttributeModeSelectAttributeList : public ModelCommand { bool mWait; }; +/* + * Attribute FeatureMap + */ +class ReadModeSelectFeatureMap : public ModelCommand { +public: + ReadModeSelectFeatureMap() + : ModelCommand("read") + { + AddArgument("attr-name", "feature-map"); + ModelCommand::AddArguments(); + } + + ~ReadModeSelectFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x0000FFFC) on endpoint %" PRIu16, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + ChipLogError(chipTool, "ModeSelect FeatureMap Error: %s", chip::ErrorStr(err)); + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeModeSelectFeatureMap : public ModelCommand { +public: + SubscribeAttributeModeSelectFeatureMap() + : ModelCommand("subscribe") + { + AddArgument("attr-name", "feature-map"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("wait", 0, 1, &mWait); + ModelCommand::AddArguments(); + } + + ~SubscribeAttributeModeSelectFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x0000FFFC) on endpoint %" PRIu16, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:NULL + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.FeatureMap response %@", [value description]); + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } + +private: + uint16_t mMinInterval; + uint16_t mMaxInterval; + bool mWait; +}; + /* * Attribute ClusterRevision */ @@ -73715,23 +73866,27 @@ void registerClusterModeSelect(Commands & commands) commands_list clusterCommands = { make_unique(), // - make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // make_unique(), // make_unique(), // make_unique(), // make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; diff --git a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h index 27786ab0031dc5..3e7d79e5cf6b95 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h @@ -55829,36 +55829,72 @@ class TestModeSelectCluster : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read CurrentMode\n"); - err = TestReadCurrentMode_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read Description\n"); + err = TestReadDescription_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read OnMode\n"); - err = TestReadOnMode_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read StandardNamespace\n"); + err = TestReadStandardNamespace_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read StartUpMode\n"); - err = TestReadStartUpMode_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read SupportedModes\n"); + err = TestReadSupportedModes_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read Description\n"); - err = TestReadDescription_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read CurrentMode\n"); + err = TestReadCurrentMode_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read SupportedModes\n"); - err = TestReadSupportedModes_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read StartUpMode\n"); + err = TestReadStartUpMode_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Change to Supported Mode\n"); - err = TestChangeToSupportedMode_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Read OnMode\n"); + err = TestReadOnMode_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Verify Current Mode Change\n"); - err = TestVerifyCurrentModeChange_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Change to Supported Mode\n"); + err = TestChangeToSupportedMode_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Change to Unsupported Mode\n"); - err = TestChangeToUnsupportedMode_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Verify Current Mode Change\n"); + err = TestVerifyCurrentModeChange_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Change to Unsupported Mode\n"); + err = TestChangeToUnsupportedMode_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Toggle OnOff\n"); + err = TestToggleOnOff_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Toggle OnOff\n"); + err = TestToggleOnOff_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Verify Current Mode does not change when OnMode is null\n"); + err = TestVerifyCurrentModeDoesNotChangeWhenOnModeIsNull_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Change OnMode\n"); + err = TestChangeOnMode_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Verify OnMode\n"); + err = TestVerifyOnMode_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Toggle OnOff\n"); + err = TestToggleOnOff_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Toggle OnOff\n"); + err = TestToggleOnOff_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Verify Current Mode Changes if OnMode is not null\n"); + err = TestVerifyCurrentModeChangesIfOnModeIsNotNull_17(); break; } @@ -55875,7 +55911,7 @@ class TestModeSelectCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + const uint16_t mTestCount = 18; chip::Optional mNodeId; chip::Optional mCluster; @@ -55888,20 +55924,20 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadCurrentMode_1() + CHIP_ERROR TestReadDescription_1() { CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read CurrentMode Error: %@", err); + [cluster readAttributeDescriptionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read Description Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("CurrentMode", actualValue, 0)); + VerifyOrReturn(CheckValueAsString("Description", actualValue, @"Coffee")); } NextTest(); @@ -55910,20 +55946,21 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadOnMode_2() + CHIP_ERROR TestReadStandardNamespace_2() { CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read OnMode Error: %@", err); + [cluster readAttributeStandardNamespaceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read StandardNamespace Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OnMode", actualValue, 0)); + VerifyOrReturn(CheckValueNonNull("StandardNamespace", actualValue)); + VerifyOrReturn(CheckValue("StandardNamespace", actualValue, 0U)); } NextTest(); @@ -55932,20 +55969,35 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadStartUpMode_3() + CHIP_ERROR TestReadSupportedModes_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeStartUpModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read StartUpMode Error: %@", err); + [cluster readAttributeSupportedModesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read SupportedModes Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("StartUpMode", actualValue, 0)); + VerifyOrReturn(CheckValue("SupportedModes", [actualValue count], static_cast(3))); + VerifyOrReturn( + CheckValueAsString("Label", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).label, @"Black")); + VerifyOrReturn(CheckValue("Mode", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).mode, 0)); + VerifyOrReturn( + CheckValue("SemanticTag", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).semanticTag, 0UL)); + VerifyOrReturn( + CheckValueAsString("Label", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).label, @"Cappuccino")); + VerifyOrReturn(CheckValue("Mode", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).mode, 4)); + VerifyOrReturn( + CheckValue("SemanticTag", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).semanticTag, 0UL)); + VerifyOrReturn( + CheckValueAsString("Label", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).label, @"Espresso")); + VerifyOrReturn(CheckValue("Mode", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).mode, 7)); + VerifyOrReturn( + CheckValue("SemanticTag", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).semanticTag, 0UL)); } NextTest(); @@ -55954,20 +56006,20 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadDescription_4() + CHIP_ERROR TestReadCurrentMode_4() { CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeDescriptionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read Description Error: %@", err); + [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CurrentMode Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueAsString("Description", actualValue, @"Coffee")); + VerifyOrReturn(CheckValue("CurrentMode", actualValue, 0)); } NextTest(); @@ -55976,35 +56028,43 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadSupportedModes_5() + CHIP_ERROR TestReadStartUpMode_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeSupportedModesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read SupportedModes Error: %@", err); + [cluster readAttributeStartUpModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read StartUpMode Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("SupportedModes", [actualValue count], static_cast(3))); - VerifyOrReturn( - CheckValueAsString("Label", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).label, @"Black")); - VerifyOrReturn(CheckValue("Mode", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).mode, 0)); - VerifyOrReturn( - CheckValue("SemanticTag", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[0]).semanticTag, 0UL)); - VerifyOrReturn( - CheckValueAsString("Label", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).label, @"Cappuccino")); - VerifyOrReturn(CheckValue("Mode", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).mode, 4)); - VerifyOrReturn( - CheckValue("SemanticTag", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[1]).semanticTag, 0UL)); - VerifyOrReturn( - CheckValueAsString("Label", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).label, @"Espresso")); - VerifyOrReturn(CheckValue("Mode", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).mode, 7)); - VerifyOrReturn( - CheckValue("SemanticTag", ((CHIPModeSelectClusterModeOptionStruct *) actualValue[2]).semanticTag, 0UL)); + VerifyOrReturn(CheckValueNonNull("StartUpMode", actualValue)); + VerifyOrReturn(CheckValue("StartUpMode", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadOnMode_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read OnMode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("OnMode", actualValue)); } NextTest(); @@ -56013,7 +56073,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestChangeToSupportedMode_6() + CHIP_ERROR TestChangeToSupportedMode_7() { CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -56032,8 +56092,9 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } + NSNumber * _Nonnull currentModeBeforeToggle; - CHIP_ERROR TestVerifyCurrentModeChange_7() + CHIP_ERROR TestVerifyCurrentModeChange_8() { CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -56048,6 +56109,9 @@ class TestModeSelectCluster : public TestCommandBridge { id actualValue = value; VerifyOrReturn(CheckValue("CurrentMode", actualValue, 4)); } + { + currentModeBeforeToggle = value; + } NextTest(); }]; @@ -56055,7 +56119,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestChangeToUnsupportedMode_8() + CHIP_ERROR TestChangeToUnsupportedMode_9() { CHIPDevice * device = GetConnectedDevice(); CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -56073,6 +56137,165 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestToggleOnOff_10() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Toggle OnOff Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestToggleOnOff_11() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Toggle OnOff Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyCurrentModeDoesNotChangeWhenOnModeIsNull_12() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify Current Mode does not change when OnMode is null Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentMode", actualValue, currentModeBeforeToggle)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestChangeOnMode_13() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id onModeArgument; + onModeArgument = [NSNumber numberWithUnsignedChar:7]; + [cluster writeAttributeOnModeWithValue:onModeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Change OnMode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable OnModeValue; + + CHIP_ERROR TestVerifyOnMode_14() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify OnMode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("OnMode", actualValue)); + VerifyOrReturn(CheckValue("OnMode", actualValue, 7)); + } + { + OnModeValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestToggleOnOff_15() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Toggle OnOff Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestToggleOnOff_16() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Toggle OnOff Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyCurrentModeChangesIfOnModeIsNotNull_17() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestModeSelect * cluster = [[CHIPTestModeSelect alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify Current Mode Changes if OnMode is not null Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentMode", actualValue, OnModeValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class TestBinding : public TestCommandBridge { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index ed13027280c22d..747637defbc220 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -7153,11 +7153,12 @@ class WriteUserLabelLabelList : public WriteAttribute | * ChangeToMode | 0x00 | |------------------------------------------------------------------------------| | Attributes: | | -| * CurrentMode | 0x0000 | -| * SupportedModes | 0x0001 | -| * OnMode | 0x0002 | -| * StartUpMode | 0x0003 | -| * Description | 0x0004 | +| * Description | 0x0000 | +| * StandardNamespace | 0x0001 | +| * SupportedModes | 0x0002 | +| * CurrentMode | 0x0003 | +| * StartUpMode | 0x0004 | +| * OnMode | 0x0005 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * AttributeList | 0xFFFB | @@ -7211,16 +7212,16 @@ class WriteModeSelectOnMode : public WriteAttribute CHIP_ERROR SendCommand(ChipDevice * device, std::vector endpointIds) override { - return WriteAttribute::SendCommand(device, endpointIds.at(0), 0x00000050, 0x00000002, mValue); + return WriteAttribute::SendCommand(device, endpointIds.at(0), 0x00000050, 0x00000005, mValue); } CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex, chip::NodeId senderNodeId) override { - return WriteAttribute::SendGroupCommand(groupId, fabricIndex, senderNodeId, 0x00000050, 0x00000002, mValue); + return WriteAttribute::SendGroupCommand(groupId, fabricIndex, senderNodeId, 0x00000050, 0x00000005, mValue); } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; /*----------------------------------------------------------------------------*\ @@ -21783,11 +21784,12 @@ void registerClusterModeSelect(Commands & commands, CredentialIssuerCommands * c // Attributes // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // + make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // + make_unique(Id, "standard-namespace", Attributes::StandardNamespace::Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // - make_unique(Id, "on-mode", Attributes::OnMode::Id, credsIssuerConfig), // + make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // + make_unique(Id, "on-mode", Attributes::OnMode::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, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // @@ -21796,11 +21798,12 @@ void registerClusterModeSelect(Commands & commands, CredentialIssuerCommands * c make_unique(Id, credsIssuerConfig), // make_unique(credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // + make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // + make_unique(Id, "standard-namespace", Attributes::StandardNamespace::Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // - make_unique(Id, "on-mode", Attributes::OnMode::Id, credsIssuerConfig), // + make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // + make_unique(Id, "on-mode", Attributes::OnMode::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, "attribute-list", Attributes::AttributeList::Id, 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 15733702d14e41..befae0228c0eae 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -7243,30 +7243,35 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ModeSelect::Id: { switch (path.mAttributeId) { - case ModeSelect::Attributes::CurrentMode::Id: { - uint8_t value; + case ModeSelect::Attributes::Description::Id: { + chip::CharSpan value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CurrentMode", 1, value); + return DataModelLogger::LogValue("Description", 1, value); + } + case ModeSelect::Attributes::StandardNamespace::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("StandardNamespace", 1, value); } case ModeSelect::Attributes::SupportedModes::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SupportedModes", 1, value); } - case ModeSelect::Attributes::OnMode::Id: { + case ModeSelect::Attributes::CurrentMode::Id: { uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("OnMode", 1, value); + return DataModelLogger::LogValue("CurrentMode", 1, value); } case ModeSelect::Attributes::StartUpMode::Id: { - uint8_t value; + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("StartUpMode", 1, value); } - case ModeSelect::Attributes::Description::Id: { - chip::CharSpan value; + case ModeSelect::Attributes::OnMode::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Description", 1, value); + return DataModelLogger::LogValue("OnMode", 1, value); } case ModeSelect::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index b864c52c471460..e1d3c5f98bbc09 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -90204,36 +90204,72 @@ class TestModeSelectClusterSuite : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read CurrentMode\n"); - err = TestReadCurrentMode_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read Description\n"); + err = TestReadDescription_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read OnMode\n"); - err = TestReadOnMode_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read StandardNamespace\n"); + err = TestReadStandardNamespace_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read StartUpMode\n"); - err = TestReadStartUpMode_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read SupportedModes\n"); + err = TestReadSupportedModes_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read Description\n"); - err = TestReadDescription_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read CurrentMode\n"); + err = TestReadCurrentMode_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read SupportedModes\n"); - err = TestReadSupportedModes_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read StartUpMode\n"); + err = TestReadStartUpMode_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Change to Supported Mode\n"); - err = TestChangeToSupportedMode_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Read OnMode\n"); + err = TestReadOnMode_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Verify Current Mode Change\n"); - err = TestVerifyCurrentModeChange_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Change to Supported Mode\n"); + err = TestChangeToSupportedMode_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Change to Unsupported Mode\n"); - err = TestChangeToUnsupportedMode_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Verify Current Mode Change\n"); + err = TestVerifyCurrentModeChange_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Change to Unsupported Mode\n"); + err = TestChangeToUnsupportedMode_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Toggle OnOff\n"); + err = TestToggleOnOff_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Toggle OnOff\n"); + err = TestToggleOnOff_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Verify Current Mode does not change when OnMode is null\n"); + err = TestVerifyCurrentModeDoesNotChangeWhenOnModeIsNull_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Change OnMode\n"); + err = TestChangeOnMode_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Verify OnMode\n"); + err = TestVerifyOnMode_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Toggle OnOff\n"); + err = TestToggleOnOff_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Toggle OnOff\n"); + err = TestToggleOnOff_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Verify Current Mode Changes if OnMode is not null\n"); + err = TestVerifyCurrentModeChangesIfOnModeIsNotNull_17(); break; } @@ -90251,13 +90287,16 @@ class TestModeSelectClusterSuite : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + const uint16_t mTestCount = 18; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; chip::Optional mTimeout; + uint8_t currentModeBeforeToggle; + chip::app::DataModel::Nullable OnModeValue; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override { bool isExpectedDnssdResult = false; @@ -90271,9 +90310,9 @@ class TestModeSelectClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_1(error); } - static void OnSuccessCallback_1(void * context, uint8_t currentMode) + static void OnSuccessCallback_1(void * context, chip::CharSpan description) { - (static_cast(context))->OnSuccessResponse_1(currentMode); + (static_cast(context))->OnSuccessResponse_1(description); } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -90281,9 +90320,9 @@ class TestModeSelectClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_2(error); } - static void OnSuccessCallback_2(void * context, uint8_t onMode) + static void OnSuccessCallback_2(void * context, const chip::app::DataModel::Nullable & standardNamespace) { - (static_cast(context))->OnSuccessResponse_2(onMode); + (static_cast(context))->OnSuccessResponse_2(standardNamespace); } static void OnFailureCallback_3(void * context, CHIP_ERROR error) @@ -90291,9 +90330,12 @@ class TestModeSelectClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_3(error); } - static void OnSuccessCallback_3(void * context, uint8_t startUpMode) + static void OnSuccessCallback_3( + void * context, + const chip::app::DataModel::DecodableList & + supportedModes) { - (static_cast(context))->OnSuccessResponse_3(startUpMode); + (static_cast(context))->OnSuccessResponse_3(supportedModes); } static void OnFailureCallback_4(void * context, CHIP_ERROR error) @@ -90301,9 +90343,9 @@ class TestModeSelectClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_4(error); } - static void OnSuccessCallback_4(void * context, chip::CharSpan description) + static void OnSuccessCallback_4(void * context, uint8_t currentMode) { - (static_cast(context))->OnSuccessResponse_4(description); + (static_cast(context))->OnSuccessResponse_4(currentMode); } static void OnFailureCallback_5(void * context, CHIP_ERROR error) @@ -90311,22 +90353,69 @@ class TestModeSelectClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_5(error); } - static void OnSuccessCallback_5( - void * context, - const chip::app::DataModel::DecodableList & - supportedModes) + static void OnSuccessCallback_5(void * context, const chip::app::DataModel::Nullable & startUpMode) { - (static_cast(context))->OnSuccessResponse_5(supportedModes); + (static_cast(context))->OnSuccessResponse_5(startUpMode); } - static void OnFailureCallback_7(void * context, CHIP_ERROR error) + static void OnFailureCallback_6(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_6(error); + } + + static void OnSuccessCallback_6(void * context, const chip::app::DataModel::Nullable & onMode) + { + (static_cast(context))->OnSuccessResponse_6(onMode); + } + + static void OnFailureCallback_8(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_8(error); + } + + static void OnSuccessCallback_8(void * context, uint8_t currentMode) + { + (static_cast(context))->OnSuccessResponse_8(currentMode); + } + + static void OnFailureCallback_12(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_12(error); + } + + static void OnSuccessCallback_12(void * context, uint8_t currentMode) { - (static_cast(context))->OnFailureResponse_7(error); + (static_cast(context))->OnSuccessResponse_12(currentMode); } - static void OnSuccessCallback_7(void * context, uint8_t currentMode) + static void OnFailureCallback_13(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_13(error); + } + + static void OnSuccessCallback_13(void * context) { - (static_cast(context))->OnSuccessResponse_7(currentMode); + (static_cast(context))->OnSuccessResponse_13(); + } + + static void OnFailureCallback_14(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_14(error); + } + + static void OnSuccessCallback_14(void * context, const chip::app::DataModel::Nullable & onMode) + { + (static_cast(context))->OnSuccessResponse_14(onMode); + } + + static void OnFailureCallback_17(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_17(error); + } + + static void OnSuccessCallback_17(void * context, uint8_t currentMode) + { + (static_cast(context))->OnSuccessResponse_17(currentMode); } // @@ -90339,13 +90428,13 @@ class TestModeSelectClusterSuite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } - CHIP_ERROR TestReadCurrentMode_1() + CHIP_ERROR TestReadDescription_1() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ModeSelectClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( + ReturnErrorOnFailure(cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1, true)); return CHIP_NO_ERROR; } @@ -90356,20 +90445,20 @@ class TestModeSelectClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_1(uint8_t currentMode) + void OnSuccessResponse_1(chip::CharSpan description) { - VerifyOrReturn(CheckValue("currentMode", currentMode, 0)); + VerifyOrReturn(CheckValueAsString("description", description, chip::CharSpan("Coffee", 6))); NextTest(); } - CHIP_ERROR TestReadOnMode_2() + CHIP_ERROR TestReadStandardNamespace_2() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ModeSelectClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( + ReturnErrorOnFailure(cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2, true)); return CHIP_NO_ERROR; } @@ -90380,20 +90469,21 @@ class TestModeSelectClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_2(uint8_t onMode) + void OnSuccessResponse_2(const chip::app::DataModel::Nullable & standardNamespace) { - VerifyOrReturn(CheckValue("onMode", onMode, 0)); + VerifyOrReturn(CheckValueNonNull("standardNamespace", standardNamespace)); + VerifyOrReturn(CheckValue("standardNamespace.Value()", standardNamespace.Value(), 0U)); NextTest(); } - CHIP_ERROR TestReadStartUpMode_3() + CHIP_ERROR TestReadSupportedModes_3() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ModeSelectClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( + ReturnErrorOnFailure(cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3, true)); return CHIP_NO_ERROR; } @@ -90404,20 +90494,38 @@ class TestModeSelectClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_3(uint8_t startUpMode) + void OnSuccessResponse_3( + const chip::app::DataModel::DecodableList & + supportedModes) { - VerifyOrReturn(CheckValue("startUpMode", startUpMode, 0)); + { + auto iter_0 = supportedModes.begin(); + VerifyOrReturn(CheckNextListItemDecodes("supportedModes", iter_0, 0)); + VerifyOrReturn(CheckValueAsString("supportedModes[0].label", iter_0.GetValue().label, chip::CharSpan("Black", 5))); + VerifyOrReturn(CheckValue("supportedModes[0].mode", iter_0.GetValue().mode, 0)); + VerifyOrReturn(CheckValue("supportedModes[0].semanticTag", iter_0.GetValue().semanticTag, 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("supportedModes", iter_0, 1)); + VerifyOrReturn( + CheckValueAsString("supportedModes[1].label", iter_0.GetValue().label, chip::CharSpan("Cappuccino", 10))); + VerifyOrReturn(CheckValue("supportedModes[1].mode", iter_0.GetValue().mode, 4)); + VerifyOrReturn(CheckValue("supportedModes[1].semanticTag", iter_0.GetValue().semanticTag, 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("supportedModes", iter_0, 2)); + VerifyOrReturn(CheckValueAsString("supportedModes[2].label", iter_0.GetValue().label, chip::CharSpan("Espresso", 8))); + VerifyOrReturn(CheckValue("supportedModes[2].mode", iter_0.GetValue().mode, 7)); + VerifyOrReturn(CheckValue("supportedModes[2].semanticTag", iter_0.GetValue().semanticTag, 0UL)); + VerifyOrReturn(CheckNoMoreListItems("supportedModes", iter_0, 3)); + } NextTest(); } - CHIP_ERROR TestReadDescription_4() + CHIP_ERROR TestReadCurrentMode_4() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ModeSelectClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( + ReturnErrorOnFailure(cluster.ReadAttribute( this, OnSuccessCallback_4, OnFailureCallback_4, true)); return CHIP_NO_ERROR; } @@ -90428,20 +90536,20 @@ class TestModeSelectClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_4(chip::CharSpan description) + void OnSuccessResponse_4(uint8_t currentMode) { - VerifyOrReturn(CheckValueAsString("description", description, chip::CharSpan("Coffee", 6))); + VerifyOrReturn(CheckValue("currentMode", currentMode, 0)); NextTest(); } - CHIP_ERROR TestReadSupportedModes_5() + CHIP_ERROR TestReadStartUpMode_5() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ModeSelectClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( + ReturnErrorOnFailure(cluster.ReadAttribute( this, OnSuccessCallback_5, OnFailureCallback_5, true)); return CHIP_NO_ERROR; } @@ -90452,32 +90560,39 @@ class TestModeSelectClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_5( - const chip::app::DataModel::DecodableList & - supportedModes) + void OnSuccessResponse_5(const chip::app::DataModel::Nullable & startUpMode) { - { - auto iter_0 = supportedModes.begin(); - VerifyOrReturn(CheckNextListItemDecodes("supportedModes", iter_0, 0)); - VerifyOrReturn(CheckValueAsString("supportedModes[0].label", iter_0.GetValue().label, chip::CharSpan("Black", 5))); - VerifyOrReturn(CheckValue("supportedModes[0].mode", iter_0.GetValue().mode, 0)); - VerifyOrReturn(CheckValue("supportedModes[0].semanticTag", iter_0.GetValue().semanticTag, 0UL)); - VerifyOrReturn(CheckNextListItemDecodes("supportedModes", iter_0, 1)); - VerifyOrReturn( - CheckValueAsString("supportedModes[1].label", iter_0.GetValue().label, chip::CharSpan("Cappuccino", 10))); - VerifyOrReturn(CheckValue("supportedModes[1].mode", iter_0.GetValue().mode, 4)); - VerifyOrReturn(CheckValue("supportedModes[1].semanticTag", iter_0.GetValue().semanticTag, 0UL)); - VerifyOrReturn(CheckNextListItemDecodes("supportedModes", iter_0, 2)); - VerifyOrReturn(CheckValueAsString("supportedModes[2].label", iter_0.GetValue().label, chip::CharSpan("Espresso", 8))); - VerifyOrReturn(CheckValue("supportedModes[2].mode", iter_0.GetValue().mode, 7)); - VerifyOrReturn(CheckValue("supportedModes[2].semanticTag", iter_0.GetValue().semanticTag, 0UL)); - VerifyOrReturn(CheckNoMoreListItems("supportedModes", iter_0, 3)); - } + VerifyOrReturn(CheckValueNonNull("startUpMode", startUpMode)); + VerifyOrReturn(CheckValue("startUpMode.Value()", startUpMode.Value(), 0)); + + NextTest(); + } + + CHIP_ERROR TestReadOnMode_6() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ModeSelectClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_6, OnFailureCallback_6, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_6(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_6(const chip::app::DataModel::Nullable & onMode) + { + VerifyOrReturn(CheckValueNull("onMode", onMode)); NextTest(); } - CHIP_ERROR TestChangeToSupportedMode_6() + CHIP_ERROR TestChangeToSupportedMode_7() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type; @@ -90486,50 +90601,51 @@ class TestModeSelectClusterSuite : public TestCommand request.newMode = 4; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_6(); + (static_cast(context))->OnSuccessResponse_7(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_6(error); + (static_cast(context))->OnFailureResponse_7(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_6(CHIP_ERROR error) + void OnFailureResponse_7(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_6() { NextTest(); } + void OnSuccessResponse_7() { NextTest(); } - CHIP_ERROR TestVerifyCurrentModeChange_7() + CHIP_ERROR TestVerifyCurrentModeChange_8() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ModeSelectClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7, true)); + this, OnSuccessCallback_8, OnFailureCallback_8, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_7(CHIP_ERROR error) + void OnFailureResponse_8(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_7(uint8_t currentMode) + void OnSuccessResponse_8(uint8_t currentMode) { VerifyOrReturn(CheckValue("currentMode", currentMode, 4)); + currentModeBeforeToggle = currentMode; NextTest(); } - CHIP_ERROR TestChangeToUnsupportedMode_8() + CHIP_ERROR TestChangeToUnsupportedMode_9() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type; @@ -90538,25 +90654,230 @@ class TestModeSelectClusterSuite : public TestCommand request.newMode = 2; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_8(); + (static_cast(context))->OnSuccessResponse_9(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_8(error); + (static_cast(context))->OnFailureResponse_9(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_8(CHIP_ERROR error) + void OnFailureResponse_9(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - void OnSuccessResponse_8() { ThrowSuccessResponse(); } + void OnSuccessResponse_9() { ThrowSuccessResponse(); } + + CHIP_ERROR TestToggleOnOff_10() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + + RequestType request; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_10(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_10(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_10(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_10() { NextTest(); } + + CHIP_ERROR TestToggleOnOff_11() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + + RequestType request; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_11(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_11(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_11(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_11() { NextTest(); } + + CHIP_ERROR TestVerifyCurrentModeDoesNotChangeWhenOnModeIsNull_12() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ModeSelectClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_12, OnFailureCallback_12, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_12(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_12(uint8_t currentMode) + { + VerifyOrReturn(CheckValue("currentMode", currentMode, currentModeBeforeToggle)); + + NextTest(); + } + + CHIP_ERROR TestChangeOnMode_13() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ModeSelectClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable onModeArgument; + onModeArgument.SetNonNull(); + onModeArgument.Value() = 7; + + ReturnErrorOnFailure(cluster.WriteAttribute( + onModeArgument, this, OnSuccessCallback_13, OnFailureCallback_13)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_13(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_13() { NextTest(); } + + CHIP_ERROR TestVerifyOnMode_14() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ModeSelectClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_14, OnFailureCallback_14, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_14(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_14(const chip::app::DataModel::Nullable & onMode) + { + VerifyOrReturn(CheckValueNonNull("onMode", onMode)); + VerifyOrReturn(CheckValue("onMode.Value()", onMode.Value(), 7)); + + OnModeValue = onMode; + NextTest(); + } + + CHIP_ERROR TestToggleOnOff_15() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + + RequestType request; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_15(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_15(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_15(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_15() { NextTest(); } + + CHIP_ERROR TestToggleOnOff_16() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + + RequestType request; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_16(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_16(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_16(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_16() { NextTest(); } + + CHIP_ERROR TestVerifyCurrentModeChangesIfOnModeIsNotNull_17() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ModeSelectClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_17, OnFailureCallback_17, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_17(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_17(uint8_t currentMode) + { + VerifyOrReturn(CheckValue("currentMode", currentMode, OnModeValue)); + + NextTest(); + } }; class TestSystemCommandsSuite : public TestCommand