From 4967c0e0a51e3e0f0216c551d35b4cbde5aea7e4 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Fri, 15 Apr 2022 10:24:06 -0700 Subject: [PATCH 1/5] [FanControl cluster] Add missing definitions for Fan Control cluster (#17416) * Add missing defination for Fan Control cluster * Run codegen --- .../all-clusters-app.matter | 51 ++ .../all-clusters-common/all-clusters-app.zap | 140 ++- .../zcl/data-model/silabs/ha.xml | 58 +- .../data_model/controller-clusters.matter | 51 ++ .../data_model/controller-clusters.zap | 138 ++- .../CHIPAttributeTLVValueDecoder.cpp | 135 +++ .../java/zap-generated/CHIPCallbackTypes.h | 18 + .../zap-generated/CHIPClustersWrite-JNI.cpp | 208 +++++ .../chip/devicecontroller/ChipClusters.java | 195 ++++ .../chip/devicecontroller/ChipIdLookup.java | 27 + .../devicecontroller/ClusterReadMapping.java | 108 +++ .../devicecontroller/ClusterWriteMapping.java | 66 ++ .../python/chip/clusters/CHIPClusters.py | 58 ++ .../python/chip/clusters/Objects.py | 180 ++++ .../CHIPAttributeTLVValueDecoder.mm | 99 ++ .../CHIP/zap-generated/CHIPCallbackBridge.mm | 104 +++ .../CHIPCallbackBridge_internal.h | 118 +++ .../CHIP/zap-generated/CHIPClustersObjc.h | 202 ++++ .../CHIP/zap-generated/CHIPClustersObjc.mm | 622 +++++++++++++ .../CHIP/zap-generated/CHIPTestClustersObjc.h | 5 + .../zap-generated/CHIPTestClustersObjc.mm | 90 ++ .../zap-generated/endpoint_config.h | 133 +-- .../app-common/zap-generated/attribute-id.h | 13 +- .../zap-generated/attributes/Accessors.cpp | 279 ++++++ .../zap-generated/attributes/Accessors.h | 45 + .../app-common/zap-generated/cluster-enums.h | 54 ++ .../zap-generated/cluster-objects.cpp | 27 + .../zap-generated/cluster-objects.h | 117 +++ .../app-common/zap-generated/enums.h | 22 + .../app-common/zap-generated/ids/Attributes.h | 36 + .../cluster/CHIPTestClustersObjc.h | 5 + .../cluster/CHIPTestClustersObjc.mm | 90 ++ .../zap-generated/cluster/Commands.h | 860 ++++++++++++++++++ .../zap-generated/cluster/Commands.h | 136 +++ .../cluster/logging/DataModelLogger.cpp | 45 + 35 files changed, 4466 insertions(+), 69 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 4ded515c32285c..c6021357066014 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 @@ -1317,8 +1317,59 @@ server cluster EthernetNetworkDiagnostics = 55 { } server cluster FanControl = 514 { + enum FanMode : ENUM8 { + kOff = 0; + kLow = 1; + kMedium = 2; + kHigh = 3; + kOn = 4; + kAuto = 5; + kSmart = 6; + } + + enum FanModeSequence : ENUM8 { + kOffLowMedHigh = 0; + kOffLowHigh = 1; + kOffLowMedHighAuto = 2; + kOffLowHighAuto = 3; + kOffOnAuto = 4; + kOffOn = 5; + } + + bitmap FanControlFeature : BITMAP32 { + kMultiSpeed = 0x1; + kAuto = 0x2; + kRocking = 0x4; + kWind = 0x8; + } + + bitmap RockSupportMask : BITMAP8 { + kRockLeftRight = 0x1; + kRockUpDown = 0x2; + kRockRound = 0x4; + } + + bitmap WindSettingMask : BITMAP8 { + kSleepWind = 0x1; + kNaturalWind = 0x2; + } + + bitmap WindSupportMask : BITMAP8 { + kSleepWind = 0x1; + kNaturalWind = 0x2; + } + attribute enum8 fanMode = 0; attribute enum8 fanModeSequence = 1; + attribute int8u percentSetting = 2; + readonly attribute int8u percentCurrent = 3; + readonly attribute int8u speedMax = 4; + attribute int8u speedSetting = 5; + readonly attribute int8u speedCurrent = 6; + readonly attribute bitmap8 rockSupport = 7; + attribute bitmap8 rockSetting = 8; + readonly attribute bitmap8 windSupport = 9; + attribute bitmap8 windSetting = 10; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; } diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 6645d55cff78eb..b97fd74762a3ed 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 @@ -12987,7 +12987,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x05", + "defaultValue": "0x00", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -13008,6 +13008,141 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "percent setting", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "percent current", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "speed max", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "speed setting", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "speed current", + "code": 6, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "rock support", + "code": 7, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "rock setting", + "code": 8, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "wind support", + "code": 9, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "wind setting", + "code": 10, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "GeneratedCommandList", "code": 65528, @@ -21690,5 +21825,6 @@ "endpointVersion": 1, "deviceIdentifier": 61442 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/src/app/zap-templates/zcl/data-model/silabs/ha.xml b/src/app/zap-templates/zcl/data-model/silabs/ha.xml index 3470a405698c62..717ac386d7f7d2 100644 --- a/src/app/zap-templates/zcl/data-model/silabs/ha.xml +++ b/src/app/zap-templates/zcl/data-model/silabs/ha.xml @@ -53,11 +53,61 @@ limitations under the License. FAN_CONTROL_CLUSTER true true - fan mode - - fan mode sequence - + fan mode + fan mode sequence + percent setting + percent current + speed max + speed setting + speed current + rock support + rock setting + wind support + wind setting + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Dehumidification Control HVAC diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index cce906dde2ff29..aaa1a864b0c6cc 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -1700,8 +1700,59 @@ client cluster EthernetNetworkDiagnostics = 55 { } client cluster FanControl = 514 { + enum FanMode : ENUM8 { + kOff = 0; + kLow = 1; + kMedium = 2; + kHigh = 3; + kOn = 4; + kAuto = 5; + kSmart = 6; + } + + enum FanModeSequence : ENUM8 { + kOffLowMedHigh = 0; + kOffLowHigh = 1; + kOffLowMedHighAuto = 2; + kOffLowHighAuto = 3; + kOffOnAuto = 4; + kOffOn = 5; + } + + bitmap FanControlFeature : BITMAP32 { + kMultiSpeed = 0x1; + kAuto = 0x2; + kRocking = 0x4; + kWind = 0x8; + } + + bitmap RockSupportMask : BITMAP8 { + kRockLeftRight = 0x1; + kRockUpDown = 0x2; + kRockRound = 0x4; + } + + bitmap WindSettingMask : BITMAP8 { + kSleepWind = 0x1; + kNaturalWind = 0x2; + } + + bitmap WindSupportMask : BITMAP8 { + kSleepWind = 0x1; + kNaturalWind = 0x2; + } + attribute enum8 fanMode = 0; attribute enum8 fanModeSequence = 1; + attribute int8u percentSetting = 2; + readonly attribute int8u percentCurrent = 3; + readonly attribute int8u speedMax = 4; + attribute int8u speedSetting = 5; + readonly attribute int8u speedCurrent = 6; + readonly attribute bitmap8 rockSupport = 7; + attribute bitmap8 rockSetting = 8; + readonly attribute bitmap8 windSupport = 9; + attribute bitmap8 windSetting = 10; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute attrib_id attributeList[] = 65531; diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 0971ae7cef2b8a..6bf84a3c1baab8 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -11575,6 +11575,141 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "percent setting", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "percent current", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "speed max", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "speed setting", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "speed current", + "code": 6, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "rock support", + "code": 7, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "rock setting", + "code": 8, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "wind support", + "code": 9, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "wind setting", + "code": 10, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "GeneratedCommandList", "code": 65528, @@ -18176,5 +18311,6 @@ "endpointVersion": 1, "deviceIdentifier": 22 } - ] + ], + "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 c2a4ef36f1e7f5..2de59fd1f3dd10 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -5424,6 +5424,141 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR cppValue, value); return value; } + case Attributes::PercentSetting::Id: { + using TypeInfo = Attributes::PercentSetting::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::PercentCurrent::Id: { + using TypeInfo = Attributes::PercentCurrent::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::SpeedMax::Id: { + using TypeInfo = Attributes::SpeedMax::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::SpeedSetting::Id: { + using TypeInfo = Attributes::SpeedSetting::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::SpeedCurrent::Id: { + using TypeInfo = Attributes::SpeedCurrent::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::RockSupport::Id: { + using TypeInfo = Attributes::RockSupport::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::RockSetting::Id: { + using TypeInfo = Attributes::RockSetting::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::WindSupport::Id: { + using TypeInfo = Attributes::WindSupport::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::WindSetting::Id: { + using TypeInfo = Attributes::WindSetting::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/controller/java/zap-generated/CHIPCallbackTypes.h b/src/controller/java/zap-generated/CHIPCallbackTypes.h index 6477640418b60a..99d7509203e195 100644 --- a/src/controller/java/zap-generated/CHIPCallbackTypes.h +++ b/src/controller/java/zap-generated/CHIPCallbackTypes.h @@ -576,6 +576,24 @@ typedef void (*CHIPFanControlClusterFanModeAttributeCallbackType)( void *, chip::app::Clusters::FanControl::Attributes::FanMode::TypeInfo::DecodableArgType); typedef void (*CHIPFanControlClusterFanModeSequenceAttributeCallbackType)( void *, chip::app::Clusters::FanControl::Attributes::FanModeSequence::TypeInfo::DecodableArgType); +typedef void (*CHIPFanControlClusterPercentSettingAttributeCallbackType)( + void *, chip::app::Clusters::FanControl::Attributes::PercentSetting::TypeInfo::DecodableArgType); +typedef void (*CHIPFanControlClusterPercentCurrentAttributeCallbackType)( + void *, chip::app::Clusters::FanControl::Attributes::PercentCurrent::TypeInfo::DecodableArgType); +typedef void (*CHIPFanControlClusterSpeedMaxAttributeCallbackType)( + void *, chip::app::Clusters::FanControl::Attributes::SpeedMax::TypeInfo::DecodableArgType); +typedef void (*CHIPFanControlClusterSpeedSettingAttributeCallbackType)( + void *, chip::app::Clusters::FanControl::Attributes::SpeedSetting::TypeInfo::DecodableArgType); +typedef void (*CHIPFanControlClusterSpeedCurrentAttributeCallbackType)( + void *, chip::app::Clusters::FanControl::Attributes::SpeedCurrent::TypeInfo::DecodableArgType); +typedef void (*CHIPFanControlClusterRockSupportAttributeCallbackType)( + void *, chip::app::Clusters::FanControl::Attributes::RockSupport::TypeInfo::DecodableArgType); +typedef void (*CHIPFanControlClusterRockSettingAttributeCallbackType)( + void *, chip::app::Clusters::FanControl::Attributes::RockSetting::TypeInfo::DecodableArgType); +typedef void (*CHIPFanControlClusterWindSupportAttributeCallbackType)( + void *, chip::app::Clusters::FanControl::Attributes::WindSupport::TypeInfo::DecodableArgType); +typedef void (*CHIPFanControlClusterWindSettingAttributeCallbackType)( + void *, chip::app::Clusters::FanControl::Attributes::WindSetting::TypeInfo::DecodableArgType); typedef void (*CHIPFanControlClusterGeneratedCommandListAttributeCallbackType)( void *, const chip::app::Clusters::FanControl::Attributes::GeneratedCommandList::TypeInfo::DecodableType &); typedef void (*CHIPFanControlClusterAcceptedCommandListAttributeCallbackType)( diff --git a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp index 8097fdea6c08c0..555746007f53cd 100644 --- a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp @@ -1961,6 +1961,214 @@ JNI_METHOD(void, FanControlCluster, writeFanModeSequenceAttribute) onFailure.release(); } +JNI_METHOD(void, FanControlCluster, writePercentSettingAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::FanControl::Attributes::PercentSetting::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cppValue = + static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + FanControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, FanControlCluster, writeSpeedSettingAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::FanControl::Attributes::SpeedSetting::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cppValue = + static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + FanControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, FanControlCluster, writeRockSettingAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::FanControl::Attributes::RockSetting::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cppValue = + static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + FanControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, FanControlCluster, writeWindSettingAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::FanControl::Attributes::WindSetting::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cppValue = + static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + FanControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, GeneralCommissioningCluster, writeBreadcrumbAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 5326160461f9b2..d862b304cc31f8 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -7564,6 +7564,123 @@ public void subscribeFanModeSequenceAttribute( subscribeFanModeSequenceAttribute(chipClusterPtr, callback, minInterval, maxInterval); } + public void readPercentSettingAttribute(IntegerAttributeCallback callback) { + readPercentSettingAttribute(chipClusterPtr, callback); + } + + public void writePercentSettingAttribute(DefaultClusterCallback callback, Integer value) { + writePercentSettingAttribute(chipClusterPtr, callback, value, null); + } + + public void writePercentSettingAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writePercentSettingAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribePercentSettingAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribePercentSettingAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readPercentCurrentAttribute(IntegerAttributeCallback callback) { + readPercentCurrentAttribute(chipClusterPtr, callback); + } + + public void subscribePercentCurrentAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribePercentCurrentAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readSpeedMaxAttribute(IntegerAttributeCallback callback) { + readSpeedMaxAttribute(chipClusterPtr, callback); + } + + public void subscribeSpeedMaxAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeSpeedMaxAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readSpeedSettingAttribute(IntegerAttributeCallback callback) { + readSpeedSettingAttribute(chipClusterPtr, callback); + } + + public void writeSpeedSettingAttribute(DefaultClusterCallback callback, Integer value) { + writeSpeedSettingAttribute(chipClusterPtr, callback, value, null); + } + + public void writeSpeedSettingAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeSpeedSettingAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeSpeedSettingAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeSpeedSettingAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readSpeedCurrentAttribute(IntegerAttributeCallback callback) { + readSpeedCurrentAttribute(chipClusterPtr, callback); + } + + public void subscribeSpeedCurrentAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeSpeedCurrentAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readRockSupportAttribute(IntegerAttributeCallback callback) { + readRockSupportAttribute(chipClusterPtr, callback); + } + + public void subscribeRockSupportAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeRockSupportAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readRockSettingAttribute(IntegerAttributeCallback callback) { + readRockSettingAttribute(chipClusterPtr, callback); + } + + public void writeRockSettingAttribute(DefaultClusterCallback callback, Integer value) { + writeRockSettingAttribute(chipClusterPtr, callback, value, null); + } + + public void writeRockSettingAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeRockSettingAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeRockSettingAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeRockSettingAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readWindSupportAttribute(IntegerAttributeCallback callback) { + readWindSupportAttribute(chipClusterPtr, callback); + } + + public void subscribeWindSupportAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeWindSupportAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readWindSettingAttribute(IntegerAttributeCallback callback) { + readWindSettingAttribute(chipClusterPtr, callback); + } + + public void writeWindSettingAttribute(DefaultClusterCallback callback, Integer value) { + writeWindSettingAttribute(chipClusterPtr, callback, value, null); + } + + public void writeWindSettingAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeWindSettingAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeWindSettingAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeWindSettingAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { readGeneratedCommandListAttribute(chipClusterPtr, callback); } @@ -7633,6 +7750,84 @@ private native void writeFanModeSequenceAttribute( private native void subscribeFanModeSequenceAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + private native void readPercentSettingAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writePercentSettingAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribePercentSettingAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readPercentCurrentAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribePercentCurrentAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readSpeedMaxAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeSpeedMaxAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readSpeedSettingAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeSpeedSettingAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeSpeedSettingAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readSpeedCurrentAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeSpeedCurrentAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readRockSupportAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeRockSupportAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readRockSettingAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeRockSettingAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeRockSettingAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readWindSupportAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeWindSupportAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readWindSettingAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeWindSettingAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeWindSettingAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + private native void readGeneratedCommandListAttribute( long chipClusterPtr, GeneratedCommandListAttributeCallback callback); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java index e97e0f48d66541..9229aa6e5b57d3 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java @@ -1054,6 +1054,33 @@ public static String attributeIdToName(long clusterId, long attributeId) { if (attributeId == 1L) { return "FanModeSequence"; } + if (attributeId == 2L) { + return "PercentSetting"; + } + if (attributeId == 3L) { + return "PercentCurrent"; + } + if (attributeId == 4L) { + return "SpeedMax"; + } + if (attributeId == 5L) { + return "SpeedSetting"; + } + if (attributeId == 6L) { + return "SpeedCurrent"; + } + if (attributeId == 7L) { + return "RockSupport"; + } + if (attributeId == 8L) { + return "RockSetting"; + } + if (attributeId == 9L) { + return "WindSupport"; + } + if (attributeId == 10L) { + return "WindSetting"; + } if (attributeId == 65528L) { return "GeneratedCommandList"; } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java index 5d428a8daaff4e..64d99ba494dcd7 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java @@ -3501,6 +3501,114 @@ public Map> getReadAttributeMap() { readFanControlFanModeSequenceCommandParams); readFanControlInteractionInfo.put( "readFanModeSequenceAttribute", readFanControlFanModeSequenceAttributeInteractionInfo); + Map readFanControlPercentSettingCommandParams = + new LinkedHashMap(); + InteractionInfo readFanControlPercentSettingAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FanControlCluster) cluster) + .readPercentSettingAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readFanControlPercentSettingCommandParams); + readFanControlInteractionInfo.put( + "readPercentSettingAttribute", readFanControlPercentSettingAttributeInteractionInfo); + Map readFanControlPercentCurrentCommandParams = + new LinkedHashMap(); + InteractionInfo readFanControlPercentCurrentAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FanControlCluster) cluster) + .readPercentCurrentAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readFanControlPercentCurrentCommandParams); + readFanControlInteractionInfo.put( + "readPercentCurrentAttribute", readFanControlPercentCurrentAttributeInteractionInfo); + Map readFanControlSpeedMaxCommandParams = + new LinkedHashMap(); + InteractionInfo readFanControlSpeedMaxAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FanControlCluster) cluster) + .readSpeedMaxAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readFanControlSpeedMaxCommandParams); + readFanControlInteractionInfo.put( + "readSpeedMaxAttribute", readFanControlSpeedMaxAttributeInteractionInfo); + Map readFanControlSpeedSettingCommandParams = + new LinkedHashMap(); + InteractionInfo readFanControlSpeedSettingAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FanControlCluster) cluster) + .readSpeedSettingAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readFanControlSpeedSettingCommandParams); + readFanControlInteractionInfo.put( + "readSpeedSettingAttribute", readFanControlSpeedSettingAttributeInteractionInfo); + Map readFanControlSpeedCurrentCommandParams = + new LinkedHashMap(); + InteractionInfo readFanControlSpeedCurrentAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FanControlCluster) cluster) + .readSpeedCurrentAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readFanControlSpeedCurrentCommandParams); + readFanControlInteractionInfo.put( + "readSpeedCurrentAttribute", readFanControlSpeedCurrentAttributeInteractionInfo); + Map readFanControlRockSupportCommandParams = + new LinkedHashMap(); + InteractionInfo readFanControlRockSupportAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FanControlCluster) cluster) + .readRockSupportAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readFanControlRockSupportCommandParams); + readFanControlInteractionInfo.put( + "readRockSupportAttribute", readFanControlRockSupportAttributeInteractionInfo); + Map readFanControlRockSettingCommandParams = + new LinkedHashMap(); + InteractionInfo readFanControlRockSettingAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FanControlCluster) cluster) + .readRockSettingAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readFanControlRockSettingCommandParams); + readFanControlInteractionInfo.put( + "readRockSettingAttribute", readFanControlRockSettingAttributeInteractionInfo); + Map readFanControlWindSupportCommandParams = + new LinkedHashMap(); + InteractionInfo readFanControlWindSupportAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FanControlCluster) cluster) + .readWindSupportAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readFanControlWindSupportCommandParams); + readFanControlInteractionInfo.put( + "readWindSupportAttribute", readFanControlWindSupportAttributeInteractionInfo); + Map readFanControlWindSettingCommandParams = + new LinkedHashMap(); + InteractionInfo readFanControlWindSettingAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FanControlCluster) cluster) + .readWindSettingAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readFanControlWindSettingCommandParams); + readFanControlInteractionInfo.put( + "readWindSettingAttribute", readFanControlWindSettingAttributeInteractionInfo); Map readFanControlGeneratedCommandListCommandParams = new LinkedHashMap(); InteractionInfo readFanControlGeneratedCommandListAttributeInteractionInfo = diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java index 24518720f29eb5..1cc22e9cd117a0 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java @@ -572,6 +572,72 @@ public Map> getWriteAttributeMap() { writeFanControlFanModeSequenceCommandParams); writeFanControlInteractionInfo.put( "writeFanModeSequenceAttribute", writeFanControlFanModeSequenceAttributeInteractionInfo); + Map writeFanControlPercentSettingCommandParams = + new LinkedHashMap(); + CommandParameterInfo fanControlpercentSettingCommandParameterInfo = + new CommandParameterInfo("value", Integer.class); + writeFanControlPercentSettingCommandParams.put( + "value", fanControlpercentSettingCommandParameterInfo); + InteractionInfo writeFanControlPercentSettingAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FanControlCluster) cluster) + .writePercentSettingAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeFanControlPercentSettingCommandParams); + writeFanControlInteractionInfo.put( + "writePercentSettingAttribute", writeFanControlPercentSettingAttributeInteractionInfo); + Map writeFanControlSpeedSettingCommandParams = + new LinkedHashMap(); + CommandParameterInfo fanControlspeedSettingCommandParameterInfo = + new CommandParameterInfo("value", Integer.class); + writeFanControlSpeedSettingCommandParams.put( + "value", fanControlspeedSettingCommandParameterInfo); + InteractionInfo writeFanControlSpeedSettingAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FanControlCluster) cluster) + .writeSpeedSettingAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeFanControlSpeedSettingCommandParams); + writeFanControlInteractionInfo.put( + "writeSpeedSettingAttribute", writeFanControlSpeedSettingAttributeInteractionInfo); + Map writeFanControlRockSettingCommandParams = + new LinkedHashMap(); + CommandParameterInfo fanControlrockSettingCommandParameterInfo = + new CommandParameterInfo("value", Integer.class); + writeFanControlRockSettingCommandParams.put("value", fanControlrockSettingCommandParameterInfo); + InteractionInfo writeFanControlRockSettingAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FanControlCluster) cluster) + .writeRockSettingAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeFanControlRockSettingCommandParams); + writeFanControlInteractionInfo.put( + "writeRockSettingAttribute", writeFanControlRockSettingAttributeInteractionInfo); + Map writeFanControlWindSettingCommandParams = + new LinkedHashMap(); + CommandParameterInfo fanControlwindSettingCommandParameterInfo = + new CommandParameterInfo("value", Integer.class); + writeFanControlWindSettingCommandParams.put("value", fanControlwindSettingCommandParameterInfo); + InteractionInfo writeFanControlWindSettingAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FanControlCluster) cluster) + .writeWindSettingAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeFanControlWindSettingCommandParams); + writeFanControlInteractionInfo.put( + "writeWindSettingAttribute", writeFanControlWindSettingAttributeInteractionInfo); writeAttributeMap.put("fanControl", writeFanControlInteractionInfo); Map writeFixedLabelInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("fixedLabel", writeFixedLabelInteractionInfo); diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index cd032f025504b4..b6f3eac53f4518 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -2387,6 +2387,64 @@ class ChipClusters: "reportable": True, "writable": True, }, + 0x00000002: { + "attributeName": "PercentSetting", + "attributeId": 0x00000002, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000003: { + "attributeName": "PercentCurrent", + "attributeId": 0x00000003, + "type": "int", + "reportable": True, + }, + 0x00000004: { + "attributeName": "SpeedMax", + "attributeId": 0x00000004, + "type": "int", + "reportable": True, + }, + 0x00000005: { + "attributeName": "SpeedSetting", + "attributeId": 0x00000005, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000006: { + "attributeName": "SpeedCurrent", + "attributeId": 0x00000006, + "type": "int", + "reportable": True, + }, + 0x00000007: { + "attributeName": "RockSupport", + "attributeId": 0x00000007, + "type": "int", + "reportable": True, + }, + 0x00000008: { + "attributeName": "RockSetting", + "attributeId": 0x00000008, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000009: { + "attributeName": "WindSupport", + "attributeId": 0x00000009, + "type": "int", + "reportable": True, + }, + 0x0000000A: { + "attributeName": "WindSetting", + "attributeId": 0x0000000A, + "type": "int", + "reportable": True, + "writable": True, + }, 0x0000FFF8: { "attributeName": "GeneratedCommandList", "attributeId": 0x0000FFF8, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 75642e374fee0c..5bee1d340b6f87 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -21134,6 +21134,15 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields = [ ClusterObjectFieldDescriptor(Label="fanMode", Tag=0x00000000, Type=uint), ClusterObjectFieldDescriptor(Label="fanModeSequence", Tag=0x00000001, Type=uint), + ClusterObjectFieldDescriptor(Label="percentSetting", Tag=0x00000002, Type=uint), + ClusterObjectFieldDescriptor(Label="percentCurrent", Tag=0x00000003, Type=uint), + ClusterObjectFieldDescriptor(Label="speedMax", Tag=0x00000004, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="speedSetting", Tag=0x00000005, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="speedCurrent", Tag=0x00000006, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="rockSupport", Tag=0x00000007, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="rockSetting", Tag=0x00000008, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="windSupport", Tag=0x00000009, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="windSetting", Tag=0x0000000A, Type=typing.Optional[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]), @@ -21143,12 +21152,39 @@ def descriptor(cls) -> ClusterObjectDescriptor: fanMode: 'uint' = None fanModeSequence: 'uint' = None + percentSetting: 'uint' = None + percentCurrent: 'uint' = None + speedMax: 'typing.Optional[uint]' = None + speedSetting: 'typing.Optional[uint]' = None + speedCurrent: 'typing.Optional[uint]' = None + rockSupport: 'typing.Optional[uint]' = None + rockSetting: 'typing.Optional[uint]' = None + windSupport: 'typing.Optional[uint]' = None + windSetting: 'typing.Optional[uint]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None attributeList: 'typing.List[uint]' = None featureMap: 'typing.Optional[uint]' = None clusterRevision: 'uint' = None + class Enums: + class FanMode(IntEnum): + kOff = 0x00 + kLow = 0x01 + kMedium = 0x02 + kHigh = 0x03 + kOn = 0x04 + kAuto = 0x05 + kSmart = 0x06 + + class FanModeSequence(IntEnum): + kOffLowMedHigh = 0x00 + kOffLowHigh = 0x01 + kOffLowMedHighAuto = 0x02 + kOffLowHighAuto = 0x03 + kOffOnAuto = 0x04 + kOffOn = 0x05 + @@ -21185,6 +21221,150 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = 0 + @dataclass + class PercentSetting(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0202 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class PercentCurrent(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0202 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class SpeedMax(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0202 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000004 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class SpeedSetting(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0202 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000005 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class SpeedCurrent(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0202 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000006 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class RockSupport(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0202 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000007 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class RockSetting(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0202 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000008 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class WindSupport(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0202 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000009 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class WindSetting(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0202 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000000A + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): @ChipUtility.classproperty diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm index 4d829b1f2f9681..2dddcaba019d3e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm @@ -4417,6 +4417,105 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } + case Attributes::PercentSetting::Id: { + using TypeInfo = Attributes::PercentSetting::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::PercentCurrent::Id: { + using TypeInfo = Attributes::PercentCurrent::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::SpeedMax::Id: { + using TypeInfo = Attributes::SpeedMax::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::SpeedSetting::Id: { + using TypeInfo = Attributes::SpeedSetting::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::SpeedCurrent::Id: { + using TypeInfo = Attributes::SpeedCurrent::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::RockSupport::Id: { + using TypeInfo = Attributes::RockSupport::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::RockSetting::Id: { + using TypeInfo = Attributes::RockSetting::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::WindSupport::Id: { + using TypeInfo = Attributes::WindSupport::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::WindSetting::Id: { + using TypeInfo = Attributes::WindSetting::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index 7eb274613e1430..c5878368729a9f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -16408,6 +16408,110 @@ } } +void CHIPFanControlClusterFanModeAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::FanControl::FanMode value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; + DispatchSuccess(context, objCValue); +}; + +void CHIPFanControlClusterFanModeAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + +void CHIPNullableFanControlClusterFanModeAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + NSNumber * _Nullable objCValue; + if (value.IsNull()) { + objCValue = nil; + } else { + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.Value())]; + } + DispatchSuccess(context, objCValue); +}; + +void CHIPNullableFanControlClusterFanModeAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + +void CHIPFanControlClusterFanModeSequenceAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::FanControl::FanModeSequence value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; + DispatchSuccess(context, objCValue); +}; + +void CHIPFanControlClusterFanModeSequenceAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + +void CHIPNullableFanControlClusterFanModeSequenceAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + NSNumber * _Nullable objCValue; + if (value.IsNull()) { + objCValue = nil; + } else { + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.Value())]; + } + DispatchSuccess(context, objCValue); +}; + +void CHIPNullableFanControlClusterFanModeSequenceAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + void CHIPColorControlClusterColorLoopActionAttributeCallbackBridge::OnSuccessFn( void * context, chip::app::Clusters::ColorControl::ColorLoopAction value) { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h index 75d0052e4f2c88..f2671f3b6130bf 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h @@ -436,6 +436,12 @@ typedef void (*ThermostatClusterThermostatSystemModeAttributeCallback)(void *, chip::app::Clusters::Thermostat::ThermostatSystemMode); typedef void (*NullableThermostatClusterThermostatSystemModeAttributeCallback)( void *, const chip::app::DataModel::Nullable &); +typedef void (*FanControlClusterFanModeAttributeCallback)(void *, chip::app::Clusters::FanControl::FanMode); +typedef void (*NullableFanControlClusterFanModeAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*FanControlClusterFanModeSequenceAttributeCallback)(void *, chip::app::Clusters::FanControl::FanModeSequence); +typedef void (*NullableFanControlClusterFanModeSequenceAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); typedef void (*ColorControlClusterColorLoopActionAttributeCallback)(void *, chip::app::Clusters::ColorControl::ColorLoopAction); typedef void (*NullableColorControlClusterColorLoopActionAttributeCallback)( void *, const chip::app::DataModel::Nullable &); @@ -14003,6 +14009,118 @@ class CHIPNullableThermostatClusterThermostatSystemModeAttributeCallbackSubscrip SubscriptionEstablishedHandler mEstablishedHandler; }; +class CHIPFanControlClusterFanModeAttributeCallbackBridge : public CHIPCallbackBridge +{ +public: + CHIPFanControlClusterFanModeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void OnSuccessFn(void * context, chip::app::Clusters::FanControl::FanMode value); +}; + +class CHIPFanControlClusterFanModeAttributeCallbackSubscriptionBridge : public CHIPFanControlClusterFanModeAttributeCallbackBridge +{ +public: + CHIPFanControlClusterFanModeAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPFanControlClusterFanModeAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + +class CHIPNullableFanControlClusterFanModeAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPNullableFanControlClusterFanModeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::Nullable & value); +}; + +class CHIPNullableFanControlClusterFanModeAttributeCallbackSubscriptionBridge + : public CHIPNullableFanControlClusterFanModeAttributeCallbackBridge +{ +public: + CHIPNullableFanControlClusterFanModeAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPNullableFanControlClusterFanModeAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + +class CHIPFanControlClusterFanModeSequenceAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPFanControlClusterFanModeSequenceAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void OnSuccessFn(void * context, chip::app::Clusters::FanControl::FanModeSequence value); +}; + +class CHIPFanControlClusterFanModeSequenceAttributeCallbackSubscriptionBridge + : public CHIPFanControlClusterFanModeSequenceAttributeCallbackBridge +{ +public: + CHIPFanControlClusterFanModeSequenceAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPFanControlClusterFanModeSequenceAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + +class CHIPNullableFanControlClusterFanModeSequenceAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPNullableFanControlClusterFanModeSequenceAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; + + static void OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value); +}; + +class CHIPNullableFanControlClusterFanModeSequenceAttributeCallbackSubscriptionBridge + : public CHIPNullableFanControlClusterFanModeSequenceAttributeCallbackBridge +{ +public: + CHIPNullableFanControlClusterFanModeSequenceAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPNullableFanControlClusterFanModeSequenceAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class CHIPColorControlClusterColorLoopActionAttributeCallbackBridge : public CHIPCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index 64046c140da0bd..c1863d5988e660 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -4952,6 +4952,166 @@ NS_ASSUME_NONNULL_BEGIN completionHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)readAttributePercentSettingWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)writeAttributePercentSettingWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributePercentSettingWithMinInterval:(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)readAttributePercentSettingWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributePercentCurrentWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributePercentCurrentWithMinInterval:(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)readAttributePercentCurrentWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeSpeedMaxWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeSpeedMaxWithMinInterval:(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)readAttributeSpeedMaxWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeSpeedSettingWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)writeAttributeSpeedSettingWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeSpeedSettingWithMinInterval:(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)readAttributeSpeedSettingWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeSpeedCurrentWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeSpeedCurrentWithMinInterval:(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)readAttributeSpeedCurrentWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeRockSupportWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeRockSupportWithMinInterval:(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)readAttributeRockSupportWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeRockSettingWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)writeAttributeRockSettingWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeRockSettingWithMinInterval:(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)readAttributeRockSettingWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeWindSupportWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeWindSupportWithMinInterval:(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)readAttributeWindSupportWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeWindSettingWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)writeAttributeWindSettingWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeWindSettingWithMinInterval:(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)readAttributeWindSettingWithAttributeCache:(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; /** @@ -16040,6 +16200,48 @@ typedef NS_OPTIONS(uint32_t, CHIPThermostatFeature) { CHIPThermostatFeatureAutomode = 0x20, }; +typedef NS_ENUM(uint8_t, CHIPFanControlFanMode) { + CHIPFanControlFanModeOff = 0x00, + CHIPFanControlFanModeLow = 0x01, + CHIPFanControlFanModeMedium = 0x02, + CHIPFanControlFanModeHigh = 0x03, + CHIPFanControlFanModeOn = 0x04, + CHIPFanControlFanModeAuto = 0x05, + CHIPFanControlFanModeSmart = 0x06, +}; + +typedef NS_ENUM(uint8_t, CHIPFanControlFanModeSequence) { + CHIPFanControlFanModeSequenceOffLowMedHigh = 0x00, + CHIPFanControlFanModeSequenceOffLowHigh = 0x01, + CHIPFanControlFanModeSequenceOffLowMedHighAuto = 0x02, + CHIPFanControlFanModeSequenceOffLowHighAuto = 0x03, + CHIPFanControlFanModeSequenceOffOnAuto = 0x04, + CHIPFanControlFanModeSequenceOffOn = 0x05, +}; + +typedef NS_OPTIONS(uint32_t, CHIPFanControlFeature) { + CHIPFanControlFeatureMultiSpeed = 0x1, + CHIPFanControlFeatureAuto = 0x2, + CHIPFanControlFeatureRocking = 0x4, + CHIPFanControlFeatureWind = 0x8, +}; + +typedef NS_OPTIONS(uint8_t, CHIPFanControlRockSupportMask) { + CHIPFanControlRockSupportMaskRockLeftRight = 0x1, + CHIPFanControlRockSupportMaskRockUpDown = 0x2, + CHIPFanControlRockSupportMaskRockRound = 0x4, +}; + +typedef NS_OPTIONS(uint8_t, CHIPFanControlWindSettingMask) { + CHIPFanControlWindSettingMaskSleepWind = 0x1, + CHIPFanControlWindSettingMaskNaturalWind = 0x2, +}; + +typedef NS_OPTIONS(uint8_t, CHIPFanControlWindSupportMask) { + CHIPFanControlWindSupportMaskSleepWind = 0x1, + CHIPFanControlWindSupportMaskNaturalWind = 0x2, +}; + typedef NS_ENUM(uint8_t, CHIPColorControlColorLoopAction) { CHIPColorControlColorLoopActionDeactivate = 0x00, CHIPColorControlColorLoopActionActivateFromColorLoopStartEnhancedHue = 0x01, diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index 734ef6e0034a91..50906b4d30db11 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -18545,6 +18545,628 @@ new CHIPInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su }); } +- (void)readAttributePercentSettingWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = FanControl::Attributes::PercentSetting::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributePercentSettingWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = FanControl::Attributes::PercentSetting::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)subscribeAttributePercentSettingWithMinInterval:(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, + ^(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 = FanControl::Attributes::PercentSetting::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, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributePercentSettingWithAttributeCache:(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 = FanControl::Attributes::PercentSetting::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)readAttributePercentCurrentWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = FanControl::Attributes::PercentCurrent::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributePercentCurrentWithMinInterval:(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, + ^(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 = FanControl::Attributes::PercentCurrent::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, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributePercentCurrentWithAttributeCache:(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 = FanControl::Attributes::PercentCurrent::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)readAttributeSpeedMaxWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = FanControl::Attributes::SpeedMax::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeSpeedMaxWithMinInterval:(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, + ^(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 = FanControl::Attributes::SpeedMax::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, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeSpeedMaxWithAttributeCache:(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 = FanControl::Attributes::SpeedMax::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)readAttributeSpeedSettingWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = FanControl::Attributes::SpeedSetting::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeSpeedSettingWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = FanControl::Attributes::SpeedSetting::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)subscribeAttributeSpeedSettingWithMinInterval:(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, + ^(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 = FanControl::Attributes::SpeedSetting::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, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeSpeedSettingWithAttributeCache:(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 = FanControl::Attributes::SpeedSetting::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)readAttributeSpeedCurrentWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = FanControl::Attributes::SpeedCurrent::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeSpeedCurrentWithMinInterval:(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, + ^(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 = FanControl::Attributes::SpeedCurrent::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, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeSpeedCurrentWithAttributeCache:(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 = FanControl::Attributes::SpeedCurrent::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)readAttributeRockSupportWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = FanControl::Attributes::RockSupport::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeRockSupportWithMinInterval:(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, + ^(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 = FanControl::Attributes::RockSupport::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, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeRockSupportWithAttributeCache:(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 = FanControl::Attributes::RockSupport::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)readAttributeRockSettingWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = FanControl::Attributes::RockSetting::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRockSettingWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = FanControl::Attributes::RockSetting::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)subscribeAttributeRockSettingWithMinInterval:(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, + ^(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 = FanControl::Attributes::RockSetting::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, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeRockSettingWithAttributeCache:(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 = FanControl::Attributes::RockSetting::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)readAttributeWindSupportWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = FanControl::Attributes::WindSupport::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeWindSupportWithMinInterval:(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, + ^(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 = FanControl::Attributes::WindSupport::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, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeWindSupportWithAttributeCache:(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 = FanControl::Attributes::WindSupport::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)readAttributeWindSettingWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = FanControl::Attributes::WindSetting::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeWindSettingWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = FanControl::Attributes::WindSetting::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)subscribeAttributeWindSettingWithMinInterval:(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, + ^(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 = FanControl::Attributes::WindSetting::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, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeWindSettingWithAttributeCache:(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 = FanControl::Attributes::WindSetting::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)readAttributeGeneratedCommandListWithCompletionHandler:(void (^)(NSArray * _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 edb357f7d82098..5f99354bf7c9b4 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h @@ -462,6 +462,11 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTestFanControl : CHIPFanControl +- (void)writeAttributePercentCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeSpeedMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeSpeedCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRockSupportWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeWindSupportWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm index d2fe21c1d650d9..775c7dca2f4b0d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm @@ -6002,6 +6002,96 @@ @implementation CHIPTestFanControl return &_cppCluster; } +- (void)writeAttributePercentCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = FanControl::Attributes::PercentCurrent::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeSpeedMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = FanControl::Attributes::SpeedMax::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeSpeedCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = FanControl::Attributes::SpeedCurrent::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRockSupportWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = FanControl::Attributes::RockSupport::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeWindSupportWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = FanControl::Attributes::WindSupport::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( 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 de7b4456a3d080..ed44a5a51454ef 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -978,7 +978,7 @@ } // This is an array of EmberAfAttributeMinMaxValue structures. -#define GENERATED_MIN_MAX_DEFAULT_COUNT 42 +#define GENERATED_MIN_MAX_DEFAULT_COUNT 44 #define GENERATED_MIN_MAX_DEFAULTS \ { \ \ @@ -1020,8 +1020,10 @@ { (uint16_t) 0x1, (uint16_t) 0x0, (uint16_t) 0x7 }, /* system mode */ \ \ /* Endpoint: 1, Cluster: Fan Control (server) */ \ - { (uint16_t) 0x5, (uint16_t) 0x0, (uint16_t) 0x6 }, /* fan mode */ \ - { (uint16_t) 0x2, (uint16_t) 0x0, (uint16_t) 0x4 }, /* fan mode sequence */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x6 }, /* fan mode */ \ + { (uint16_t) 0x2, (uint16_t) 0x0, (uint16_t) 0x4 }, /* fan mode sequence */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x64 }, /* percent setting */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x64 }, /* speed setting */ \ \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x1 }, /* temperature display mode */ \ @@ -1054,7 +1056,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 641 +#define GENERATED_ATTRIBUTE_COUNT 650 #define GENERATED_ATTRIBUTES \ { \ \ @@ -1642,17 +1644,28 @@ { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(19) }, /* fan mode */ \ { 0x00000001, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(20) }, /* fan mode sequence */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(431) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(20) }, /* fan mode sequence */ \ + { 0x00000002, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_MIN_MAX_DEFAULTS_INDEX(21) }, /* percent setting */ \ + { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* percent current */ \ + { 0x00000004, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* speed max */ \ + { 0x00000005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_MIN_MAX_DEFAULTS_INDEX(22) }, /* speed setting */ \ + { 0x00000006, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* speed current */ \ + { 0x00000007, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* rock support */ \ + { 0x00000008, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* rock setting */ \ + { 0x00000009, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* wind support */ \ + { 0x0000000A, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* wind setting */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(431) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(21) }, /* temperature display mode */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(23) }, /* temperature display mode */ \ { 0x00000001, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(22) }, /* keypad lockout */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(24) }, /* keypad lockout */ \ { 0x00000002, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(23) }, /* schedule programming visibility */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(25) }, /* schedule programming visibility */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Color Control (server) */ \ @@ -1687,23 +1700,23 @@ { 0x00000029, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* primary 6 y */ \ { 0x0000002A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* primary 6 intensity */ \ { 0x00000030, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(24) }, /* white point x */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(26) }, /* white point x */ \ { 0x00000031, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(25) }, /* white point y */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(27) }, /* white point y */ \ { 0x00000032, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(26) }, /* color point r x */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(28) }, /* color point r x */ \ { 0x00000033, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(27) }, /* color point r y */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(29) }, /* color point r y */ \ { 0x00000034, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* color point r intensity */ \ { 0x00000036, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(28) }, /* color point g x */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(30) }, /* color point g x */ \ { 0x00000037, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(29) }, /* color point g y */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(31) }, /* color point g y */ \ { 0x00000038, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* color point g intensity */ \ { 0x0000003A, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(30) }, /* color point b x */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(32) }, /* color point b x */ \ { 0x0000003B, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(31) }, /* color point b y */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(33) }, /* color point b y */ \ { 0x0000003C, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* color point b intensity */ \ { 0x00004000, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* enhanced current hue */ \ { 0x00004001, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* enhanced color mode */ \ @@ -1717,7 +1730,7 @@ { 0x0000400C, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFEFF) }, /* color temp physical max */ \ { 0x0000400D, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* couple color temp to level min-mireds */ \ { 0x00004010, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(32) }, /* start up color temperature mireds */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(34) }, /* start up color temperature mireds */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(435) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ \ @@ -1879,13 +1892,13 @@ { 0x00000025, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* struct_attr */ \ { 0x00000026, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(33) }, /* range_restricted_int8u */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(35) }, /* range_restricted_int8u */ \ { 0x00000027, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(34) }, /* range_restricted_int8s */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(36) }, /* range_restricted_int8s */ \ { 0x00000028, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(35) }, /* range_restricted_int16u */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(37) }, /* range_restricted_int16u */ \ { 0x00000029, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(36) }, /* range_restricted_int16s */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(38) }, /* range_restricted_int16s */ \ { 0x0000002A, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* list_long_octet_string */ \ { 0x0000002B, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -1957,16 +1970,16 @@ ZAP_EMPTY_DEFAULT() }, /* nullable_struct */ \ { 0x00008026, ZAP_TYPE(INT8U), 1, \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(37) }, /* nullable_range_restricted_int8u */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(39) }, /* nullable_range_restricted_int8u */ \ { 0x00008027, ZAP_TYPE(INT8S), 1, \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(38) }, /* nullable_range_restricted_int8s */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(40) }, /* nullable_range_restricted_int8s */ \ { 0x00008028, ZAP_TYPE(INT16U), 2, \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(39) }, /* nullable_range_restricted_int16u */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(41) }, /* nullable_range_restricted_int16u */ \ { 0x00008029, ZAP_TYPE(INT16S), 2, \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(40) }, /* nullable_range_restricted_int16s */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(42) }, /* nullable_range_restricted_int16s */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ @@ -1994,7 +2007,7 @@ { 0x00004002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OffWaitTime */ \ { 0x00004003, ZAP_TYPE(ENUM8), 1, \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(41) }, /* StartUpOnOff */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(43) }, /* StartUpOnOff */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(687) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ @@ -2978,8 +2991,8 @@ /* Endpoint: 1, Cluster: Fan Control (server) */ \ .clusterId = 0x00000202, \ .attributes = ZAP_ATTRIBUTE_INDEX(387), \ - .attributeCount = 4, \ - .clusterSize = 8, \ + .attributeCount = 13, \ + .clusterSize = 17, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ .acceptedCommandList = nullptr ,\ @@ -2988,7 +3001,7 @@ { \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ .clusterId = 0x00000204, \ - .attributes = ZAP_ATTRIBUTE_INDEX(391), \ + .attributes = ZAP_ATTRIBUTE_INDEX(400), \ .attributeCount = 4, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2999,7 +3012,7 @@ { \ /* Endpoint: 1, Cluster: Color Control (server) */ \ .clusterId = 0x00000300, \ - .attributes = ZAP_ATTRIBUTE_INDEX(395), \ + .attributes = ZAP_ATTRIBUTE_INDEX(404), \ .attributeCount = 54, \ .clusterSize = 345, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -3010,7 +3023,7 @@ { \ /* Endpoint: 1, Cluster: Illuminance Measurement (server) */ \ .clusterId = 0x00000400, \ - .attributes = ZAP_ATTRIBUTE_INDEX(449), \ + .attributes = ZAP_ATTRIBUTE_INDEX(458), \ .attributeCount = 6, \ .clusterSize = 11, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3021,7 +3034,7 @@ { \ /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ .clusterId = 0x00000402, \ - .attributes = ZAP_ATTRIBUTE_INDEX(455), \ + .attributes = ZAP_ATTRIBUTE_INDEX(464), \ .attributeCount = 5, \ .clusterSize = 10, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3032,7 +3045,7 @@ { \ /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ .clusterId = 0x00000403, \ - .attributes = ZAP_ATTRIBUTE_INDEX(460), \ + .attributes = ZAP_ATTRIBUTE_INDEX(469), \ .attributeCount = 4, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3043,7 +3056,7 @@ { \ /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ .clusterId = 0x00000404, \ - .attributes = ZAP_ATTRIBUTE_INDEX(464), \ + .attributes = ZAP_ATTRIBUTE_INDEX(473), \ .attributeCount = 5, \ .clusterSize = 10, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3054,7 +3067,7 @@ { \ /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ .clusterId = 0x00000405, \ - .attributes = ZAP_ATTRIBUTE_INDEX(469), \ + .attributes = ZAP_ATTRIBUTE_INDEX(478), \ .attributeCount = 5, \ .clusterSize = 10, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3065,7 +3078,7 @@ { \ /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(474), \ + .attributes = ZAP_ATTRIBUTE_INDEX(483), \ .attributeCount = 4, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -3076,7 +3089,7 @@ { \ /* Endpoint: 1, Cluster: IAS Zone (server) */ \ .clusterId = 0x00000500, \ - .attributes = ZAP_ATTRIBUTE_INDEX(478), \ + .attributes = ZAP_ATTRIBUTE_INDEX(487), \ .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), \ @@ -3087,7 +3100,7 @@ { \ /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ .clusterId = 0x00000503, \ - .attributes = ZAP_ATTRIBUTE_INDEX(484), \ + .attributes = ZAP_ATTRIBUTE_INDEX(493), \ .attributeCount = 2, \ .clusterSize = 35, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3098,7 +3111,7 @@ { \ /* Endpoint: 1, Cluster: Channel (server) */ \ .clusterId = 0x00000504, \ - .attributes = ZAP_ATTRIBUTE_INDEX(486), \ + .attributes = ZAP_ATTRIBUTE_INDEX(495), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3109,7 +3122,7 @@ { \ /* Endpoint: 1, Cluster: Target Navigator (server) */ \ .clusterId = 0x00000505, \ - .attributes = ZAP_ATTRIBUTE_INDEX(488), \ + .attributes = ZAP_ATTRIBUTE_INDEX(497), \ .attributeCount = 3, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3120,7 +3133,7 @@ { \ /* Endpoint: 1, Cluster: Media Playback (server) */ \ .clusterId = 0x00000506, \ - .attributes = ZAP_ATTRIBUTE_INDEX(491), \ + .attributes = ZAP_ATTRIBUTE_INDEX(500), \ .attributeCount = 7, \ .clusterSize = 39, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3131,7 +3144,7 @@ { \ /* Endpoint: 1, Cluster: Media Input (server) */ \ .clusterId = 0x00000507, \ - .attributes = ZAP_ATTRIBUTE_INDEX(498), \ + .attributes = ZAP_ATTRIBUTE_INDEX(507), \ .attributeCount = 3, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3142,7 +3155,7 @@ { \ /* Endpoint: 1, Cluster: Low Power (server) */ \ .clusterId = 0x00000508, \ - .attributes = ZAP_ATTRIBUTE_INDEX(501), \ + .attributes = ZAP_ATTRIBUTE_INDEX(510), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3153,7 +3166,7 @@ { \ /* Endpoint: 1, Cluster: Keypad Input (server) */ \ .clusterId = 0x00000509, \ - .attributes = ZAP_ATTRIBUTE_INDEX(502), \ + .attributes = ZAP_ATTRIBUTE_INDEX(511), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3164,7 +3177,7 @@ { \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ .clusterId = 0x0000050A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(503), \ + .attributes = ZAP_ATTRIBUTE_INDEX(512), \ .attributeCount = 3, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3175,7 +3188,7 @@ { \ /* Endpoint: 1, Cluster: Audio Output (server) */ \ .clusterId = 0x0000050B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(506), \ + .attributes = ZAP_ATTRIBUTE_INDEX(515), \ .attributeCount = 3, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3186,7 +3199,7 @@ { \ /* Endpoint: 1, Cluster: Application Launcher (server) */ \ .clusterId = 0x0000050C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(509), \ + .attributes = ZAP_ATTRIBUTE_INDEX(518), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3197,7 +3210,7 @@ { \ /* Endpoint: 1, Cluster: Application Basic (server) */ \ .clusterId = 0x0000050D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(511), \ + .attributes = ZAP_ATTRIBUTE_INDEX(520), \ .attributeCount = 8, \ .clusterSize = 106, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3208,7 +3221,7 @@ { \ /* Endpoint: 1, Cluster: Account Login (server) */ \ .clusterId = 0x0000050E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(519), \ + .attributes = ZAP_ATTRIBUTE_INDEX(528), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3219,7 +3232,7 @@ { \ /* Endpoint: 1, Cluster: Test Cluster (server) */ \ .clusterId = 0x0000050F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(520), \ + .attributes = ZAP_ATTRIBUTE_INDEX(529), \ .attributeCount = 81, \ .clusterSize = 2285, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3230,7 +3243,7 @@ { \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ .clusterId = 0x00000B04, \ - .attributes = ZAP_ATTRIBUTE_INDEX(601), \ + .attributes = ZAP_ATTRIBUTE_INDEX(610), \ .attributeCount = 12, \ .clusterSize = 28, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3241,7 +3254,7 @@ { \ /* Endpoint: 2, Cluster: Groups (server) */ \ .clusterId = 0x00000004, \ - .attributes = ZAP_ATTRIBUTE_INDEX(613), \ + .attributes = ZAP_ATTRIBUTE_INDEX(622), \ .attributeCount = 2, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -3252,7 +3265,7 @@ { \ /* Endpoint: 2, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(615), \ + .attributes = ZAP_ATTRIBUTE_INDEX(624), \ .attributeCount = 7, \ .clusterSize = 13, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -3263,7 +3276,7 @@ { \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(622), \ + .attributes = ZAP_ATTRIBUTE_INDEX(631), \ .attributeCount = 5, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3274,7 +3287,7 @@ { \ /* Endpoint: 2, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(627), \ + .attributes = ZAP_ATTRIBUTE_INDEX(636), \ .attributeCount = 4, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -3285,7 +3298,7 @@ { \ /* Endpoint: 65534, Cluster: Network Commissioning (server) */ \ .clusterId = 0x00000031, \ - .attributes = ZAP_ATTRIBUTE_INDEX(631), \ + .attributes = ZAP_ATTRIBUTE_INDEX(640), \ .attributeCount = 10, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3304,7 +3317,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 26, 598 }, { ZAP_CLUSTER_INDEX(26), 45, 3337 }, { ZAP_CLUSTER_INDEX(71), 4, 21 }, \ + { ZAP_CLUSTER_INDEX(0), 26, 598 }, { ZAP_CLUSTER_INDEX(26), 45, 3346 }, { ZAP_CLUSTER_INDEX(71), 4, 21 }, \ { ZAP_CLUSTER_INDEX(75), 1, 0 }, \ } @@ -3317,7 +3330,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 (3956) +#define ATTRIBUTE_MAX_SIZE (3965) // 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 150d52258f6cf2..82d1f64332146b 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 @@ -863,8 +863,17 @@ // Client attributes // Server attributes -#define ZCL_FAN_CONTROL_FAN_MODE_ATTRIBUTE_ID (0x0000) -#define ZCL_FAN_CONTROL_FAN_MODE_SEQUENCE_ATTRIBUTE_ID (0x0001) +#define ZCL_FAN_MODE_ATTRIBUTE_ID (0x0000) +#define ZCL_FAN_MODE_SEQUENCE_ATTRIBUTE_ID (0x0001) +#define ZCL_PERCENT_SETTING_ATTRIBUTE_ID (0x0002) +#define ZCL_PERCENT_CURRENT_ATTRIBUTE_ID (0x0003) +#define ZCL_SPEED_MAX_ATTRIBUTE_ID (0x0004) +#define ZCL_SPEED_SETTING_ATTRIBUTE_ID (0x0005) +#define ZCL_SPEED_CURRENT_ATTRIBUTE_ID (0x0006) +#define ZCL_ROCK_SUPPORT_ATTRIBUTE_ID (0x0007) +#define ZCL_ROCK_SETTING_ATTRIBUTE_ID (0x0008) +#define ZCL_WIND_SUPPORT_ATTRIBUTE_ID (0x0009) +#define ZCL_WIND_SETTING_ATTRIBUTE_ID (0x000A) // Attribute ids for cluster: Dehumidification Control 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 7e96846c2d6b66..e622189bafbd20 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 @@ -19090,6 +19090,285 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) } // namespace FanModeSequence +namespace PercentSetting { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace PercentSetting + +namespace PercentCurrent { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace PercentCurrent + +namespace SpeedMax { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace SpeedMax + +namespace SpeedSetting { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace SpeedSetting + +namespace SpeedCurrent { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace SpeedCurrent + +namespace RockSupport { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); +} + +} // namespace RockSupport + +namespace RockSetting { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); +} + +} // namespace RockSetting + +namespace WindSupport { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); +} + +} // namespace WindSupport + +namespace WindSetting { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); +} + +} // namespace WindSetting + namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) 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 e0ddec1c902c1b..a900e0a02d8a48 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 @@ -3349,6 +3349,51 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace FanModeSequence +namespace PercentSetting { +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +} // namespace PercentSetting + +namespace PercentCurrent { +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +} // namespace PercentCurrent + +namespace SpeedMax { +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +} // namespace SpeedMax + +namespace SpeedSetting { +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +} // namespace SpeedSetting + +namespace SpeedCurrent { +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +} // namespace SpeedCurrent + +namespace RockSupport { +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +} // namespace RockSupport + +namespace RockSetting { +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +} // namespace RockSetting + +namespace WindSupport { +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +} // namespace WindSupport + +namespace WindSetting { +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +} // namespace WindSetting + namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); 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 230da20232fbf9..acf647f2e728f4 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 @@ -1602,6 +1602,60 @@ enum class ThermostatFeature : uint32_t } // namespace Thermostat namespace FanControl { + +// Enum for FanMode +enum class FanMode : uint8_t +{ + kOff = 0x00, + kLow = 0x01, + kMedium = 0x02, + kHigh = 0x03, + kOn = 0x04, + kAuto = 0x05, + kSmart = 0x06, +}; + +// Enum for FanModeSequence +enum class FanModeSequence : uint8_t +{ + kOffLowMedHigh = 0x00, + kOffLowHigh = 0x01, + kOffLowMedHighAuto = 0x02, + kOffLowHighAuto = 0x03, + kOffOnAuto = 0x04, + kOffOn = 0x05, +}; + +// Bitmap for FanControlFeature +enum class FanControlFeature : uint32_t +{ + kMultiSpeed = 0x1, + kAuto = 0x2, + kRocking = 0x4, + kWind = 0x8, +}; + +// Bitmap for RockSupportMask +enum class RockSupportMask : uint8_t +{ + kRockLeftRight = 0x1, + kRockUpDown = 0x2, + kRockRound = 0x4, +}; + +// Bitmap for WindSettingMask +enum class WindSettingMask : uint8_t +{ + kSleepWind = 0x1, + kNaturalWind = 0x2, +}; + +// Bitmap for WindSupportMask +enum class WindSupportMask : uint8_t +{ + kSleepWind = 0x1, + kNaturalWind = 0x2, +}; } // namespace FanControl namespace DehumidificationControl { 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 768e4e451ace1d..bfe5c28aa688f2 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 @@ -15723,6 +15723,33 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre case Attributes::FanModeSequence::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, fanModeSequence)); break; + case Attributes::PercentSetting::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, percentSetting)); + break; + case Attributes::PercentCurrent::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, percentCurrent)); + break; + case Attributes::SpeedMax::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, speedMax)); + break; + case Attributes::SpeedSetting::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, speedSetting)); + break; + case Attributes::SpeedCurrent::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, speedCurrent)); + break; + case Attributes::RockSupport::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rockSupport)); + break; + case Attributes::RockSetting::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rockSetting)); + break; + case Attributes::WindSupport::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, windSupport)); + break; + case Attributes::WindSetting::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, windSetting)); + break; case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); break; diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index b0bb711d950459..9dc9c52dd021bc 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 @@ -22938,6 +22938,114 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace FanModeSequence +namespace PercentSetting { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::FanControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::PercentSetting::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace PercentSetting +namespace PercentCurrent { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::FanControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::PercentCurrent::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace PercentCurrent +namespace SpeedMax { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::FanControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SpeedMax::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SpeedMax +namespace SpeedSetting { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::FanControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SpeedSetting::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SpeedSetting +namespace SpeedCurrent { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::FanControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SpeedCurrent::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SpeedCurrent +namespace RockSupport { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::FanControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::RockSupport::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace RockSupport +namespace RockSetting { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::FanControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::RockSetting::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace RockSetting +namespace WindSupport { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::FanControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::WindSupport::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace WindSupport +namespace WindSetting { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::FanControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::WindSetting::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace WindSetting namespace GeneratedCommandList { struct TypeInfo { @@ -23009,6 +23117,15 @@ struct TypeInfo Attributes::FanMode::TypeInfo::DecodableType fanMode = static_cast(0); Attributes::FanModeSequence::TypeInfo::DecodableType fanModeSequence = static_cast(0); + Attributes::PercentSetting::TypeInfo::DecodableType percentSetting = static_cast(0); + Attributes::PercentCurrent::TypeInfo::DecodableType percentCurrent = static_cast(0); + Attributes::SpeedMax::TypeInfo::DecodableType speedMax = static_cast(0); + Attributes::SpeedSetting::TypeInfo::DecodableType speedSetting = static_cast(0); + Attributes::SpeedCurrent::TypeInfo::DecodableType speedCurrent = static_cast(0); + Attributes::RockSupport::TypeInfo::DecodableType rockSupport = static_cast(0); + Attributes::RockSetting::TypeInfo::DecodableType rockSetting = static_cast(0); + Attributes::WindSupport::TypeInfo::DecodableType windSupport = static_cast(0); + Attributes::WindSetting::TypeInfo::DecodableType windSetting = static_cast(0); 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 02510a63bd7e58..fafae6de059d3e 100644 --- a/zzz_generated/app-common/app-common/zap-generated/enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/enums.h @@ -730,6 +730,14 @@ enum EmberAfWiFiVersionType : uint8_t #define EMBER_AF_ETHERNET_NETWORK_DIAGNOSTICS_FEATURE_PACKET_COUNTS_OFFSET (0) #define EMBER_AF_ETHERNET_NETWORK_DIAGNOSTICS_FEATURE_ERROR_COUNTS (2) #define EMBER_AF_ETHERNET_NETWORK_DIAGNOSTICS_FEATURE_ERROR_COUNTS_OFFSET (1) +#define EMBER_AF_FAN_CONTROL_FEATURE_MULTI_SPEED (1) +#define EMBER_AF_FAN_CONTROL_FEATURE_MULTI_SPEED_OFFSET (0) +#define EMBER_AF_FAN_CONTROL_FEATURE_AUTO (2) +#define EMBER_AF_FAN_CONTROL_FEATURE_AUTO_OFFSET (1) +#define EMBER_AF_FAN_CONTROL_FEATURE_ROCKING (4) +#define EMBER_AF_FAN_CONTROL_FEATURE_ROCKING_OFFSET (2) +#define EMBER_AF_FAN_CONTROL_FEATURE_WIND (8) +#define EMBER_AF_FAN_CONTROL_FEATURE_WIND_OFFSET (3) #define EMBER_AF_IAS_ZONE_STATUS_ALARM1 (1) #define EMBER_AF_IAS_ZONE_STATUS_ALARM1_OFFSET (0) #define EMBER_AF_IAS_ZONE_STATUS_ALARM2 (2) @@ -842,6 +850,12 @@ enum EmberAfWiFiVersionType : uint8_t #define EMBER_AF_REMOTE_ENABLE_FLAGS_AND_DEVICE_STATUS2_REMOTE_ENABLE_FLAGS_OFFSET (0) #define EMBER_AF_REMOTE_ENABLE_FLAGS_AND_DEVICE_STATUS2_DEVICE_STATUS2_STRUCTURE (240) #define EMBER_AF_REMOTE_ENABLE_FLAGS_AND_DEVICE_STATUS2_DEVICE_STATUS2_STRUCTURE_OFFSET (4) +#define EMBER_AF_ROCK_SUPPORT_MASK_ROCK_LEFT_RIGHT (1) +#define EMBER_AF_ROCK_SUPPORT_MASK_ROCK_LEFT_RIGHT_OFFSET (0) +#define EMBER_AF_ROCK_SUPPORT_MASK_ROCK_UP_DOWN (2) +#define EMBER_AF_ROCK_SUPPORT_MASK_ROCK_UP_DOWN_OFFSET (1) +#define EMBER_AF_ROCK_SUPPORT_MASK_ROCK_ROUND (4) +#define EMBER_AF_ROCK_SUPPORT_MASK_ROCK_ROUND_OFFSET (2) #define EMBER_AF_SCENES_COPY_MODE_COPY_ALL_SCENES (1) #define EMBER_AF_SCENES_COPY_MODE_COPY_ALL_SCENES_OFFSET (0) #define EMBER_AF_SHADE_CLOSURE_STATUS_OPERATIONAL (1) @@ -1026,3 +1040,11 @@ enum EmberAfWiFiVersionType : uint8_t #define EMBER_AF_WI_FI_SECURITY_WPA2_PERSONAL_OFFSET (3) #define EMBER_AF_WI_FI_SECURITY_WPA3_PERSONAL (16) #define EMBER_AF_WI_FI_SECURITY_WPA3_PERSONAL_OFFSET (4) +#define EMBER_AF_WIND_SETTING_MASK_SLEEP_WIND (1) +#define EMBER_AF_WIND_SETTING_MASK_SLEEP_WIND_OFFSET (0) +#define EMBER_AF_WIND_SETTING_MASK_NATURAL_WIND (2) +#define EMBER_AF_WIND_SETTING_MASK_NATURAL_WIND_OFFSET (1) +#define EMBER_AF_WIND_SUPPORT_MASK_SLEEP_WIND (1) +#define EMBER_AF_WIND_SUPPORT_MASK_SLEEP_WIND_OFFSET (0) +#define EMBER_AF_WIND_SUPPORT_MASK_NATURAL_WIND (2) +#define EMBER_AF_WIND_SUPPORT_MASK_NATURAL_WIND_OFFSET (1) 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 bae1788652ab1d..d023e14d89f048 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 @@ -3486,6 +3486,42 @@ namespace FanModeSequence { static constexpr AttributeId Id = 0x00000001; } // namespace FanModeSequence +namespace PercentSetting { +static constexpr AttributeId Id = 0x00000002; +} // namespace PercentSetting + +namespace PercentCurrent { +static constexpr AttributeId Id = 0x00000003; +} // namespace PercentCurrent + +namespace SpeedMax { +static constexpr AttributeId Id = 0x00000004; +} // namespace SpeedMax + +namespace SpeedSetting { +static constexpr AttributeId Id = 0x00000005; +} // namespace SpeedSetting + +namespace SpeedCurrent { +static constexpr AttributeId Id = 0x00000006; +} // namespace SpeedCurrent + +namespace RockSupport { +static constexpr AttributeId Id = 0x00000007; +} // namespace RockSupport + +namespace RockSetting { +static constexpr AttributeId Id = 0x00000008; +} // namespace RockSetting + +namespace WindSupport { +static constexpr AttributeId Id = 0x00000009; +} // namespace WindSupport + +namespace WindSetting { +static constexpr AttributeId Id = 0x0000000A; +} // namespace WindSetting + namespace GeneratedCommandList { static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; } // namespace GeneratedCommandList 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 edb357f7d82098..5f99354bf7c9b4 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.h @@ -462,6 +462,11 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTestFanControl : CHIPFanControl +- (void)writeAttributePercentCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeSpeedMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeSpeedCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRockSupportWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeWindSupportWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; 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 d2fe21c1d650d9..775c7dca2f4b0d 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.mm +++ b/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.mm @@ -6002,6 +6002,96 @@ @implementation CHIPTestFanControl return &_cppCluster; } +- (void)writeAttributePercentCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = FanControl::Attributes::PercentCurrent::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeSpeedMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = FanControl::Attributes::SpeedMax::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeSpeedCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = FanControl::Attributes::SpeedCurrent::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRockSupportWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = FanControl::Attributes::RockSupport::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeWindSupportWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = FanControl::Attributes::WindSupport::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( 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 5a559732a378b9..e0a635ecc44db7 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h @@ -25272,6 +25272,15 @@ class SubscribeAttributeEthernetNetworkDiagnosticsClusterRevision : public Model | Attributes: | | | * FanMode | 0x0000 | | * FanModeSequence | 0x0001 | +| * PercentSetting | 0x0002 | +| * PercentCurrent | 0x0003 | +| * SpeedMax | 0x0004 | +| * SpeedSetting | 0x0005 | +| * SpeedCurrent | 0x0006 | +| * RockSupport | 0x0007 | +| * RockSetting | 0x0008 | +| * WindSupport | 0x0009 | +| * WindSetting | 0x000A | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * AttributeList | 0xFFFB | @@ -25503,6 +25512,835 @@ class SubscribeAttributeFanControlFanModeSequence : public ModelCommand { bool mWait; }; +/* + * Attribute PercentSetting + */ +class ReadFanControlPercentSetting : public ModelCommand { +public: + ReadFanControlPercentSetting() + : ModelCommand("read") + { + AddArgument("attr-name", "percent-setting"); + ModelCommand::AddArguments(); + } + + ~ReadFanControlPercentSetting() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributePercentSettingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.PercentSetting response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + ChipLogError(chipTool, "FanControl PercentSetting Error: %s", chip::ErrorStr(err)); + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteFanControlPercentSetting : public ModelCommand { +public: + WriteFanControlPercentSetting() + : ModelCommand("write") + { + AddArgument("attr-name", "percent-setting"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteFanControlPercentSetting() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) WriteAttribute (0x00000002) on endpoint %" PRIu16, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributePercentSettingWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "FanControl PercentSetting Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeFanControlPercentSetting : public ModelCommand { +public: + SubscribeAttributeFanControlPercentSetting() + : ModelCommand("subscribe") + { + AddArgument("attr-name", "percent-setting"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("wait", 0, 1, &mWait); + ModelCommand::AddArguments(); + } + + ~SubscribeAttributeFanControlPercentSetting() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + [cluster subscribeAttributePercentSettingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.PercentSetting response %@", [value description]); + if (error || !mWait) { + 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 PercentCurrent + */ +class ReadFanControlPercentCurrent : public ModelCommand { +public: + ReadFanControlPercentCurrent() + : ModelCommand("read") + { + AddArgument("attr-name", "percent-current"); + ModelCommand::AddArguments(); + } + + ~ReadFanControlPercentCurrent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributePercentCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.PercentCurrent response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + ChipLogError(chipTool, "FanControl PercentCurrent Error: %s", chip::ErrorStr(err)); + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeFanControlPercentCurrent : public ModelCommand { +public: + SubscribeAttributeFanControlPercentCurrent() + : ModelCommand("subscribe") + { + AddArgument("attr-name", "percent-current"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("wait", 0, 1, &mWait); + ModelCommand::AddArguments(); + } + + ~SubscribeAttributeFanControlPercentCurrent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + [cluster subscribeAttributePercentCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.PercentCurrent response %@", [value description]); + if (error || !mWait) { + 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 SpeedMax + */ +class ReadFanControlSpeedMax : public ModelCommand { +public: + ReadFanControlSpeedMax() + : ModelCommand("read") + { + AddArgument("attr-name", "speed-max"); + ModelCommand::AddArguments(); + } + + ~ReadFanControlSpeedMax() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000004) on endpoint %" PRIu16, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeSpeedMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.SpeedMax response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + ChipLogError(chipTool, "FanControl SpeedMax Error: %s", chip::ErrorStr(err)); + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeFanControlSpeedMax : public ModelCommand { +public: + SubscribeAttributeFanControlSpeedMax() + : ModelCommand("subscribe") + { + AddArgument("attr-name", "speed-max"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("wait", 0, 1, &mWait); + ModelCommand::AddArguments(); + } + + ~SubscribeAttributeFanControlSpeedMax() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000004) on endpoint %" PRIu16, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + [cluster subscribeAttributeSpeedMaxWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.SpeedMax response %@", [value description]); + if (error || !mWait) { + 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 SpeedSetting + */ +class ReadFanControlSpeedSetting : public ModelCommand { +public: + ReadFanControlSpeedSetting() + : ModelCommand("read") + { + AddArgument("attr-name", "speed-setting"); + ModelCommand::AddArguments(); + } + + ~ReadFanControlSpeedSetting() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000005) on endpoint %" PRIu16, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeSpeedSettingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.SpeedSetting response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + ChipLogError(chipTool, "FanControl SpeedSetting Error: %s", chip::ErrorStr(err)); + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteFanControlSpeedSetting : public ModelCommand { +public: + WriteFanControlSpeedSetting() + : ModelCommand("write") + { + AddArgument("attr-name", "speed-setting"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteFanControlSpeedSetting() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) WriteAttribute (0x00000005) on endpoint %" PRIu16, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeSpeedSettingWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "FanControl SpeedSetting Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeFanControlSpeedSetting : public ModelCommand { +public: + SubscribeAttributeFanControlSpeedSetting() + : ModelCommand("subscribe") + { + AddArgument("attr-name", "speed-setting"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("wait", 0, 1, &mWait); + ModelCommand::AddArguments(); + } + + ~SubscribeAttributeFanControlSpeedSetting() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000005) on endpoint %" PRIu16, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + [cluster subscribeAttributeSpeedSettingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.SpeedSetting response %@", [value description]); + if (error || !mWait) { + 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 SpeedCurrent + */ +class ReadFanControlSpeedCurrent : public ModelCommand { +public: + ReadFanControlSpeedCurrent() + : ModelCommand("read") + { + AddArgument("attr-name", "speed-current"); + ModelCommand::AddArguments(); + } + + ~ReadFanControlSpeedCurrent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000006) on endpoint %" PRIu16, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeSpeedCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.SpeedCurrent response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + ChipLogError(chipTool, "FanControl SpeedCurrent Error: %s", chip::ErrorStr(err)); + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeFanControlSpeedCurrent : public ModelCommand { +public: + SubscribeAttributeFanControlSpeedCurrent() + : ModelCommand("subscribe") + { + AddArgument("attr-name", "speed-current"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("wait", 0, 1, &mWait); + ModelCommand::AddArguments(); + } + + ~SubscribeAttributeFanControlSpeedCurrent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000006) on endpoint %" PRIu16, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + [cluster subscribeAttributeSpeedCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.SpeedCurrent response %@", [value description]); + if (error || !mWait) { + 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 RockSupport + */ +class ReadFanControlRockSupport : public ModelCommand { +public: + ReadFanControlRockSupport() + : ModelCommand("read") + { + AddArgument("attr-name", "rock-support"); + ModelCommand::AddArguments(); + } + + ~ReadFanControlRockSupport() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000007) on endpoint %" PRIu16, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeRockSupportWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.RockSupport response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + ChipLogError(chipTool, "FanControl RockSupport Error: %s", chip::ErrorStr(err)); + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeFanControlRockSupport : public ModelCommand { +public: + SubscribeAttributeFanControlRockSupport() + : ModelCommand("subscribe") + { + AddArgument("attr-name", "rock-support"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("wait", 0, 1, &mWait); + ModelCommand::AddArguments(); + } + + ~SubscribeAttributeFanControlRockSupport() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000007) on endpoint %" PRIu16, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + [cluster subscribeAttributeRockSupportWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.RockSupport response %@", [value description]); + if (error || !mWait) { + 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 RockSetting + */ +class ReadFanControlRockSetting : public ModelCommand { +public: + ReadFanControlRockSetting() + : ModelCommand("read") + { + AddArgument("attr-name", "rock-setting"); + ModelCommand::AddArguments(); + } + + ~ReadFanControlRockSetting() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000008) on endpoint %" PRIu16, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeRockSettingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.RockSetting response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + ChipLogError(chipTool, "FanControl RockSetting Error: %s", chip::ErrorStr(err)); + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteFanControlRockSetting : public ModelCommand { +public: + WriteFanControlRockSetting() + : ModelCommand("write") + { + AddArgument("attr-name", "rock-setting"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteFanControlRockSetting() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) WriteAttribute (0x00000008) on endpoint %" PRIu16, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeRockSettingWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "FanControl RockSetting Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeFanControlRockSetting : public ModelCommand { +public: + SubscribeAttributeFanControlRockSetting() + : ModelCommand("subscribe") + { + AddArgument("attr-name", "rock-setting"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("wait", 0, 1, &mWait); + ModelCommand::AddArguments(); + } + + ~SubscribeAttributeFanControlRockSetting() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000008) on endpoint %" PRIu16, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + [cluster subscribeAttributeRockSettingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.RockSetting response %@", [value description]); + if (error || !mWait) { + 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 WindSupport + */ +class ReadFanControlWindSupport : public ModelCommand { +public: + ReadFanControlWindSupport() + : ModelCommand("read") + { + AddArgument("attr-name", "wind-support"); + ModelCommand::AddArguments(); + } + + ~ReadFanControlWindSupport() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000009) on endpoint %" PRIu16, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeWindSupportWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.WindSupport response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + ChipLogError(chipTool, "FanControl WindSupport Error: %s", chip::ErrorStr(err)); + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeFanControlWindSupport : public ModelCommand { +public: + SubscribeAttributeFanControlWindSupport() + : ModelCommand("subscribe") + { + AddArgument("attr-name", "wind-support"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("wait", 0, 1, &mWait); + ModelCommand::AddArguments(); + } + + ~SubscribeAttributeFanControlWindSupport() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000009) on endpoint %" PRIu16, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + [cluster subscribeAttributeWindSupportWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.WindSupport response %@", [value description]); + if (error || !mWait) { + 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 WindSetting + */ +class ReadFanControlWindSetting : public ModelCommand { +public: + ReadFanControlWindSetting() + : ModelCommand("read") + { + AddArgument("attr-name", "wind-setting"); + ModelCommand::AddArguments(); + } + + ~ReadFanControlWindSetting() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x0000000A) on endpoint %" PRIu16, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeWindSettingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.WindSetting response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + ChipLogError(chipTool, "FanControl WindSetting Error: %s", chip::ErrorStr(err)); + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteFanControlWindSetting : public ModelCommand { +public: + WriteFanControlWindSetting() + : ModelCommand("write") + { + AddArgument("attr-name", "wind-setting"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteFanControlWindSetting() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) WriteAttribute (0x0000000A) on endpoint %" PRIu16, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeWindSettingWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "FanControl WindSetting Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeFanControlWindSetting : public ModelCommand { +public: + SubscribeAttributeFanControlWindSetting() + : ModelCommand("subscribe") + { + AddArgument("attr-name", "wind-setting"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("wait", 0, 1, &mWait); + ModelCommand::AddArguments(); + } + + ~SubscribeAttributeFanControlWindSetting() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x0000000A) on endpoint %" PRIu16, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + [cluster subscribeAttributeWindSettingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.WindSetting response %@", [value description]); + if (error || !mWait) { + 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 GeneratedCommandList */ @@ -77781,6 +78619,28 @@ void registerClusterFanControl(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 7b1c5ee32e7dfc..df540ac64a693d 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -10721,6 +10721,15 @@ class WriteThermostatAcCapacityFormat : public WriteAttribute | Attributes: | | | * FanMode | 0x0000 | | * FanModeSequence | 0x0001 | +| * PercentSetting | 0x0002 | +| * PercentCurrent | 0x0003 | +| * SpeedMax | 0x0004 | +| * SpeedSetting | 0x0005 | +| * SpeedCurrent | 0x0006 | +| * RockSupport | 0x0007 | +| * RockSetting | 0x0008 | +| * WindSupport | 0x0009 | +| * WindSetting | 0x000A | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * AttributeList | 0xFFFB | @@ -10783,6 +10792,111 @@ class WriteFanControlFanModeSequence : public WriteAttribute uint8_t mValue; }; +class WriteFanControlPercentSetting : public WriteAttribute +{ +public: + WriteFanControlPercentSetting(CredentialIssuerCommands * credsIssuerConfig) : + WriteAttribute("PercentSetting", credsIssuerConfig) + { + AddArgument("attr-name", "percent-setting"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteFanControlPercentSetting() {} + + CHIP_ERROR SendCommand(ChipDevice * device, std::vector endpointIds) override + { + return WriteAttribute::SendCommand(device, endpointIds.at(0), 0x00000202, 0x00000002, mValue); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + return WriteAttribute::SendGroupCommand(groupId, fabricIndex, 0x00000202, 0x00000002, mValue); + } + +private: + uint8_t mValue; +}; + +class WriteFanControlSpeedSetting : public WriteAttribute +{ +public: + WriteFanControlSpeedSetting(CredentialIssuerCommands * credsIssuerConfig) : WriteAttribute("SpeedSetting", credsIssuerConfig) + { + AddArgument("attr-name", "speed-setting"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteFanControlSpeedSetting() {} + + CHIP_ERROR SendCommand(ChipDevice * device, std::vector endpointIds) override + { + return WriteAttribute::SendCommand(device, endpointIds.at(0), 0x00000202, 0x00000005, mValue); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + return WriteAttribute::SendGroupCommand(groupId, fabricIndex, 0x00000202, 0x00000005, mValue); + } + +private: + uint8_t mValue; +}; + +class WriteFanControlRockSetting : public WriteAttribute +{ +public: + WriteFanControlRockSetting(CredentialIssuerCommands * credsIssuerConfig) : WriteAttribute("RockSetting", credsIssuerConfig) + { + AddArgument("attr-name", "rock-setting"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteFanControlRockSetting() {} + + CHIP_ERROR SendCommand(ChipDevice * device, std::vector endpointIds) override + { + return WriteAttribute::SendCommand(device, endpointIds.at(0), 0x00000202, 0x00000008, mValue); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + return WriteAttribute::SendGroupCommand(groupId, fabricIndex, 0x00000202, 0x00000008, mValue); + } + +private: + uint8_t mValue; +}; + +class WriteFanControlWindSetting : public WriteAttribute +{ +public: + WriteFanControlWindSetting(CredentialIssuerCommands * credsIssuerConfig) : WriteAttribute("WindSetting", credsIssuerConfig) + { + AddArgument("attr-name", "wind-setting"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteFanControlWindSetting() {} + + CHIP_ERROR SendCommand(ChipDevice * device, std::vector endpointIds) override + { + return WriteAttribute::SendCommand(device, endpointIds.at(0), 0x00000202, 0x0000000A, mValue); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + return WriteAttribute::SendGroupCommand(groupId, fabricIndex, 0x00000202, 0x0000000A, mValue); + } + +private: + uint8_t mValue; +}; + /*----------------------------------------------------------------------------*\ | Cluster DehumidificationControl | 0x0203 | |------------------------------------------------------------------------------| @@ -22655,6 +22769,15 @@ void registerClusterFanControl(Commands & commands, CredentialIssuerCommands * c make_unique(Id, credsIssuerConfig), // make_unique(Id, "fan-mode", Attributes::FanMode::Id, credsIssuerConfig), // make_unique(Id, "fan-mode-sequence", Attributes::FanModeSequence::Id, credsIssuerConfig), // + make_unique(Id, "percent-setting", Attributes::PercentSetting::Id, credsIssuerConfig), // + make_unique(Id, "percent-current", Attributes::PercentCurrent::Id, credsIssuerConfig), // + make_unique(Id, "speed-max", Attributes::SpeedMax::Id, credsIssuerConfig), // + make_unique(Id, "speed-setting", Attributes::SpeedSetting::Id, credsIssuerConfig), // + make_unique(Id, "speed-current", Attributes::SpeedCurrent::Id, credsIssuerConfig), // + make_unique(Id, "rock-support", Attributes::RockSupport::Id, credsIssuerConfig), // + make_unique(Id, "rock-setting", Attributes::RockSetting::Id, credsIssuerConfig), // + make_unique(Id, "wind-support", Attributes::WindSupport::Id, credsIssuerConfig), // + make_unique(Id, "wind-setting", Attributes::WindSetting::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), // @@ -22663,9 +22786,22 @@ void registerClusterFanControl(Commands & commands, CredentialIssuerCommands * c make_unique(Id, credsIssuerConfig), // make_unique(credsIssuerConfig), // make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // make_unique(Id, "fan-mode", Attributes::FanMode::Id, credsIssuerConfig), // make_unique(Id, "fan-mode-sequence", Attributes::FanModeSequence::Id, credsIssuerConfig), // + make_unique(Id, "percent-setting", Attributes::PercentSetting::Id, credsIssuerConfig), // + make_unique(Id, "percent-current", Attributes::PercentCurrent::Id, credsIssuerConfig), // + make_unique(Id, "speed-max", Attributes::SpeedMax::Id, credsIssuerConfig), // + make_unique(Id, "speed-setting", Attributes::SpeedSetting::Id, credsIssuerConfig), // + make_unique(Id, "speed-current", Attributes::SpeedCurrent::Id, credsIssuerConfig), // + make_unique(Id, "rock-support", Attributes::RockSupport::Id, credsIssuerConfig), // + make_unique(Id, "rock-setting", Attributes::RockSetting::Id, credsIssuerConfig), // + make_unique(Id, "wind-support", Attributes::WindSupport::Id, credsIssuerConfig), // + make_unique(Id, "wind-setting", Attributes::WindSetting::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 fbf363a69d1ae4..21e53882e1e7c2 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -6549,6 +6549,51 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("fan mode sequence", 1, value); } + case FanControl::Attributes::PercentSetting::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("percent setting", 1, value); + } + case FanControl::Attributes::PercentCurrent::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("percent current", 1, value); + } + case FanControl::Attributes::SpeedMax::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("speed max", 1, value); + } + case FanControl::Attributes::SpeedSetting::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("speed setting", 1, value); + } + case FanControl::Attributes::SpeedCurrent::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("speed current", 1, value); + } + case FanControl::Attributes::RockSupport::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("rock support", 1, value); + } + case FanControl::Attributes::RockSetting::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("rock setting", 1, value); + } + case FanControl::Attributes::WindSupport::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("wind support", 1, value); + } + case FanControl::Attributes::WindSetting::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("wind setting", 1, value); + } case FanControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); From b1d7a32df57cca02983e5edbd2224c7e14997847 Mon Sep 17 00:00:00 2001 From: Carol Yang Date: Fri, 15 Apr 2022 13:37:08 -0700 Subject: [PATCH 2/5] Update ESP32 driver documentation (#17425) --- examples/all-clusters-app/esp32/README.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/examples/all-clusters-app/esp32/README.md b/examples/all-clusters-app/esp32/README.md index 11b321ee0e742f..db3efc69e652c2 100644 --- a/examples/all-clusters-app/esp32/README.md +++ b/examples/all-clusters-app/esp32/README.md @@ -32,6 +32,20 @@ the [M5Stack](http://m5stack.com), and the Note: M5Stack Core 2 display is not supported in the tft component, while other functionality can still work fine. +## VCP Drivers + +Some users might have to install the +[VCP driver](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers) +before the device shows up on `/dev/tty`. + +In addition, if the following error is encountered during M5Stack flashing, the +[CH9102 VCP driver](https://docs.m5stack.com/en/download) would also need to be +installed: + +``` +Failed to write to target RAM (result was 01070000) +``` + ## Building the Example Application Building the example application requires the use of the Espressif ESP32 IoT @@ -155,10 +169,6 @@ that are currently supported include `ESP32-DevKitC` (default), $ idf.py -p /dev/tty.SLAB_USBtoUART flash monitor ``` - Note: Some users might have to install the - [VCP driver](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers) - before the device shows up on `/dev/tty`. - - Quit the monitor by hitting `Ctrl+]`. Note: You can see a menu of various monitor commands by hitting From d74d8beac2e55d5ac40dd71acb822a3b85aa18d0 Mon Sep 17 00:00:00 2001 From: "Irene Siu (Apple)" Date: Fri, 15 Apr 2022 14:45:25 -0700 Subject: [PATCH 3/5] Add missing CHIP error codes into CHIPError.cpp/TestCHIPErrorStr.cpp and fix duplicates (#17414) * Add error codes from CHIPError.h that are missing from CHIPError.cpp and TestCHIPErrorStr.cpp * Add events missing in string translation and kTestElements[] * Remove duplicate defines due to merge error. * Fix merge conflicts. * Code review changes. --- src/lib/core/CHIPError.cpp | 40 +++++++++-- src/lib/core/CHIPError.h | 90 ++++++++++++------------- src/lib/core/tests/TestCHIPErrorStr.cpp | 39 ++++++++++- 3 files changed, 118 insertions(+), 51 deletions(-) diff --git a/src/lib/core/CHIPError.cpp b/src/lib/core/CHIPError.cpp index b942db6f52a29e..785ee0b7af07e9 100644 --- a/src/lib/core/CHIPError.cpp +++ b/src/lib/core/CHIPError.cpp @@ -62,9 +62,6 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, CHIP_ERROR err) #if !CHIP_CONFIG_SHORT_ERROR_STR switch (err.AsInteger()) { - case CHIP_ERROR_TOO_MANY_CONNECTIONS.AsInteger(): - desc = "Too many connections"; - break; case CHIP_ERROR_SENDING_BLOCKED.AsInteger(): desc = "Sending blocked"; break; @@ -407,6 +404,15 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, CHIP_ERROR err) case CHIP_ERROR_INVALID_FABRIC_ID.AsInteger(): desc = "Invalid Fabric Id"; break; + case CHIP_ERROR_TOO_MANY_CONNECTIONS.AsInteger(): + desc = "Too many connections"; + break; + case CHIP_ERROR_SHUT_DOWN.AsInteger(): + desc = "The operation was cancelled because a shut down was initiated"; + break; + case CHIP_ERROR_CANCELLED.AsInteger(): + desc = "The operation has been cancelled"; + break; case CHIP_ERROR_DRBG_ENTROPY_SOURCE_FAILED.AsInteger(): desc = "DRBG entropy source failed to generate entropy data"; break; @@ -620,12 +626,21 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, CHIP_ERROR err) case CHIP_ERROR_DUPLICATE_MESSAGE_RECEIVED.AsInteger(): desc = "Duplicate message received"; break; + case CHIP_ERROR_INVALID_PUBLIC_KEY.AsInteger(): + desc = "Invalid public key"; + break; + case CHIP_ERROR_FABRIC_MISMATCH_ON_ICA.AsInteger(): + desc = "Fabric mismatch on ICA"; + break; case CHIP_ERROR_MESSAGE_COUNTER_OUT_OF_WINDOW.AsInteger(): desc = "Message id out of window"; break; case CHIP_ERROR_REBOOT_SIGNAL_RECEIVED.AsInteger(): desc = "Termination signal is received"; break; + case CHIP_ERROR_NO_SHARED_TRUSTED_ROOT.AsInteger(): + desc = "No shared trusted root"; + break; case CHIP_ERROR_IM_STATUS_CODE_RECEIVED.AsInteger(): desc = "Interaction Model Error"; break; @@ -668,12 +683,15 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, CHIP_ERROR err) case CHIP_ERROR_IM_MALFORMED_DATA_VERSION_FILTER_IB.AsInteger(): desc = "Malformed Interaction Model Data Version Filter IB"; break; - case CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE.AsInteger(): - desc = "Malformed Interaction Model Status Response Message"; + case CHIP_ERROR_NOT_FOUND.AsInteger(): + desc = "The item referenced in the function call was not found"; break; case CHIP_ERROR_IM_MALFORMED_TIMED_REQUEST_MESSAGE.AsInteger(): desc = "Malformed Interaction Model Timed Request Message"; break; + case CHIP_ERROR_INVALID_FILE_IDENTIFIER.AsInteger(): + desc = "The file identifier, encoded in the first few bytes of a processed file, has unexpected value"; + break; case CHIP_ERROR_BUSY.AsInteger(): desc = "The Resource is busy and cannot process the request"; break; @@ -683,6 +701,18 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, CHIP_ERROR err) case CHIP_ERROR_PROVIDER_LIST_EXHAUSTED.AsInteger(): desc = "The provider list has been exhausted"; break; + case CHIP_ERROR_ANOTHER_COMMISSIONING_IN_PROGRESS.AsInteger(): + desc = "Another commissioning in progress"; + break; + case CHIP_ERROR_INVALID_SCHEME_PREFIX.AsInteger(): + desc = "The scheme field contains an invalid prefix"; + break; + case CHIP_ERROR_MISSING_URI_SEPARATOR.AsInteger(): + desc = "The URI separator is missing"; + break; + case CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE.AsInteger(): + desc = "Malformed Interaction Model Status Response Message"; + break; } #endif // !CHIP_CONFIG_SHORT_ERROR_STR diff --git a/src/lib/core/CHIPError.h b/src/lib/core/CHIPError.h index b952609ad46ad3..732d1f60d4241d 100644 --- a/src/lib/core/CHIPError.h +++ b/src/lib/core/CHIPError.h @@ -1472,15 +1472,15 @@ using CHIP_ERROR = ::chip::ChipError; * @brief * The operation cancelled because a shut down was initiated */ -#define CHIP_ERROR_SHUT_DOWN CHIP_CORE_ERROR(0x73) +#define CHIP_ERROR_SHUT_DOWN CHIP_CORE_ERROR(0x73) /** - * @def CHIP_ERROR_SHUT_DOWN + * @def CHIP_ERROR_CANCELLED * * @brief * The operation has been cancelled, generally by calling a cancel/abort request. */ -#define CHIP_ERROR_CANCELLED CHIP_CORE_ERROR(0x74) +#define CHIP_ERROR_CANCELLED CHIP_CORE_ERROR(0x74) /** * @def CHIP_ERROR_DRBG_ENTROPY_SOURCE_FAILED @@ -2206,7 +2206,7 @@ using CHIP_ERROR = ::chip::ChipError; #define CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_IB CHIP_CORE_ERROR(0xcc) /** - * @def CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_MESSAGE + * @def CHIP_ERROR_IM_MALFORMED_INVOKE_REQUEST_MESSAGE * * @brief * The InvokeResponseMessage is malformed: it either does not contain @@ -2286,15 +2286,6 @@ using CHIP_ERROR = ::chip::ChipError; */ #define CHIP_ERROR_IM_MALFORMED_EVENT_REPORT_IB CHIP_CORE_ERROR(0xd5) -/* - * @def CHIP_ERROR_ANOTHER_COMMISSIONING_IN_PROGRESS - * - * @brief - * Indicates that the commissioning window on the device is already open, and another - * commissioning is in progress - */ -#define CHIP_ERROR_ANOTHER_COMMISSIONING_IN_PROGRESS CHIP_CORE_ERROR(0xd6) - /** * @def CHIP_ERROR_IM_MALFORMED_CLUSTER_PATH_IB * @@ -2302,7 +2293,7 @@ using CHIP_ERROR = ::chip::ChipError; * The ClusterPathIB is malformed: it either does not contain * the required elements */ -#define CHIP_ERROR_IM_MALFORMED_CLUSTER_PATH_IB CHIP_CORE_ERROR(0xd6) +#define CHIP_ERROR_IM_MALFORMED_CLUSTER_PATH_IB CHIP_CORE_ERROR(0xd6) /** * @def CHIP_ERROR_IM_MALFORMED_DATA_VERSION_FILTER_IB @@ -2322,71 +2313,80 @@ using CHIP_ERROR = ::chip::ChipError; #define CHIP_ERROR_NOT_FOUND CHIP_CORE_ERROR(0xd8) /** - * @def CHIP_ERROR_INVALID_SCHEME_PREFIX + * @def CHIP_ERROR_IM_MALFORMED_TIMED_REQUEST_MESSAGE * * @brief - * The scheme field contains an invalid prefix + * The Attribute DataElement is malformed: it either does not contain + * the required elements */ -#define CHIP_ERROR_INVALID_SCHEME_PREFIX CHIP_CORE_ERROR(0xd6) +#define CHIP_ERROR_IM_MALFORMED_TIMED_REQUEST_MESSAGE CHIP_CORE_ERROR(0xd9) /** - * @def CHIP_ERROR_MISSING_URI_SEPARATOR + * @def CHIP_ERROR_INVALID_FILE_IDENTIFIER * * @brief - * The URI separator is missing + * The file identifier, encoded in the first few bytes of a processed file, + * has unexpected value. */ -#define CHIP_ERROR_MISSING_URI_SEPARATOR CHIP_CORE_ERROR(0xd7) +#define CHIP_ERROR_INVALID_FILE_IDENTIFIER CHIP_CORE_ERROR(0xda) /** - * @def CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE + * @def CHIP_ERROR_BUSY * * @brief - * The Attribute DataElement is malformed: it either does not contain - * the required elements + * The Resource is busy and cannot process the request. Trying again might work. */ -#define CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE CHIP_CORE_ERROR(0xd8) +#define CHIP_ERROR_BUSY CHIP_CORE_ERROR(0xdb) /** - * @def CHIP_ERROR_IM_MALFORMED_TIMED_REQUEST_MESSAGE - * - * @brief - * The Attribute DataElement is malformed: it either does not contain - * the required elements - */ -#define CHIP_ERROR_IM_MALFORMED_TIMED_REQUEST_MESSAGE CHIP_CORE_ERROR(0xd9) + * @def CHIP_ERROR_MAX_RETRY_EXCEEDED + * + * @brief + * The maximum retry limit has been exceeded. + */ + #define CHIP_ERROR_MAX_RETRY_EXCEEDED CHIP_CORE_ERROR(0xdc) -/** - * @def CHIP_ERROR_INVALID_FILE_IDENTIFIER + /** + * @def CHIP_ERROR_PROVIDER_LIST_EXHAUSTED + * + * @brief + * The provider list has been exhausted. + */ + #define CHIP_ERROR_PROVIDER_LIST_EXHAUSTED CHIP_CORE_ERROR(0xdd) + +/* + * @def CHIP_ERROR_ANOTHER_COMMISSIONING_IN_PROGRESS * * @brief - * The file identifier, encoded in the first few bytes of a processed file, - * has unexpected value. + * Indicates that the commissioning window on the device is already open, and another + * commissioning is in progress */ -#define CHIP_ERROR_INVALID_FILE_IDENTIFIER CHIP_CORE_ERROR(0xda) +#define CHIP_ERROR_ANOTHER_COMMISSIONING_IN_PROGRESS CHIP_CORE_ERROR(0xde) /** - * @def CHIP_ERROR_BUSY + * @def CHIP_ERROR_INVALID_SCHEME_PREFIX * * @brief - * The Resource is busy and cannot process the request. Trying again might work. + * The scheme field contains an invalid prefix */ -#define CHIP_ERROR_BUSY CHIP_CORE_ERROR(0xdb) +#define CHIP_ERROR_INVALID_SCHEME_PREFIX CHIP_CORE_ERROR(0xdf) /** - * @def CHIP_ERROR_MAX_RETRY_EXCEEDED + * @def CHIP_ERROR_MISSING_URI_SEPARATOR * * @brief - * The maximum retry limit has been exceeded. + * The URI separator is missing */ -#define CHIP_ERROR_MAX_RETRY_EXCEEDED CHIP_CORE_ERROR(0xdc) +#define CHIP_ERROR_MISSING_URI_SEPARATOR CHIP_CORE_ERROR(0xe0) /** - * @def CHIP_ERROR_PROVIDER_LIST_EXHAUSTED + * @def CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE * * @brief - * The provider list has been exhausted. + * The Attribute DataElement is malformed: it either does not contain + * the required elements */ -#define CHIP_ERROR_PROVIDER_LIST_EXHAUSTED CHIP_CORE_ERROR(0xdd) +#define CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE CHIP_CORE_ERROR(0xe1) /** * @} diff --git a/src/lib/core/tests/TestCHIPErrorStr.cpp b/src/lib/core/tests/TestCHIPErrorStr.cpp index 7a36e02f9488dc..5880f594d761aa 100644 --- a/src/lib/core/tests/TestCHIPErrorStr.cpp +++ b/src/lib/core/tests/TestCHIPErrorStr.cpp @@ -49,7 +49,6 @@ using namespace chip; // clang-format off static const CHIP_ERROR kTestElements[] = { - CHIP_ERROR_TOO_MANY_CONNECTIONS, CHIP_ERROR_SENDING_BLOCKED, CHIP_ERROR_CONNECTION_ABORTED, CHIP_ERROR_INCORRECT_STATE, @@ -59,6 +58,7 @@ static const CHIP_ERROR kTestElements[] = CHIP_ERROR_NO_UNSOLICITED_MESSAGE_HANDLER, CHIP_ERROR_NO_CONNECTION_HANDLER, CHIP_ERROR_TOO_MANY_PEER_NODES, + CHIP_ERROR_SENTINEL, CHIP_ERROR_NO_MEMORY, CHIP_ERROR_NO_MESSAGE_HANDLER, CHIP_ERROR_MESSAGE_INCOMPLETE, @@ -162,6 +162,9 @@ static const CHIP_ERROR kTestElements[] = CHIP_ERROR_NO_COMMON_PASE_CONFIGURATIONS, CHIP_ERROR_UNSOLICITED_MSG_NO_ORIGINATOR, CHIP_ERROR_INVALID_FABRIC_ID, + CHIP_ERROR_TOO_MANY_CONNECTIONS, + CHIP_ERROR_SHUT_DOWN, + CHIP_ERROR_CANCELLED, CHIP_ERROR_DRBG_ENTROPY_SOURCE_FAILED, CHIP_ERROR_TLV_TAG_NOT_FOUND, CHIP_ERROR_FABRIC_EXISTS, @@ -209,6 +212,15 @@ static const CHIP_ERROR kTestElements[] = CHIP_ERROR_INCONSISTENT_CONDITIONALITY, CHIP_ERROR_LOCAL_DATA_INCONSISTENT, CHIP_EVENT_ID_FOUND, + CHIP_ERROR_INTERNAL, + CHIP_ERROR_OPEN_FAILED, + CHIP_ERROR_READ_FAILED, + CHIP_ERROR_WRITE_FAILED, + CHIP_ERROR_DECODE_FAILED, + CHIP_ERROR_SESSION_KEY_SUSPENDED, + CHIP_ERROR_UNSUPPORTED_WIRELESS_REGULATORY_DOMAIN, + CHIP_ERROR_UNSUPPORTED_WIRELESS_OPERATING_LOCATION, + CHIP_ERROR_MDNS_COLLISION, CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH, CHIP_ERROR_IM_MALFORMED_EVENT_PATH, CHIP_ERROR_IM_MALFORMED_COMMAND_PATH, @@ -217,9 +229,34 @@ static const CHIP_ERROR kTestElements[] = CHIP_ERROR_IM_MALFORMED_EVENT_DATA_ELEMENT, CHIP_ERROR_IM_MALFORMED_STATUS_CODE, CHIP_ERROR_PEER_NODE_NOT_FOUND, + CHIP_ERROR_HSM, CHIP_ERROR_IM_STATUS_CODE_RECEIVED, + CHIP_ERROR_IM_MALFORMED_COMMAND_STATUS_IB, + CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_IB, + CHIP_ERROR_IM_MALFORMED_INVOKE_REQUEST_MESSAGE, + CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_MESSAGE, + CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_REPORT_MESSAGE, + CHIP_ERROR_IM_MALFORMED_WRITE_REQUEST_MESSAGE, + CHIP_ERROR_IM_MALFORMED_WRITE_RESPONSE_MESSAGE, + CHIP_ERROR_IM_MALFORMED_READ_REQUEST_MESSAGE, + CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_REQUEST_MESSAGE, + CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_RESPONSE_MESSAGE, + CHIP_ERROR_IM_MALFORMED_EVENT_REPORT_IB, + CHIP_ERROR_IM_MALFORMED_CLUSTER_PATH_IB, + CHIP_ERROR_IM_MALFORMED_DATA_VERSION_FILTER_IB, + CHIP_ERROR_NOT_FOUND, + CHIP_ERROR_IM_MALFORMED_TIMED_REQUEST_MESSAGE, + CHIP_ERROR_INVALID_FILE_IDENTIFIER, + CHIP_ERROR_BUSY, CHIP_ERROR_MAX_RETRY_EXCEEDED, CHIP_ERROR_PROVIDER_LIST_EXHAUSTED, + CHIP_ERROR_ANOTHER_COMMISSIONING_IN_PROGRESS, + CHIP_ERROR_INVALID_SCHEME_PREFIX, + CHIP_ERROR_MISSING_URI_SEPARATOR, + CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE, + CHIP_ERROR_IM_MALFORMED_TIMED_REQUEST_MESSAGE, + CHIP_ERROR_INVALID_FILE_IDENTIFIER, + CHIP_ERROR_BUSY }; // clang-format on From c503a9783de4c74fd9e852f4ad1901d7427f56fd Mon Sep 17 00:00:00 2001 From: Jerry Johns Date: Fri, 15 Apr 2022 15:22:58 -0700 Subject: [PATCH 4/5] Add support for re-using CASE sessions (#17266) * Add support for re-using CASE sessions. * Review feedback * Fixed up the tv-casting-app to somewhat function --- .../chip-tool/commands/tests/TestCommand.cpp | 12 +- examples/tv-casting-app/linux/main.cpp | 48 ++++-- src/app/CASESessionManager.cpp | 2 +- src/app/OperationalDeviceProxy.cpp | 143 ++++++++++++------ src/app/OperationalDeviceProxy.h | 33 ++-- src/controller/CHIPDeviceController.h | 10 ++ src/transport/SessionManager.cpp | 10 +- src/transport/SessionManager.h | 14 +- 8 files changed, 192 insertions(+), 80 deletions(-) diff --git a/examples/chip-tool/commands/tests/TestCommand.cpp b/examples/chip-tool/commands/tests/TestCommand.cpp index 24d8558ede1a34..aed75cd215b068 100644 --- a/examples/chip-tool/commands/tests/TestCommand.cpp +++ b/examples/chip-tool/commands/tests/TestCommand.cpp @@ -32,7 +32,17 @@ CHIP_ERROR TestCommand::RunCommand() CHIP_ERROR TestCommand::WaitForCommissionee(chip::NodeId nodeId) { - CurrentCommissioner().ReleaseOperationalDevice(nodeId); + chip::FabricIndex fabricIndex; + + ReturnErrorOnFailure(CurrentCommissioner().GetFabricIndex(&fabricIndex)); + + // + // There's a chance the commissionee may have rebooted before this call here as part of a test flow + // or is just starting out fresh outright. Let's make sure we're not re-using any cached CASE sessions + // that will now be stale and mismatched with the peer, causing subsequent interactions to fail. + // + CurrentCommissioner().SessionMgr()->ExpireAllPairings(nodeId, fabricIndex); + return CurrentCommissioner().GetConnectedDevice(nodeId, &mOnDeviceConnectedCallback, &mOnDeviceConnectionFailureCallback); } diff --git a/examples/tv-casting-app/linux/main.cpp b/examples/tv-casting-app/linux/main.cpp index c305746333e07f..2c5815069fec16 100644 --- a/examples/tv-casting-app/linux/main.cpp +++ b/examples/tv-casting-app/linux/main.cpp @@ -332,6 +332,10 @@ class TargetEndpointInfo class TargetVideoPlayerInfo { public: + TargetVideoPlayerInfo() : + mOnConnectedCallback(HandleDeviceConnected, this), mOnConnectionFailureCallback(HandleDeviceConnectionFailure, this) + {} + bool IsInitialized() { return mInitialized; } CHIP_ERROR Initialize(NodeId nodeId, FabricIndex fabricIndex) @@ -359,21 +363,30 @@ class TargetVideoPlayerInfo .clientPool = &gCASEClientPool, }; - PeerId peerID = fabric->GetPeerIdForNode(nodeId); - mOperationalDeviceProxy = chip::Platform::New(initParams, peerID); + PeerId peerID = fabric->GetPeerIdForNode(nodeId); + + // + // TODO: The code here is assuming that we can create an OperationalDeviceProxy instance and attach it immediately + // to a CASE session that just got established to us by the tv-app. While this will work most of the time, + // this is a dangerous assumption to make since it is entirely possible for that secure session to have been + // evicted in the time since that session was established to the point here when we desire to interact back + // with that peer. If that is the case, our `OnConnected` callback will not get invoked syncronously and + // mOperationalDeviceProxy will still have a value of null, triggering the check below to fail. + // + mOperationalDeviceProxy = nullptr; + CHIP_ERROR err = + server->GetCASESessionManager()->FindOrEstablishSession(peerID, &mOnConnectedCallback, &mOnConnectionFailureCallback); + if (err != CHIP_NO_ERROR) + { + ChipLogError(AppServer, "Could not establish a session to the peer"); + return err; + } - // TODO: figure out why this doesn't work so that we can remove OperationalDeviceProxy creation above, - // and remove the FindSecureSessionForNode and SetConnectedSession calls below - // mOperationalDeviceProxy = server->GetCASESessionManager()->FindExistingSession(nodeId); if (mOperationalDeviceProxy == nullptr) { - ChipLogError(AppServer, "Failed in creating an instance of OperationalDeviceProxy"); + ChipLogError(AppServer, "Failed to find an existing instance of OperationalDeviceProxy to the peer"); return CHIP_ERROR_INVALID_ARGUMENT; } - ChipLogError(AppServer, "Created an instance of OperationalDeviceProxy"); - - SessionHandle handle = server->GetSecureSessionManager().FindSecureSessionForNode(nodeId); - mOperationalDeviceProxy->SetConnectedSession(handle); mInitialized = true; return CHIP_NO_ERROR; @@ -451,12 +464,27 @@ class TargetVideoPlayerInfo } private: + static void HandleDeviceConnected(void * context, OperationalDeviceProxy * device) + { + TargetVideoPlayerInfo * _this = static_cast(context); + _this->mOperationalDeviceProxy = device; + } + + static void HandleDeviceConnectionFailure(void * context, PeerId peerId, CHIP_ERROR error) + { + TargetVideoPlayerInfo * _this = static_cast(context); + _this->mOperationalDeviceProxy = nullptr; + } + static constexpr size_t kMaxNumberOfEndpoints = 5; TargetEndpointInfo mEndpoints[kMaxNumberOfEndpoints]; NodeId mNodeId; FabricIndex mFabricIndex; OperationalDeviceProxy * mOperationalDeviceProxy; + Callback::Callback mOnConnectedCallback; + Callback::Callback mOnConnectionFailureCallback; + bool mInitialized = false; }; TargetVideoPlayerInfo gTargetVideoPlayerInfo; diff --git a/src/app/CASESessionManager.cpp b/src/app/CASESessionManager.cpp index 02f6ea1ced98b8..597be920fe984a 100644 --- a/src/app/CASESessionManager.cpp +++ b/src/app/CASESessionManager.cpp @@ -39,7 +39,7 @@ CHIP_ERROR CASESessionManager::FindOrEstablishSession(PeerId peerId, Callback::C OperationalDeviceProxy * session = FindExistingSession(peerId); if (session == nullptr) { - ChipLogDetail(CASESessionManager, "FindOrEstablishSession: No existing session found"); + ChipLogDetail(CASESessionManager, "FindOrEstablishSession: No existing OperationalDeviceProxy instance found"); session = mConfig.devicePool->Allocate(mConfig.sessionInitParams, peerId); diff --git a/src/app/OperationalDeviceProxy.cpp b/src/app/OperationalDeviceProxy.cpp index ef7ea1ce0738b6..404c6181ca46ee 100644 --- a/src/app/OperationalDeviceProxy.cpp +++ b/src/app/OperationalDeviceProxy.cpp @@ -29,6 +29,7 @@ #include "CASEClient.h" #include "CommandSender.h" #include "ReadPrepareParams.h" +#include "transport/SecureSession.h" #include #include @@ -57,10 +58,35 @@ void OperationalDeviceProxy::MoveToState(State aTargetState) } } +bool OperationalDeviceProxy::AttachToExistingSecureSession() +{ + VerifyOrReturnError(mState == State::NeedsAddress || mState == State::Initialized, false); + + ScopedNodeId peerNodeId(mPeerId.GetNodeId(), mFabricInfo->GetFabricIndex()); + auto sessionHandle = mInitParams.sessionManager->FindSecureSessionForNode(peerNodeId, Transport::SecureSession::Type::kCASE); + if (sessionHandle.HasValue()) + { + ChipLogProgress(Controller, "Found an existing secure session to [" ChipLogFormatX64 "-" ChipLogFormatX64 "]!", + ChipLogValueX64(mPeerId.GetCompressedFabricId()), ChipLogValueX64(mPeerId.GetNodeId())); + mSecureSession.Grab(sessionHandle.Value()); + return true; + } + + return false; +} + CHIP_ERROR OperationalDeviceProxy::Connect(Callback::Callback * onConnection, Callback::Callback * onFailure) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; + bool isConnected = false; + + // + // Always enqueue our user provided callbacks into our callback list. + // If anything goes wrong below, we'll trigger failures (including any queued from + // a previous iteration which in theory shouldn't happen, but this is written to be more defensive) + // + EnqueueConnectionCallbacks(onConnection, onFailure); switch (mState) { @@ -69,35 +95,47 @@ CHIP_ERROR OperationalDeviceProxy::Connect(Callback::Callback break; case State::NeedsAddress: - err = LookupPeerAddress(); - EnqueueConnectionCallbacks(onConnection, onFailure); + isConnected = AttachToExistingSecureSession(); + if (!isConnected) + { + err = LookupPeerAddress(); + } + break; case State::Initialized: - err = EstablishConnection(); - if (err == CHIP_NO_ERROR) + isConnected = AttachToExistingSecureSession(); + if (!isConnected) { - EnqueueConnectionCallbacks(onConnection, onFailure); + err = EstablishConnection(); } + break; + case State::Connecting: - EnqueueConnectionCallbacks(onConnection, onFailure); break; case State::SecureConnected: - if (onConnection != nullptr) - { - onConnection->mCall(onConnection->mContext, this); - } + isConnected = true; break; default: err = CHIP_ERROR_INCORRECT_STATE; } - if (err != CHIP_NO_ERROR && onFailure != nullptr) + if (isConnected) + { + MoveToState(State::SecureConnected); + } + + // + // Dequeue all our callbacks on either encountering an error + // or if we successfully connected. Both should not be set + // simultaneously. + // + if (err != CHIP_NO_ERROR || isConnected) { - onFailure->mCall(onFailure->mContext, mPeerId, err); + DequeueConnectionCallbacks(err); } return err; @@ -133,7 +171,7 @@ CHIP_ERROR OperationalDeviceProxy::UpdateDeviceData(const Transport::PeerAddress err = EstablishConnection(); if (err != CHIP_NO_ERROR) { - OnSessionEstablishmentError(err); + DequeueConnectionCallbacks(err); } } else @@ -194,35 +232,43 @@ void OperationalDeviceProxy::EnqueueConnectionCallbacks(Callback::Callback * cb = Callback::Callback::FromCancelable(ready.mNext); + Callback::Callback * cb = + Callback::Callback::FromCancelable(failureReady.mNext); cb->Cancel(); - if (executeCallback) + + if (error != CHIP_NO_ERROR) { - cb->mCall(cb->mContext, this); + cb->mCall(cb->mContext, mPeerId, error); } } -} -void OperationalDeviceProxy::DequeueConnectionFailureCallbacks(CHIP_ERROR error, bool executeCallback) -{ - Cancelable ready; - mConnectionFailure.DequeueAll(ready); - while (ready.mNext != &ready) + while (successReady.mNext != &successReady) { - Callback::Callback * cb = - Callback::Callback::FromCancelable(ready.mNext); + Callback::Callback * cb = Callback::Callback::FromCancelable(successReady.mNext); cb->Cancel(); - if (executeCallback) + if (error == CHIP_NO_ERROR) { - cb->mCall(cb->mContext, mPeerId, error); + cb->mCall(cb->mContext, this); } } } @@ -234,13 +280,20 @@ void OperationalDeviceProxy::HandleCASEConnectionFailure(void * context, CASECli ChipLogError(Controller, "HandleCASEConnectionFailure was called while the device was not initialized")); VerifyOrReturn(client == device->mCASEClient, ChipLogError(Controller, "HandleCASEConnectionFailure for unknown CASEClient")); + // + // We don't need to reset the state all the way back to NeedsAddress since all that transpired + // was just CASE connection failure. So let's re-use the cached address to re-do CASE again + // if need-be. + // device->MoveToState(State::Initialized); device->CloseCASESession(); - device->DequeueConnectionSuccessCallbacks(/* executeCallback */ false); - device->DequeueConnectionFailureCallbacks(error, /* executeCallback */ true); - // Do not touch device anymore; it might have been destroyed by a failure + device->DequeueConnectionCallbacks(error); + + // + // Do not touch device instance anymore; it might have been destroyed by a failure // callback. + // } void OperationalDeviceProxy::HandleCASEConnected(void * context, CASEClient * client) @@ -254,19 +307,18 @@ void OperationalDeviceProxy::HandleCASEConnected(void * context, CASEClient * cl if (err != CHIP_NO_ERROR) { device->HandleCASEConnectionFailure(context, client, err); - // Do not touch device anymore; it might have been destroyed by a - // HandleCASEConnectionFailure. } else { device->MoveToState(State::SecureConnected); - device->CloseCASESession(); - device->DequeueConnectionFailureCallbacks(CHIP_NO_ERROR, /* executeCallback */ false); - device->DequeueConnectionSuccessCallbacks(/* executeCallback */ true); - // Do not touch device anymore; it might have been destroyed by a - // success callback. + device->DequeueConnectionCallbacks(CHIP_NO_ERROR); } + + // + // Do not touch this instance anymore; it might have been destroyed by a + // callback. + // } CHIP_ERROR OperationalDeviceProxy::Disconnect() @@ -285,12 +337,6 @@ CHIP_ERROR OperationalDeviceProxy::Disconnect() return CHIP_NO_ERROR; } -void OperationalDeviceProxy::SetConnectedSession(const SessionHandle & handle) -{ - mSecureSession.Grab(handle); - MoveToState(State::SecureConnected); -} - void OperationalDeviceProxy::Clear() { if (mCASEClient) @@ -367,8 +413,7 @@ void OperationalDeviceProxy::OnNodeAddressResolutionFailed(const PeerId & peerId ChipLogError(Discovery, "Operational discovery failed for 0x" ChipLogFormatX64 ": %" CHIP_ERROR_FORMAT, ChipLogValueX64(peerId.GetNodeId()), reason.Format()); - DequeueConnectionSuccessCallbacks(/* executeCallback */ false); - DequeueConnectionFailureCallbacks(reason, /* executeCallback */ true); + DequeueConnectionCallbacks(reason); } } // namespace chip diff --git a/src/app/OperationalDeviceProxy.h b/src/app/OperationalDeviceProxy.h index 7f1b9d715b23f6..ea5e60892369b2 100644 --- a/src/app/OperationalDeviceProxy.h +++ b/src/app/OperationalDeviceProxy.h @@ -91,6 +91,10 @@ class DLL_EXPORT OperationalDeviceProxy : public DeviceProxy, { public: ~OperationalDeviceProxy() override; + + // + // TODO: Should not be PeerId, but rather, ScopedNodeId + // OperationalDeviceProxy(DeviceProxyInitParams & params, PeerId peerId) : mSecureSession(*this) { mInitParams = params; @@ -159,15 +163,6 @@ class DLL_EXPORT OperationalDeviceProxy : public DeviceProxy, */ CHIP_ERROR Disconnect() override; - /** - * Use SetConnectedSession if 'this' object is a newly allocated device proxy. - * It will take an existing session, such as the one established - * during commissioning, and use it for this device proxy. - * - * Note: Avoid using this function generally as it is Deprecated - */ - void SetConnectedSession(const SessionHandle & handle); - NodeId GetDeviceId() const override { return mPeerId.GetNodeId(); } /** @@ -268,6 +263,15 @@ class DLL_EXPORT OperationalDeviceProxy : public DeviceProxy, CHIP_ERROR EstablishConnection(); + /* + * This checks to see if an existing CASE session exists to the peer within the SessionManager + * and if one exists, to load that into mSecureSession. + * + * Returns true if a valid session was found, false otherwise. + * + */ + bool AttachToExistingSecureSession(); + bool IsSecureConnected() const override { return mState == State::SecureConnected; } static void HandleCASEConnected(void * context, CASEClient * client); @@ -280,8 +284,15 @@ class DLL_EXPORT OperationalDeviceProxy : public DeviceProxy, void EnqueueConnectionCallbacks(Callback::Callback * onConnection, Callback::Callback * onFailure); - void DequeueConnectionSuccessCallbacks(bool executeCallback); - void DequeueConnectionFailureCallbacks(CHIP_ERROR error, bool executeCallback); + /* + * This dequeues all failure and success callbacks and appropriately + * invokes either set depending on the value of error. + * + * If error == CHIP_NO_ERROR, only success callbacks are invoked. + * Otherwise, only failure callbacks are invoked. + * + */ + void DequeueConnectionCallbacks(CHIP_ERROR error); }; } // namespace chip diff --git a/src/controller/CHIPDeviceController.h b/src/controller/CHIPDeviceController.h index e09490ff5c4413..d2aa1172e05c4f 100644 --- a/src/controller/CHIPDeviceController.h +++ b/src/controller/CHIPDeviceController.h @@ -144,6 +144,16 @@ class DLL_EXPORT DeviceController : public SessionRecoveryDelegate, public Abstr */ virtual CHIP_ERROR Shutdown(); + SessionManager * SessionMgr() + { + if (mSystemState) + { + return mSystemState->SessionMgr(); + } + + return nullptr; + } + CHIP_ERROR GetPeerAddressAndPort(PeerId peerId, Inet::IPAddress & addr, uint16_t & port); /** diff --git a/src/transport/SessionManager.cpp b/src/transport/SessionManager.cpp index 730a64e7abf80c..f0b2047683a45a 100644 --- a/src/transport/SessionManager.cpp +++ b/src/transport/SessionManager.cpp @@ -812,11 +812,12 @@ void SessionManager::ExpiryTimerCallback(System::Layer * layer, void * param) mgr->ScheduleExpiryTimer(); // re-schedule the oneshot timer } -SessionHandle SessionManager::FindSecureSessionForNode(NodeId peerNodeId) +Optional SessionManager::FindSecureSessionForNode(ScopedNodeId peerNodeId, Transport::SecureSession::Type type) { SecureSession * found = nullptr; - mSecureSessions.ForEachSession([&](auto session) { - if (session->GetPeerNodeId() == peerNodeId) + mSecureSessions.ForEachSession([&peerNodeId, type, &found](auto session) { + if (session->GetPeer() == peerNodeId && + (type == SecureSession::Type::kUndefined || type == session->GetSecureSessionType())) { found = session; return Loop::Break; @@ -824,8 +825,7 @@ SessionHandle SessionManager::FindSecureSessionForNode(NodeId peerNodeId) return Loop::Continue; }); - VerifyOrDie(found != nullptr); - return SessionHandle(*found); + return found != nullptr ? MakeOptional(*found) : Optional::Missing(); } /** diff --git a/src/transport/SessionManager.h b/src/transport/SessionManager.h index 87c430646ddd87..244155482bcebd 100644 --- a/src/transport/SessionManager.h +++ b/src/transport/SessionManager.h @@ -249,9 +249,17 @@ class DLL_EXPORT SessionManager : public TransportMgrDelegate return mUnauthenticatedSessions.AllocInitiator(ephemeralInitiatorNodeID, peerAddress, config); } - // TODO: this is a temporary solution for legacy tests which use nodeId to send packets - // and tv-casting-app that uses the TV's node ID to find the associated secure session - SessionHandle FindSecureSessionForNode(NodeId peerNodeId); + // + // Find an existing secure session given a peer's scoped NodeId and a type of session to match against. + // If matching against all types of sessions is desired, kUndefined should be passed into type. + // + // If a valid session is found, an Optional with the value set to the SessionHandle of the session + // is returned. Otherwise, an Optional with no value set is returned. + // + // + Optional + FindSecureSessionForNode(ScopedNodeId peerNodeId, + Transport::SecureSession::Type type = Transport::SecureSession::Type::kUndefined); using SessionHandleCallback = bool (*)(void * context, SessionHandle & sessionHandle); CHIP_ERROR ForEachSessionHandle(void * context, SessionHandleCallback callback); From 20e1a4a705770d5222a8ebf04e12ab2ce0304df6 Mon Sep 17 00:00:00 2001 From: Carol Yang Date: Sat, 16 Apr 2022 23:53:37 -0700 Subject: [PATCH 5/5] Enable custom port for all-clusters-app (#17431) --- examples/all-clusters-app/linux/args.gni | 8 +++++ .../linux/include/CHIPProjectAppConfig.h | 34 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 examples/all-clusters-app/linux/include/CHIPProjectAppConfig.h diff --git a/examples/all-clusters-app/linux/args.gni b/examples/all-clusters-app/linux/args.gni index 311ddab32d5fe5..703c3576d66c19 100644 --- a/examples/all-clusters-app/linux/args.gni +++ b/examples/all-clusters-app/linux/args.gni @@ -15,3 +15,11 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/standalone/args.gni") + +chip_device_project_config_include = "" +chip_project_config_include = "" +chip_system_project_config_include = "" + +chip_project_config_include_dirs = + [ "${chip_root}/examples/all-clusters-app/linux/include" ] +chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] diff --git a/examples/all-clusters-app/linux/include/CHIPProjectAppConfig.h b/examples/all-clusters-app/linux/include/CHIPProjectAppConfig.h new file mode 100644 index 00000000000000..b6c15f4c98230e --- /dev/null +++ b/examples/all-clusters-app/linux/include/CHIPProjectAppConfig.h @@ -0,0 +1,34 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Example project configuration file for CHIP. + * + * This is a place to put application or project-specific overrides + * to the default configuration values for general CHIP features. + * + */ + +#pragma once + +// include the CHIPProjectConfig from config/standalone +#include + +// Allows app options (ports) to be configured on launch of app +#define CHIP_DEVICE_ENABLE_PORT_PARAMS 1