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 2555a29c8ec10e..58fe67cbca289a 100644 --- a/src/app/zap-templates/zcl/data-model/silabs/ha.xml +++ b/src/app/zap-templates/zcl/data-model/silabs/ha.xml @@ -406,23 +406,21 @@ limitations under the License. BALLAST_CONFIGURATION_CLUSTER true true - - physical min level - physical max level - ballast status - min level - max level - power on level - power on fade time - intrinsic ballast factor - ballast factor adjustment - lamp quality - lamp type - lamp manufacturer - lamp rated hours - lamp burn hours - lamp alarm mode - lamp burn hours trip point + + PhysicalMinLevel + PhysicalMaxLevel + BallastStatus + MinLevel + MaxLevel + IntrinsicBalanceFactor + BallastFactorAdjustment + LampQuantity + LampType + LampManufacturer + LampRatedHours + LampBurnHours + LampAlarmMode + LampBurnHoursTripPoint Occupancy Sensing diff --git a/src/app/zap_cluster_list.py b/src/app/zap_cluster_list.py index 1adf32c657f8ef..ce89b6f150fc4e 100755 --- a/src/app/zap_cluster_list.py +++ b/src/app/zap_cluster_list.py @@ -16,6 +16,7 @@ 'APPLICATION_BASIC_CLUSTER': ['application-basic-server'], 'APPLICATION_LAUNCHER_CLUSTER': ['application-launcher-server'], 'AUDIO_OUTPUT_CLUSTER': ['audio-output-server'], + 'BALLAST_CONFIGURATION_CLUSTER': [], 'BARRIER_CONTROL_CLUSTER': ['barrier-control-server'], 'BASIC_CLUSTER': ['basic'], 'BINARY_INPUT_BASIC_CLUSTER': [], @@ -99,6 +100,7 @@ 'APPLICATION_BASIC_CLUSTER': [], 'APPLICATION_LAUNCHER_CLUSTER': [], 'AUDIO_OUTPUT_CLUSTER': [], + 'BALLAST_CONFIGURATION_CLUSTER': [], 'BARRIER_CONTROL_CLUSTER': [], 'BASIC_CLUSTER': [], 'BINARY_INPUT_BASIC_CLUSTER': [], diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 95eb8b0fb1c16b..7ca5b0106df4fd 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -3336,6 +3336,28 @@ client cluster ColorControl = 768 { command StepColorTemperature(StepColorTemperatureRequest): DefaultSuccess = 76; } +client cluster BallastConfiguration = 769 { + readonly attribute int8u physicalMinLevel = 0; + readonly attribute int8u physicalMaxLevel = 1; + readonly attribute bitmap8 ballastStatus = 2; + attribute int8u minLevel = 16; + attribute int8u maxLevel = 17; + attribute nullable int8u intrinsicBalanceFactor = 20; + attribute nullable int8u ballastFactorAdjustment = 21; + readonly attribute int8u lampQuantity = 32; + attribute char_string<16> lampType = 48; + attribute char_string<16> lampManufacturer = 49; + attribute nullable int24u lampRatedHours = 50; + attribute nullable int24u lampBurnHours = 51; + attribute bitmap8 lampAlarmMode = 52; + attribute nullable int24u lampBurnHoursTripPoint = 53; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + client cluster IlluminanceMeasurement = 1024 { enum LightSensorType : ENUM8 { kPhotodiode = 0; @@ -4393,6 +4415,7 @@ endpoint 1 { binding cluster FanControl; binding cluster ThermostatUserInterfaceConfiguration; binding cluster ColorControl; + binding cluster BallastConfiguration; binding cluster IlluminanceMeasurement; binding cluster TemperatureMeasurement; binding cluster PressureMeasurement; diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 7e3e1f0c5080ad..6439260f235608 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -1,5 +1,5 @@ { - "featureLevel": 72, + "featureLevel": 75, "creator": "zap", "keyValuePairs": [ { @@ -19,14 +19,14 @@ { "pathRelativity": "relativeToZap", "path": "../../app/zap-templates/zcl/zcl.json", - "version": "ZCL Test Data", - "type": "zcl-properties" + "type": "zcl-properties", + "version": "ZCL Test Data" }, { "pathRelativity": "relativeToZap", "path": "../../app/zap-templates/app-templates.json", - "version": "chip-v1", - "type": "gen-templates-json" + "type": "gen-templates-json", + "version": "chip-v1" } ], "endpointTypes": [ @@ -13561,6 +13561,364 @@ } ] }, + { + "name": "Ballast Configuration", + "code": 769, + "mfgCode": null, + "define": "BALLAST_CONFIGURATION_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Ballast Configuration", + "code": 769, + "mfgCode": null, + "define": "BALLAST_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "PhysicalMinLevel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PhysicalMaxLevel", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFE", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BallastStatus", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinLevel", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxLevel", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFE", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "IntrinsicBalanceFactor", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BallastFactorAdjustment", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFE", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LampQuantity", + "code": 32, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LampType", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LampManufacturer", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LampRatedHours", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "int24u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFFFFFF", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LampBurnHours", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "int24u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LampAlarmMode", + "code": 52, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LampBurnHoursTripPoint", + "code": 53, + "mfgCode": null, + "side": "server", + "type": "int24u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFFFFFF", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Illuminance Measurement", "code": 1024, diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index bcfb522f306a5c..af18e87a079d4f 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -12963,6 +12963,357 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::BallastConfiguration::Id: { + using namespace app::Clusters::BallastConfiguration; + switch (aPath.mAttributeId) + { + case Attributes::PhysicalMinLevel::Id: { + using TypeInfo = Attributes::PhysicalMinLevel::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::PhysicalMaxLevel::Id: { + using TypeInfo = Attributes::PhysicalMaxLevel::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::BallastStatus::Id: { + using TypeInfo = Attributes::BallastStatus::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::MinLevel::Id: { + using TypeInfo = Attributes::MinLevel::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::MaxLevel::Id: { + using TypeInfo = Attributes::MaxLevel::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::IntrinsicBalanceFactor::Id: { + using TypeInfo = Attributes::IntrinsicBalanceFactor::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::BallastFactorAdjustment::Id: { + using TypeInfo = Attributes::BallastFactorAdjustment::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::LampQuantity::Id: { + using TypeInfo = Attributes::LampQuantity::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::LampType::Id: { + using TypeInfo = Attributes::LampType::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + return value; + } + case Attributes::LampManufacturer::Id: { + using TypeInfo = Attributes::LampManufacturer::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + return value; + } + case Attributes::LampRatedHours::Id: { + using TypeInfo = Attributes::LampRatedHours::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::LampBurnHours::Id: { + using TypeInfo = Attributes::LampBurnHours::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::LampAlarmMode::Id: { + using TypeInfo = Attributes::LampAlarmMode::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::LampBurnHoursTripPoint::Id: { + using TypeInfo = Attributes::LampBurnHoursTripPoint::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } case app::Clusters::IlluminanceMeasurement::Id: { using namespace app::Clusters::IlluminanceMeasurement; switch (aPath.mAttributeId) diff --git a/src/controller/java/zap-generated/CHIPCallbackTypes.h b/src/controller/java/zap-generated/CHIPCallbackTypes.h index 87ce0b4174277c..a4a6ec83cc7b51 100644 --- a/src/controller/java/zap-generated/CHIPCallbackTypes.h +++ b/src/controller/java/zap-generated/CHIPCallbackTypes.h @@ -1383,6 +1383,45 @@ typedef void (*CHIPColorControlClusterFeatureMapAttributeCallbackType)( typedef void (*CHIPColorControlClusterClusterRevisionAttributeCallbackType)( void *, chip::app::Clusters::ColorControl::Attributes::ClusterRevision::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterPhysicalMinLevelAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::PhysicalMinLevel::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterPhysicalMaxLevelAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::PhysicalMaxLevel::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterBallastStatusAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::BallastStatus::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterMinLevelAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::MinLevel::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterMaxLevelAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::MaxLevel::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterIntrinsicBalanceFactorAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::IntrinsicBalanceFactor::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterBallastFactorAdjustmentAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::BallastFactorAdjustment::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterLampQuantityAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::LampQuantity::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterLampTypeAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::LampType::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterLampManufacturerAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::LampManufacturer::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterLampRatedHoursAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::LampRatedHours::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterLampBurnHoursAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::LampBurnHours::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterLampAlarmModeAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::LampAlarmMode::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterLampBurnHoursTripPointAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::LampBurnHoursTripPoint::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterGeneratedCommandListAttributeCallbackType)( + void *, const chip::app::Clusters::BallastConfiguration::Attributes::GeneratedCommandList::TypeInfo::DecodableType &); +typedef void (*CHIPBallastConfigurationClusterAcceptedCommandListAttributeCallbackType)( + void *, const chip::app::Clusters::BallastConfiguration::Attributes::AcceptedCommandList::TypeInfo::DecodableType &); +typedef void (*CHIPBallastConfigurationClusterAttributeListAttributeCallbackType)( + void *, const chip::app::Clusters::BallastConfiguration::Attributes::AttributeList::TypeInfo::DecodableType &); +typedef void (*CHIPBallastConfigurationClusterFeatureMapAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::FeatureMap::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + typedef void (*CHIPIlluminanceMeasurementClusterMeasuredValueAttributeCallbackType)( void *, chip::app::Clusters::IlluminanceMeasurement::Attributes::MeasuredValue::TypeInfo::DecodableArgType); typedef void (*CHIPIlluminanceMeasurementClusterMinMeasuredValueAttributeCallbackType)( diff --git a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp index a8c3724dea95d4..4612f4b7b96bae 100644 --- a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp @@ -4529,6 +4529,566 @@ JNI_METHOD(void, ColorControlCluster, writeStartUpColorTemperatureMiredsAttribut onFailure.release(); } +JNI_METHOD(void, BallastConfigurationCluster, writeMinLevelAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::BallastConfiguration::Attributes::MinLevel::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; + BallastConfigurationCluster * 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, BallastConfigurationCluster, writeMaxLevelAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::BallastConfiguration::Attributes::MaxLevel::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; + BallastConfigurationCluster * 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, BallastConfigurationCluster, writeIntrinsicBalanceFactorAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::BallastConfiguration::Attributes::IntrinsicBalanceFactor::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + if (value == nullptr) + { + cppValue.SetNull(); + } + else + { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = static_cast>( + chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + } + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + 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; + BallastConfigurationCluster * 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, BallastConfigurationCluster, writeBallastFactorAdjustmentAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::BallastConfiguration::Attributes::BallastFactorAdjustment::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + if (value == nullptr) + { + cppValue.SetNull(); + } + else + { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = static_cast>( + chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + } + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + 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; + BallastConfigurationCluster * 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, BallastConfigurationCluster, writeLampTypeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::BallastConfiguration::Attributes::LampType::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cleanupStrings.push_back(chip::Platform::MakeUnique(env, static_cast(value))); + cppValue = cleanupStrings.back()->charSpan(); + + 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; + BallastConfigurationCluster * 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, BallastConfigurationCluster, writeLampManufacturerAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::BallastConfiguration::Attributes::LampManufacturer::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cleanupStrings.push_back(chip::Platform::MakeUnique(env, static_cast(value))); + cppValue = cleanupStrings.back()->charSpan(); + + 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; + BallastConfigurationCluster * 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, BallastConfigurationCluster, writeLampRatedHoursAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::BallastConfiguration::Attributes::LampRatedHours::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + if (value == nullptr) + { + cppValue.SetNull(); + } + else + { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = static_cast>( + chip::JniReferences::GetInstance().LongToPrimitive(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; + BallastConfigurationCluster * 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, BallastConfigurationCluster, writeLampBurnHoursAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::BallastConfiguration::Attributes::LampBurnHours::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + if (value == nullptr) + { + cppValue.SetNull(); + } + else + { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = static_cast>( + chip::JniReferences::GetInstance().LongToPrimitive(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; + BallastConfigurationCluster * 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, BallastConfigurationCluster, writeLampAlarmModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::BallastConfiguration::Attributes::LampAlarmMode::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; + BallastConfigurationCluster * 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, BallastConfigurationCluster, writeLampBurnHoursTripPointAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::BallastConfiguration::Attributes::LampBurnHoursTripPoint::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + if (value == nullptr) + { + cppValue.SetNull(); + } + else + { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = static_cast>( + chip::JniReferences::GetInstance().LongToPrimitive(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; + BallastConfigurationCluster * 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, ContentLauncherCluster, writeSupportedStreamingProtocolsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index ba9dfaefd0fb23..de6775d3df51d3 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -2988,6 +2988,16 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::BallastConfiguration::Id: { + using namespace app::Clusters::BallastConfiguration; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::IlluminanceMeasurement::Id: { using namespace app::Clusters::IlluminanceMeasurement; switch (aPath.mEventId) diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 3048a83c7e358a..c9bbe64cc955f9 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -18556,6 +18556,555 @@ void CHIPColorControlAttributeListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPBallastConfigurationIntrinsicBalanceFactorAttributeCallback::CHIPBallastConfigurationIntrinsicBalanceFactorAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPBallastConfigurationIntrinsicBalanceFactorAttributeCallback::~CHIPBallastConfigurationIntrinsicBalanceFactorAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPBallastConfigurationIntrinsicBalanceFactorAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback::CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback:: + ~CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPBallastConfigurationLampRatedHoursAttributeCallback::CHIPBallastConfigurationLampRatedHoursAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPBallastConfigurationLampRatedHoursAttributeCallback::~CHIPBallastConfigurationLampRatedHoursAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPBallastConfigurationLampRatedHoursAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPBallastConfigurationLampBurnHoursAttributeCallback::CHIPBallastConfigurationLampBurnHoursAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPBallastConfigurationLampBurnHoursAttributeCallback::~CHIPBallastConfigurationLampBurnHoursAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPBallastConfigurationLampBurnHoursAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPBallastConfigurationLampBurnHoursTripPointAttributeCallback::CHIPBallastConfigurationLampBurnHoursTripPointAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPBallastConfigurationLampBurnHoursTripPointAttributeCallback::~CHIPBallastConfigurationLampBurnHoursTripPointAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPBallastConfigurationLampBurnHoursTripPointAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPBallastConfigurationGeneratedCommandListAttributeCallback::CHIPBallastConfigurationGeneratedCommandListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPBallastConfigurationGeneratedCommandListAttributeCallback::~CHIPBallastConfigurationGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPBallastConfigurationGeneratedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPBallastConfigurationAcceptedCommandListAttributeCallback::CHIPBallastConfigurationAcceptedCommandListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPBallastConfigurationAcceptedCommandListAttributeCallback::~CHIPBallastConfigurationAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPBallastConfigurationAcceptedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPBallastConfigurationAttributeListAttributeCallback::CHIPBallastConfigurationAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPBallastConfigurationAttributeListAttributeCallback::~CHIPBallastConfigurationAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPBallastConfigurationAttributeListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + CHIPIlluminanceMeasurementMeasuredValueAttributeCallback::CHIPIlluminanceMeasurementMeasuredValueAttributeCallback( jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.h b/src/controller/java/zap-generated/CHIPReadCallbacks.h index 9c05b560d1fd9b..ebce0164633adc 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -7735,6 +7735,246 @@ class CHIPColorControlAttributeListAttributeCallback bool keepAlive; }; +class CHIPBallastConfigurationIntrinsicBalanceFactorAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPBallastConfigurationIntrinsicBalanceFactorAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPBallastConfigurationIntrinsicBalanceFactorAttributeCallback(); + + static void maybeDestroy(CHIPBallastConfigurationIntrinsicBalanceFactorAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback(); + + static void maybeDestroy(CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPBallastConfigurationLampRatedHoursAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPBallastConfigurationLampRatedHoursAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPBallastConfigurationLampRatedHoursAttributeCallback(); + + static void maybeDestroy(CHIPBallastConfigurationLampRatedHoursAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPBallastConfigurationLampBurnHoursAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPBallastConfigurationLampBurnHoursAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPBallastConfigurationLampBurnHoursAttributeCallback(); + + static void maybeDestroy(CHIPBallastConfigurationLampBurnHoursAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPBallastConfigurationLampBurnHoursTripPointAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPBallastConfigurationLampBurnHoursTripPointAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPBallastConfigurationLampBurnHoursTripPointAttributeCallback(); + + static void maybeDestroy(CHIPBallastConfigurationLampBurnHoursTripPointAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPBallastConfigurationGeneratedCommandListAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPBallastConfigurationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPBallastConfigurationGeneratedCommandListAttributeCallback(); + + static void maybeDestroy(CHIPBallastConfigurationGeneratedCommandListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPBallastConfigurationAcceptedCommandListAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPBallastConfigurationAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPBallastConfigurationAcceptedCommandListAttributeCallback(); + + static void maybeDestroy(CHIPBallastConfigurationAcceptedCommandListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPBallastConfigurationAttributeListAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPBallastConfigurationAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPBallastConfigurationAttributeListAttributeCallback(); + + static void maybeDestroy(CHIPBallastConfigurationAttributeListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + class CHIPIlluminanceMeasurementMeasuredValueAttributeCallback : public chip::Callback::Callback { diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 33453cc8a4e5ec..fd4f7047d05ed6 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -17149,6 +17149,551 @@ private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } + public static class BallastConfigurationCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 769L; + + public BallastConfigurationCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public interface IntrinsicBalanceFactorAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface BallastFactorAdjustmentAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface LampRatedHoursAttributeCallback { + void onSuccess(@Nullable Long value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface LampBurnHoursAttributeCallback { + void onSuccess(@Nullable Long value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface LampBurnHoursTripPointAttributeCallback { + void onSuccess(@Nullable Long value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface GeneratedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface AcceptedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface AttributeListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public void readPhysicalMinLevelAttribute(IntegerAttributeCallback callback) { + readPhysicalMinLevelAttribute(chipClusterPtr, callback); + } + + public void subscribePhysicalMinLevelAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribePhysicalMinLevelAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readPhysicalMaxLevelAttribute(IntegerAttributeCallback callback) { + readPhysicalMaxLevelAttribute(chipClusterPtr, callback); + } + + public void subscribePhysicalMaxLevelAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribePhysicalMaxLevelAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readBallastStatusAttribute(IntegerAttributeCallback callback) { + readBallastStatusAttribute(chipClusterPtr, callback); + } + + public void subscribeBallastStatusAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeBallastStatusAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readMinLevelAttribute(IntegerAttributeCallback callback) { + readMinLevelAttribute(chipClusterPtr, callback); + } + + public void writeMinLevelAttribute(DefaultClusterCallback callback, Integer value) { + writeMinLevelAttribute(chipClusterPtr, callback, value, null); + } + + public void writeMinLevelAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeMinLevelAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeMinLevelAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeMinLevelAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readMaxLevelAttribute(IntegerAttributeCallback callback) { + readMaxLevelAttribute(chipClusterPtr, callback); + } + + public void writeMaxLevelAttribute(DefaultClusterCallback callback, Integer value) { + writeMaxLevelAttribute(chipClusterPtr, callback, value, null); + } + + public void writeMaxLevelAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeMaxLevelAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeMaxLevelAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeMaxLevelAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readIntrinsicBalanceFactorAttribute( + IntrinsicBalanceFactorAttributeCallback callback) { + readIntrinsicBalanceFactorAttribute(chipClusterPtr, callback); + } + + public void writeIntrinsicBalanceFactorAttribute( + DefaultClusterCallback callback, Integer value) { + writeIntrinsicBalanceFactorAttribute(chipClusterPtr, callback, value, null); + } + + public void writeIntrinsicBalanceFactorAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeIntrinsicBalanceFactorAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeIntrinsicBalanceFactorAttribute( + IntrinsicBalanceFactorAttributeCallback callback, int minInterval, int maxInterval) { + subscribeIntrinsicBalanceFactorAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readBallastFactorAdjustmentAttribute( + BallastFactorAdjustmentAttributeCallback callback) { + readBallastFactorAdjustmentAttribute(chipClusterPtr, callback); + } + + public void writeBallastFactorAdjustmentAttribute( + DefaultClusterCallback callback, Integer value) { + writeBallastFactorAdjustmentAttribute(chipClusterPtr, callback, value, null); + } + + public void writeBallastFactorAdjustmentAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeBallastFactorAdjustmentAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeBallastFactorAdjustmentAttribute( + BallastFactorAdjustmentAttributeCallback callback, int minInterval, int maxInterval) { + subscribeBallastFactorAdjustmentAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readLampQuantityAttribute(IntegerAttributeCallback callback) { + readLampQuantityAttribute(chipClusterPtr, callback); + } + + public void subscribeLampQuantityAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeLampQuantityAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readLampTypeAttribute(CharStringAttributeCallback callback) { + readLampTypeAttribute(chipClusterPtr, callback); + } + + public void writeLampTypeAttribute(DefaultClusterCallback callback, String value) { + writeLampTypeAttribute(chipClusterPtr, callback, value, null); + } + + public void writeLampTypeAttribute( + DefaultClusterCallback callback, String value, int timedWriteTimeoutMs) { + writeLampTypeAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeLampTypeAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeLampTypeAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readLampManufacturerAttribute(CharStringAttributeCallback callback) { + readLampManufacturerAttribute(chipClusterPtr, callback); + } + + public void writeLampManufacturerAttribute(DefaultClusterCallback callback, String value) { + writeLampManufacturerAttribute(chipClusterPtr, callback, value, null); + } + + public void writeLampManufacturerAttribute( + DefaultClusterCallback callback, String value, int timedWriteTimeoutMs) { + writeLampManufacturerAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeLampManufacturerAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeLampManufacturerAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readLampRatedHoursAttribute(LampRatedHoursAttributeCallback callback) { + readLampRatedHoursAttribute(chipClusterPtr, callback); + } + + public void writeLampRatedHoursAttribute(DefaultClusterCallback callback, Long value) { + writeLampRatedHoursAttribute(chipClusterPtr, callback, value, null); + } + + public void writeLampRatedHoursAttribute( + DefaultClusterCallback callback, Long value, int timedWriteTimeoutMs) { + writeLampRatedHoursAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeLampRatedHoursAttribute( + LampRatedHoursAttributeCallback callback, int minInterval, int maxInterval) { + subscribeLampRatedHoursAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readLampBurnHoursAttribute(LampBurnHoursAttributeCallback callback) { + readLampBurnHoursAttribute(chipClusterPtr, callback); + } + + public void writeLampBurnHoursAttribute(DefaultClusterCallback callback, Long value) { + writeLampBurnHoursAttribute(chipClusterPtr, callback, value, null); + } + + public void writeLampBurnHoursAttribute( + DefaultClusterCallback callback, Long value, int timedWriteTimeoutMs) { + writeLampBurnHoursAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeLampBurnHoursAttribute( + LampBurnHoursAttributeCallback callback, int minInterval, int maxInterval) { + subscribeLampBurnHoursAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readLampAlarmModeAttribute(IntegerAttributeCallback callback) { + readLampAlarmModeAttribute(chipClusterPtr, callback); + } + + public void writeLampAlarmModeAttribute(DefaultClusterCallback callback, Integer value) { + writeLampAlarmModeAttribute(chipClusterPtr, callback, value, null); + } + + public void writeLampAlarmModeAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeLampAlarmModeAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeLampAlarmModeAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeLampAlarmModeAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readLampBurnHoursTripPointAttribute( + LampBurnHoursTripPointAttributeCallback callback) { + readLampBurnHoursTripPointAttribute(chipClusterPtr, callback); + } + + public void writeLampBurnHoursTripPointAttribute(DefaultClusterCallback callback, Long value) { + writeLampBurnHoursTripPointAttribute(chipClusterPtr, callback, value, null); + } + + public void writeLampBurnHoursTripPointAttribute( + DefaultClusterCallback callback, Long value, int timedWriteTimeoutMs) { + writeLampBurnHoursTripPointAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeLampBurnHoursTripPointAttribute( + LampBurnHoursTripPointAttributeCallback callback, int minInterval, int maxInterval) { + subscribeLampBurnHoursTripPointAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAttributeListAttribute(AttributeListAttributeCallback callback) { + readAttributeListAttribute(chipClusterPtr, callback); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFeatureMapAttribute(LongAttributeCallback callback) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readPhysicalMinLevelAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribePhysicalMinLevelAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readPhysicalMaxLevelAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribePhysicalMaxLevelAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readBallastStatusAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeBallastStatusAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readMinLevelAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeMinLevelAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeMinLevelAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readMaxLevelAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeMaxLevelAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeMaxLevelAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readIntrinsicBalanceFactorAttribute( + long chipClusterPtr, IntrinsicBalanceFactorAttributeCallback callback); + + private native void writeIntrinsicBalanceFactorAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeIntrinsicBalanceFactorAttribute( + long chipClusterPtr, + IntrinsicBalanceFactorAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readBallastFactorAdjustmentAttribute( + long chipClusterPtr, BallastFactorAdjustmentAttributeCallback callback); + + private native void writeBallastFactorAdjustmentAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeBallastFactorAdjustmentAttribute( + long chipClusterPtr, + BallastFactorAdjustmentAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readLampQuantityAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeLampQuantityAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readLampTypeAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void writeLampTypeAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + String value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeLampTypeAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readLampManufacturerAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void writeLampManufacturerAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + String value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeLampManufacturerAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readLampRatedHoursAttribute( + long chipClusterPtr, LampRatedHoursAttributeCallback callback); + + private native void writeLampRatedHoursAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Long value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeLampRatedHoursAttribute( + long chipClusterPtr, + LampRatedHoursAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readLampBurnHoursAttribute( + long chipClusterPtr, LampBurnHoursAttributeCallback callback); + + private native void writeLampBurnHoursAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Long value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeLampBurnHoursAttribute( + long chipClusterPtr, + LampBurnHoursAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readLampAlarmModeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeLampAlarmModeAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeLampAlarmModeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readLampBurnHoursTripPointAttribute( + long chipClusterPtr, LampBurnHoursTripPointAttributeCallback callback); + + private native void writeLampBurnHoursTripPointAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Long value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeLampBurnHoursTripPointAttribute( + long chipClusterPtr, + LampBurnHoursTripPointAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readGeneratedCommandListAttribute( + long chipClusterPtr, GeneratedCommandListAttributeCallback callback); + + private native void subscribeGeneratedCommandListAttribute( + long chipClusterPtr, + GeneratedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readAcceptedCommandListAttribute( + long chipClusterPtr, AcceptedCommandListAttributeCallback callback); + + private native void subscribeAcceptedCommandListAttribute( + long chipClusterPtr, + AcceptedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readAttributeListAttribute( + long chipClusterPtr, AttributeListAttributeCallback callback); + + private native void subscribeAttributeListAttribute( + long chipClusterPtr, + AttributeListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + } + public static class IlluminanceMeasurementCluster extends BaseChipCluster { public static final long CLUSTER_ID = 1024L; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java index 702b0e30941cd5..aebfd42cdb56f9 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java @@ -157,6 +157,9 @@ public static String clusterIdToName(long clusterId) { if (clusterId == 768L) { return "ColorControl"; } + if (clusterId == 769L) { + return "BallastConfiguration"; + } if (clusterId == 1024L) { return "IlluminanceMeasurement"; } @@ -2226,6 +2229,66 @@ public static String attributeIdToName(long clusterId, long attributeId) { } return ""; } + if (clusterId == 769L) { + if (attributeId == 0L) { + return "PhysicalMinLevel"; + } + if (attributeId == 1L) { + return "PhysicalMaxLevel"; + } + if (attributeId == 2L) { + return "BallastStatus"; + } + if (attributeId == 16L) { + return "MinLevel"; + } + if (attributeId == 17L) { + return "MaxLevel"; + } + if (attributeId == 20L) { + return "IntrinsicBalanceFactor"; + } + if (attributeId == 21L) { + return "BallastFactorAdjustment"; + } + if (attributeId == 32L) { + return "LampQuantity"; + } + if (attributeId == 48L) { + return "LampType"; + } + if (attributeId == 49L) { + return "LampManufacturer"; + } + if (attributeId == 50L) { + return "LampRatedHours"; + } + if (attributeId == 51L) { + return "LampBurnHours"; + } + if (attributeId == 52L) { + return "LampAlarmMode"; + } + if (attributeId == 53L) { + return "LampBurnHoursTripPoint"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } if (clusterId == 1024L) { if (attributeId == 0L) { return "MeasuredValue"; @@ -3326,6 +3389,9 @@ public static String eventIdToName(long clusterId, long eventId) { if (clusterId == 768L) { return ""; } + if (clusterId == 769L) { + return ""; + } if (clusterId == 1024L) { return ""; } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index 4c98bba511db70..7c587859ab2e0f 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -4997,6 +4997,78 @@ public void onError(Exception ex) { } } + public static class DelegatedBallastConfigurationClusterGeneratedCommandListAttributeCallback + implements ChipClusters.BallastConfigurationCluster.GeneratedCommandListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedBallastConfigurationClusterAcceptedCommandListAttributeCallback + implements ChipClusters.BallastConfigurationCluster.AcceptedCommandListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedBallastConfigurationClusterAttributeListAttributeCallback + implements ChipClusters.BallastConfigurationCluster.AttributeListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedIlluminanceMeasurementClusterGeneratedCommandListAttributeCallback implements ChipClusters.IlluminanceMeasurementCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { @@ -7296,6 +7368,11 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.ColorControlCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("colorControl", colorControlClusterInfo); + ClusterInfo ballastConfigurationClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.BallastConfigurationCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("ballastConfiguration", ballastConfigurationClusterInfo); ClusterInfo illuminanceMeasurementClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.IlluminanceMeasurementCluster(ptr, endpointId), @@ -7465,6 +7542,7 @@ public void combineCommand( .get("thermostatUserInterfaceConfiguration") .combineCommands(source.get("thermostatUserInterfaceConfiguration")); destination.get("colorControl").combineCommands(source.get("colorControl")); + destination.get("ballastConfiguration").combineCommands(source.get("ballastConfiguration")); destination.get("illuminanceMeasurement").combineCommands(source.get("illuminanceMeasurement")); destination.get("temperatureMeasurement").combineCommands(source.get("temperatureMeasurement")); destination.get("pressureMeasurement").combineCommands(source.get("pressureMeasurement")); @@ -11005,6 +11083,9 @@ public Map> getCommandMap() { colorControlClusterInteractionInfoMap.put( "stepColorTemperature", colorControlstepColorTemperatureInteractionInfo); commandMap.put("colorControl", colorControlClusterInteractionInfoMap); + Map ballastConfigurationClusterInteractionInfoMap = + new LinkedHashMap<>(); + commandMap.put("ballastConfiguration", ballastConfigurationClusterInteractionInfoMap); Map illuminanceMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("illuminanceMeasurement", illuminanceMeasurementClusterInteractionInfoMap); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java index 78e10642d375c0..6ad1a6f0886652 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java @@ -8782,6 +8782,278 @@ public Map> getReadAttributeMap() { readColorControlInteractionInfo.put( "readClusterRevisionAttribute", readColorControlClusterRevisionAttributeInteractionInfo); readAttributeMap.put("colorControl", readColorControlInteractionInfo); + Map readBallastConfigurationInteractionInfo = new LinkedHashMap<>(); + Map readBallastConfigurationPhysicalMinLevelCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationPhysicalMinLevelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readPhysicalMinLevelAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBallastConfigurationPhysicalMinLevelCommandParams); + readBallastConfigurationInteractionInfo.put( + "readPhysicalMinLevelAttribute", + readBallastConfigurationPhysicalMinLevelAttributeInteractionInfo); + Map readBallastConfigurationPhysicalMaxLevelCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationPhysicalMaxLevelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readPhysicalMaxLevelAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBallastConfigurationPhysicalMaxLevelCommandParams); + readBallastConfigurationInteractionInfo.put( + "readPhysicalMaxLevelAttribute", + readBallastConfigurationPhysicalMaxLevelAttributeInteractionInfo); + Map readBallastConfigurationBallastStatusCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationBallastStatusAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readBallastStatusAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBallastConfigurationBallastStatusCommandParams); + readBallastConfigurationInteractionInfo.put( + "readBallastStatusAttribute", + readBallastConfigurationBallastStatusAttributeInteractionInfo); + Map readBallastConfigurationMinLevelCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationMinLevelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readMinLevelAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBallastConfigurationMinLevelCommandParams); + readBallastConfigurationInteractionInfo.put( + "readMinLevelAttribute", readBallastConfigurationMinLevelAttributeInteractionInfo); + Map readBallastConfigurationMaxLevelCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationMaxLevelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readMaxLevelAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBallastConfigurationMaxLevelCommandParams); + readBallastConfigurationInteractionInfo.put( + "readMaxLevelAttribute", readBallastConfigurationMaxLevelAttributeInteractionInfo); + Map readBallastConfigurationIntrinsicBalanceFactorCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationIntrinsicBalanceFactorAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readIntrinsicBalanceFactorAttribute( + (ChipClusters.BallastConfigurationCluster + .IntrinsicBalanceFactorAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBallastConfigurationIntrinsicBalanceFactorCommandParams); + readBallastConfigurationInteractionInfo.put( + "readIntrinsicBalanceFactorAttribute", + readBallastConfigurationIntrinsicBalanceFactorAttributeInteractionInfo); + Map readBallastConfigurationBallastFactorAdjustmentCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationBallastFactorAdjustmentAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readBallastFactorAdjustmentAttribute( + (ChipClusters.BallastConfigurationCluster + .BallastFactorAdjustmentAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBallastConfigurationBallastFactorAdjustmentCommandParams); + readBallastConfigurationInteractionInfo.put( + "readBallastFactorAdjustmentAttribute", + readBallastConfigurationBallastFactorAdjustmentAttributeInteractionInfo); + Map readBallastConfigurationLampQuantityCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationLampQuantityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readLampQuantityAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBallastConfigurationLampQuantityCommandParams); + readBallastConfigurationInteractionInfo.put( + "readLampQuantityAttribute", readBallastConfigurationLampQuantityAttributeInteractionInfo); + Map readBallastConfigurationLampTypeCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationLampTypeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readLampTypeAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBallastConfigurationLampTypeCommandParams); + readBallastConfigurationInteractionInfo.put( + "readLampTypeAttribute", readBallastConfigurationLampTypeAttributeInteractionInfo); + Map readBallastConfigurationLampManufacturerCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationLampManufacturerAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readLampManufacturerAttribute( + (ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBallastConfigurationLampManufacturerCommandParams); + readBallastConfigurationInteractionInfo.put( + "readLampManufacturerAttribute", + readBallastConfigurationLampManufacturerAttributeInteractionInfo); + Map readBallastConfigurationLampRatedHoursCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationLampRatedHoursAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readLampRatedHoursAttribute( + (ChipClusters.BallastConfigurationCluster.LampRatedHoursAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readBallastConfigurationLampRatedHoursCommandParams); + readBallastConfigurationInteractionInfo.put( + "readLampRatedHoursAttribute", + readBallastConfigurationLampRatedHoursAttributeInteractionInfo); + Map readBallastConfigurationLampBurnHoursCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationLampBurnHoursAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readLampBurnHoursAttribute( + (ChipClusters.BallastConfigurationCluster.LampBurnHoursAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readBallastConfigurationLampBurnHoursCommandParams); + readBallastConfigurationInteractionInfo.put( + "readLampBurnHoursAttribute", + readBallastConfigurationLampBurnHoursAttributeInteractionInfo); + Map readBallastConfigurationLampAlarmModeCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationLampAlarmModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readLampAlarmModeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBallastConfigurationLampAlarmModeCommandParams); + readBallastConfigurationInteractionInfo.put( + "readLampAlarmModeAttribute", + readBallastConfigurationLampAlarmModeAttributeInteractionInfo); + Map readBallastConfigurationLampBurnHoursTripPointCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationLampBurnHoursTripPointAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readLampBurnHoursTripPointAttribute( + (ChipClusters.BallastConfigurationCluster + .LampBurnHoursTripPointAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readBallastConfigurationLampBurnHoursTripPointCommandParams); + readBallastConfigurationInteractionInfo.put( + "readLampBurnHoursTripPointAttribute", + readBallastConfigurationLampBurnHoursTripPointAttributeInteractionInfo); + Map readBallastConfigurationGeneratedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationGeneratedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readGeneratedCommandListAttribute( + (ChipClusters.BallastConfigurationCluster + .GeneratedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedBallastConfigurationClusterGeneratedCommandListAttributeCallback(), + readBallastConfigurationGeneratedCommandListCommandParams); + readBallastConfigurationInteractionInfo.put( + "readGeneratedCommandListAttribute", + readBallastConfigurationGeneratedCommandListAttributeInteractionInfo); + Map readBallastConfigurationAcceptedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationAcceptedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readAcceptedCommandListAttribute( + (ChipClusters.BallastConfigurationCluster + .AcceptedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedBallastConfigurationClusterAcceptedCommandListAttributeCallback(), + readBallastConfigurationAcceptedCommandListCommandParams); + readBallastConfigurationInteractionInfo.put( + "readAcceptedCommandListAttribute", + readBallastConfigurationAcceptedCommandListAttributeInteractionInfo); + Map readBallastConfigurationAttributeListCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationAttributeListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readAttributeListAttribute( + (ChipClusters.BallastConfigurationCluster.AttributeListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedBallastConfigurationClusterAttributeListAttributeCallback(), + readBallastConfigurationAttributeListCommandParams); + readBallastConfigurationInteractionInfo.put( + "readAttributeListAttribute", + readBallastConfigurationAttributeListAttributeInteractionInfo); + Map readBallastConfigurationFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readBallastConfigurationFeatureMapCommandParams); + readBallastConfigurationInteractionInfo.put( + "readFeatureMapAttribute", readBallastConfigurationFeatureMapAttributeInteractionInfo); + Map readBallastConfigurationClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBallastConfigurationClusterRevisionCommandParams); + readBallastConfigurationInteractionInfo.put( + "readClusterRevisionAttribute", + readBallastConfigurationClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("ballastConfiguration", readBallastConfigurationInteractionInfo); Map readIlluminanceMeasurementInteractionInfo = new LinkedHashMap<>(); Map readIlluminanceMeasurementMeasuredValueCommandParams = new LinkedHashMap(); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java index 36d9b225034c92..1d69c6981408e2 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java @@ -1367,6 +1367,186 @@ public Map> getWriteAttributeMap() { "writeStartUpColorTemperatureMiredsAttribute", writeColorControlStartUpColorTemperatureMiredsAttributeInteractionInfo); writeAttributeMap.put("colorControl", writeColorControlInteractionInfo); + Map writeBallastConfigurationInteractionInfo = new LinkedHashMap<>(); + Map writeBallastConfigurationMinLevelCommandParams = + new LinkedHashMap(); + CommandParameterInfo ballastConfigurationminLevelCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeBallastConfigurationMinLevelCommandParams.put( + "value", ballastConfigurationminLevelCommandParameterInfo); + InteractionInfo writeBallastConfigurationMinLevelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .writeMinLevelAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBallastConfigurationMinLevelCommandParams); + writeBallastConfigurationInteractionInfo.put( + "writeMinLevelAttribute", writeBallastConfigurationMinLevelAttributeInteractionInfo); + Map writeBallastConfigurationMaxLevelCommandParams = + new LinkedHashMap(); + CommandParameterInfo ballastConfigurationmaxLevelCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeBallastConfigurationMaxLevelCommandParams.put( + "value", ballastConfigurationmaxLevelCommandParameterInfo); + InteractionInfo writeBallastConfigurationMaxLevelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .writeMaxLevelAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBallastConfigurationMaxLevelCommandParams); + writeBallastConfigurationInteractionInfo.put( + "writeMaxLevelAttribute", writeBallastConfigurationMaxLevelAttributeInteractionInfo); + Map writeBallastConfigurationIntrinsicBalanceFactorCommandParams = + new LinkedHashMap(); + CommandParameterInfo ballastConfigurationintrinsicBalanceFactorCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeBallastConfigurationIntrinsicBalanceFactorCommandParams.put( + "value", ballastConfigurationintrinsicBalanceFactorCommandParameterInfo); + InteractionInfo writeBallastConfigurationIntrinsicBalanceFactorAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .writeIntrinsicBalanceFactorAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBallastConfigurationIntrinsicBalanceFactorCommandParams); + writeBallastConfigurationInteractionInfo.put( + "writeIntrinsicBalanceFactorAttribute", + writeBallastConfigurationIntrinsicBalanceFactorAttributeInteractionInfo); + Map + writeBallastConfigurationBallastFactorAdjustmentCommandParams = + new LinkedHashMap(); + CommandParameterInfo ballastConfigurationballastFactorAdjustmentCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeBallastConfigurationBallastFactorAdjustmentCommandParams.put( + "value", ballastConfigurationballastFactorAdjustmentCommandParameterInfo); + InteractionInfo writeBallastConfigurationBallastFactorAdjustmentAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .writeBallastFactorAdjustmentAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBallastConfigurationBallastFactorAdjustmentCommandParams); + writeBallastConfigurationInteractionInfo.put( + "writeBallastFactorAdjustmentAttribute", + writeBallastConfigurationBallastFactorAdjustmentAttributeInteractionInfo); + Map writeBallastConfigurationLampTypeCommandParams = + new LinkedHashMap(); + CommandParameterInfo ballastConfigurationlampTypeCommandParameterInfo = + new CommandParameterInfo("value", String.class, String.class); + writeBallastConfigurationLampTypeCommandParams.put( + "value", ballastConfigurationlampTypeCommandParameterInfo); + InteractionInfo writeBallastConfigurationLampTypeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .writeLampTypeAttribute( + (DefaultClusterCallback) callback, (String) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBallastConfigurationLampTypeCommandParams); + writeBallastConfigurationInteractionInfo.put( + "writeLampTypeAttribute", writeBallastConfigurationLampTypeAttributeInteractionInfo); + Map writeBallastConfigurationLampManufacturerCommandParams = + new LinkedHashMap(); + CommandParameterInfo ballastConfigurationlampManufacturerCommandParameterInfo = + new CommandParameterInfo("value", String.class, String.class); + writeBallastConfigurationLampManufacturerCommandParams.put( + "value", ballastConfigurationlampManufacturerCommandParameterInfo); + InteractionInfo writeBallastConfigurationLampManufacturerAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .writeLampManufacturerAttribute( + (DefaultClusterCallback) callback, (String) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBallastConfigurationLampManufacturerCommandParams); + writeBallastConfigurationInteractionInfo.put( + "writeLampManufacturerAttribute", + writeBallastConfigurationLampManufacturerAttributeInteractionInfo); + Map writeBallastConfigurationLampRatedHoursCommandParams = + new LinkedHashMap(); + CommandParameterInfo ballastConfigurationlampRatedHoursCommandParameterInfo = + new CommandParameterInfo("value", Long.class, Long.class); + writeBallastConfigurationLampRatedHoursCommandParams.put( + "value", ballastConfigurationlampRatedHoursCommandParameterInfo); + InteractionInfo writeBallastConfigurationLampRatedHoursAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .writeLampRatedHoursAttribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBallastConfigurationLampRatedHoursCommandParams); + writeBallastConfigurationInteractionInfo.put( + "writeLampRatedHoursAttribute", + writeBallastConfigurationLampRatedHoursAttributeInteractionInfo); + Map writeBallastConfigurationLampBurnHoursCommandParams = + new LinkedHashMap(); + CommandParameterInfo ballastConfigurationlampBurnHoursCommandParameterInfo = + new CommandParameterInfo("value", Long.class, Long.class); + writeBallastConfigurationLampBurnHoursCommandParams.put( + "value", ballastConfigurationlampBurnHoursCommandParameterInfo); + InteractionInfo writeBallastConfigurationLampBurnHoursAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .writeLampBurnHoursAttribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBallastConfigurationLampBurnHoursCommandParams); + writeBallastConfigurationInteractionInfo.put( + "writeLampBurnHoursAttribute", + writeBallastConfigurationLampBurnHoursAttributeInteractionInfo); + Map writeBallastConfigurationLampAlarmModeCommandParams = + new LinkedHashMap(); + CommandParameterInfo ballastConfigurationlampAlarmModeCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeBallastConfigurationLampAlarmModeCommandParams.put( + "value", ballastConfigurationlampAlarmModeCommandParameterInfo); + InteractionInfo writeBallastConfigurationLampAlarmModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .writeLampAlarmModeAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBallastConfigurationLampAlarmModeCommandParams); + writeBallastConfigurationInteractionInfo.put( + "writeLampAlarmModeAttribute", + writeBallastConfigurationLampAlarmModeAttributeInteractionInfo); + Map writeBallastConfigurationLampBurnHoursTripPointCommandParams = + new LinkedHashMap(); + CommandParameterInfo ballastConfigurationlampBurnHoursTripPointCommandParameterInfo = + new CommandParameterInfo("value", Long.class, Long.class); + writeBallastConfigurationLampBurnHoursTripPointCommandParams.put( + "value", ballastConfigurationlampBurnHoursTripPointCommandParameterInfo); + InteractionInfo writeBallastConfigurationLampBurnHoursTripPointAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .writeLampBurnHoursTripPointAttribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBallastConfigurationLampBurnHoursTripPointCommandParams); + writeBallastConfigurationInteractionInfo.put( + "writeLampBurnHoursTripPointAttribute", + writeBallastConfigurationLampBurnHoursTripPointAttributeInteractionInfo); + writeAttributeMap.put("ballastConfiguration", writeBallastConfigurationInteractionInfo); Map writeIlluminanceMeasurementInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("illuminanceMeasurement", writeIlluminanceMeasurementInteractionInfo); Map writeTemperatureMeasurementInteractionInfo = new LinkedHashMap<>(); diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 03955431e9c1d9..b729e83bbc1284 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -5260,6 +5260,138 @@ class ChipClusters: }, }, } + _BALLAST_CONFIGURATION_CLUSTER_INFO = { + "clusterName": "BallastConfiguration", + "clusterId": 0x00000301, + "commands": { + }, + "attributes": { + 0x00000000: { + "attributeName": "PhysicalMinLevel", + "attributeId": 0x00000000, + "type": "int", + "reportable": True, + }, + 0x00000001: { + "attributeName": "PhysicalMaxLevel", + "attributeId": 0x00000001, + "type": "int", + "reportable": True, + }, + 0x00000002: { + "attributeName": "BallastStatus", + "attributeId": 0x00000002, + "type": "int", + "reportable": True, + }, + 0x00000010: { + "attributeName": "MinLevel", + "attributeId": 0x00000010, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000011: { + "attributeName": "MaxLevel", + "attributeId": 0x00000011, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000014: { + "attributeName": "IntrinsicBalanceFactor", + "attributeId": 0x00000014, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000015: { + "attributeName": "BallastFactorAdjustment", + "attributeId": 0x00000015, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000020: { + "attributeName": "LampQuantity", + "attributeId": 0x00000020, + "type": "int", + "reportable": True, + }, + 0x00000030: { + "attributeName": "LampType", + "attributeId": 0x00000030, + "type": "str", + "reportable": True, + "writable": True, + }, + 0x00000031: { + "attributeName": "LampManufacturer", + "attributeId": 0x00000031, + "type": "str", + "reportable": True, + "writable": True, + }, + 0x00000032: { + "attributeName": "LampRatedHours", + "attributeId": 0x00000032, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000033: { + "attributeName": "LampBurnHours", + "attributeId": 0x00000033, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000034: { + "attributeName": "LampAlarmMode", + "attributeId": 0x00000034, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000035: { + "attributeName": "LampBurnHoursTripPoint", + "attributeId": 0x00000035, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } _ILLUMINANCE_MEASUREMENT_CLUSTER_INFO = { "clusterName": "IlluminanceMeasurement", "clusterId": 0x00000400, @@ -7408,6 +7540,7 @@ class ChipClusters: 0x00000202: _FAN_CONTROL_CLUSTER_INFO, 0x00000204: _THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER_INFO, 0x00000300: _COLOR_CONTROL_CLUSTER_INFO, + 0x00000301: _BALLAST_CONFIGURATION_CLUSTER_INFO, 0x00000400: _ILLUMINANCE_MEASUREMENT_CLUSTER_INFO, 0x00000402: _TEMPERATURE_MEASUREMENT_CLUSTER_INFO, 0x00000403: _PRESSURE_MEASUREMENT_CLUSTER_INFO, @@ -7475,6 +7608,7 @@ class ChipClusters: "FanControl": _FAN_CONTROL_CLUSTER_INFO, "ThermostatUserInterfaceConfiguration": _THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER_INFO, "ColorControl": _COLOR_CONTROL_CLUSTER_INFO, + "BallastConfiguration": _BALLAST_CONFIGURATION_CLUSTER_INFO, "IlluminanceMeasurement": _ILLUMINANCE_MEASUREMENT_CLUSTER_INFO, "TemperatureMeasurement": _TEMPERATURE_MEASUREMENT_CLUSTER_INFO, "PressureMeasurement": _PRESSURE_MEASUREMENT_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 69db97507766af..d2a7397f0e7262 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -22910,22 +22910,20 @@ class BallastConfiguration(Cluster): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="physicalMinLevel", Tag=0x00000000, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="physicalMaxLevel", Tag=0x00000001, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="ballastStatus", Tag=0x00000002, Type=uint), - ClusterObjectFieldDescriptor(Label="minLevel", Tag=0x00000010, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="maxLevel", Tag=0x00000011, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="powerOnLevel", Tag=0x00000012, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="powerOnFadeTime", Tag=0x00000013, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="intrinsicBallastFactor", Tag=0x00000014, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="ballastFactorAdjustment", Tag=0x00000015, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="lampQuality", Tag=0x00000020, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="physicalMinLevel", Tag=0x00000000, Type=uint), + ClusterObjectFieldDescriptor(Label="physicalMaxLevel", Tag=0x00000001, Type=uint), + ClusterObjectFieldDescriptor(Label="ballastStatus", Tag=0x00000002, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="minLevel", Tag=0x00000010, Type=uint), + ClusterObjectFieldDescriptor(Label="maxLevel", Tag=0x00000011, Type=uint), + ClusterObjectFieldDescriptor(Label="intrinsicBalanceFactor", Tag=0x00000014, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="ballastFactorAdjustment", Tag=0x00000015, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="lampQuantity", Tag=0x00000020, Type=uint), ClusterObjectFieldDescriptor(Label="lampType", Tag=0x00000030, Type=typing.Optional[str]), ClusterObjectFieldDescriptor(Label="lampManufacturer", Tag=0x00000031, Type=typing.Optional[str]), - ClusterObjectFieldDescriptor(Label="lampRatedHours", Tag=0x00000032, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="lampBurnHours", Tag=0x00000033, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="lampRatedHours", Tag=0x00000032, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="lampBurnHours", Tag=0x00000033, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="lampAlarmMode", Tag=0x00000034, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="lampBurnHoursTripPoint", Tag=0x00000035, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="lampBurnHoursTripPoint", Tag=0x00000035, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), @@ -22933,22 +22931,20 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - physicalMinLevel: 'typing.Optional[uint]' = None - physicalMaxLevel: 'typing.Optional[uint]' = None - ballastStatus: 'uint' = None - minLevel: 'typing.Optional[uint]' = None - maxLevel: 'typing.Optional[uint]' = None - powerOnLevel: 'typing.Optional[uint]' = None - powerOnFadeTime: 'typing.Optional[uint]' = None - intrinsicBallastFactor: 'typing.Optional[uint]' = None - ballastFactorAdjustment: 'typing.Optional[uint]' = None - lampQuality: 'typing.Optional[uint]' = None + physicalMinLevel: 'uint' = None + physicalMaxLevel: 'uint' = None + ballastStatus: 'typing.Optional[uint]' = None + minLevel: 'uint' = None + maxLevel: 'uint' = None + intrinsicBalanceFactor: 'typing.Union[None, Nullable, uint]' = None + ballastFactorAdjustment: 'typing.Union[None, Nullable, uint]' = None + lampQuantity: 'uint' = None lampType: 'typing.Optional[str]' = None lampManufacturer: 'typing.Optional[str]' = None - lampRatedHours: 'typing.Optional[uint]' = None - lampBurnHours: 'typing.Optional[uint]' = None + lampRatedHours: 'typing.Union[None, Nullable, uint]' = None + lampBurnHours: 'typing.Union[None, Nullable, uint]' = None lampAlarmMode: 'typing.Optional[uint]' = None - lampBurnHoursTripPoint: 'typing.Optional[uint]' = None + lampBurnHoursTripPoint: 'typing.Union[None, Nullable, uint]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None attributeList: 'typing.List[uint]' = None @@ -22971,9 +22967,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=uint) - value: 'typing.Optional[uint]' = None + value: 'uint' = 0 @dataclass class PhysicalMaxLevel(ClusterAttributeDescriptor): @@ -22987,9 +22983,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=uint) - value: 'typing.Optional[uint]' = None + value: 'uint' = 0 @dataclass class BallastStatus(ClusterAttributeDescriptor): @@ -23003,9 +22999,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - value: 'uint' = 0 + value: 'typing.Optional[uint]' = None @dataclass class MinLevel(ClusterAttributeDescriptor): @@ -23019,9 +23015,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=uint) - value: 'typing.Optional[uint]' = None + value: 'uint' = 0 @dataclass class MaxLevel(ClusterAttributeDescriptor): @@ -23035,44 +23031,12 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class PowerOnLevel(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0301 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000012 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class PowerOnFadeTime(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0301 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000013 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=uint) - value: 'typing.Optional[uint]' = None + value: 'uint' = 0 @dataclass - class IntrinsicBallastFactor(ClusterAttributeDescriptor): + class IntrinsicBalanceFactor(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x0301 @@ -23083,9 +23047,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - value: 'typing.Optional[uint]' = None + value: 'typing.Union[None, Nullable, uint]' = None @dataclass class BallastFactorAdjustment(ClusterAttributeDescriptor): @@ -23099,12 +23063,12 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - value: 'typing.Optional[uint]' = None + value: 'typing.Union[None, Nullable, uint]' = None @dataclass - class LampQuality(ClusterAttributeDescriptor): + class LampQuantity(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x0301 @@ -23115,9 +23079,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=uint) - value: 'typing.Optional[uint]' = None + value: 'uint' = 0 @dataclass class LampType(ClusterAttributeDescriptor): @@ -23163,9 +23127,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - value: 'typing.Optional[uint]' = None + value: 'typing.Union[None, Nullable, uint]' = None @dataclass class LampBurnHours(ClusterAttributeDescriptor): @@ -23179,9 +23143,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - value: 'typing.Optional[uint]' = None + value: 'typing.Union[None, Nullable, uint]' = None @dataclass class LampAlarmMode(ClusterAttributeDescriptor): @@ -23211,9 +23175,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - value: 'typing.Optional[uint]' = None + value: 'typing.Union[None, Nullable, uint]' = None @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 254177c4f9335a..4b61ec50ed0351 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -11221,6 +11221,289 @@ id MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader & } break; } + case Clusters::BallastConfiguration::Id: { + using namespace Clusters::BallastConfiguration; + switch (aPath.mAttributeId) { + case Attributes::PhysicalMinLevel::Id: { + using TypeInfo = Attributes::PhysicalMinLevel::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::PhysicalMaxLevel::Id: { + using TypeInfo = Attributes::PhysicalMaxLevel::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::BallastStatus::Id: { + using TypeInfo = Attributes::BallastStatus::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::MinLevel::Id: { + using TypeInfo = Attributes::MinLevel::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::MaxLevel::Id: { + using TypeInfo = Attributes::MaxLevel::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::IntrinsicBalanceFactor::Id: { + using TypeInfo = Attributes::IntrinsicBalanceFactor::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } + return value; + } + case Attributes::BallastFactorAdjustment::Id: { + using TypeInfo = Attributes::BallastFactorAdjustment::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } + return value; + } + case Attributes::LampQuantity::Id: { + using TypeInfo = Attributes::LampQuantity::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::LampType::Id: { + using TypeInfo = Attributes::LampType::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nonnull value; + value = [[NSString alloc] initWithBytes:cppValue.data() length:cppValue.size() encoding:NSUTF8StringEncoding]; + return value; + } + case Attributes::LampManufacturer::Id: { + using TypeInfo = Attributes::LampManufacturer::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nonnull value; + value = [[NSString alloc] initWithBytes:cppValue.data() length:cppValue.size() encoding:NSUTF8StringEncoding]; + return value; + } + case Attributes::LampRatedHours::Id: { + using TypeInfo = Attributes::LampRatedHours::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } + return value; + } + case Attributes::LampBurnHours::Id: { + using TypeInfo = Attributes::LampBurnHours::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } + return value; + } + case Attributes::LampAlarmMode::Id: { + using TypeInfo = Attributes::LampAlarmMode::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::LampBurnHoursTripPoint::Id: { + using TypeInfo = Attributes::LampBurnHoursTripPoint::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } case Clusters::IlluminanceMeasurement::Id: { using namespace Clusters::IlluminanceMeasurement; switch (aPath.mAttributeId) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 4cd2c989751edb..467e4eb284e3d0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -13917,6 +13917,404 @@ NS_ASSUME_NONNULL_BEGIN @end +/** + * Cluster Ballast Configuration + * + */ +@interface MTRBaseClusterBallastConfiguration : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)readAttributePhysicalMinLevelWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributePhysicalMinLevelWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributePhysicalMinLevelWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributePhysicalMaxLevelWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributePhysicalMaxLevelWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributePhysicalMaxLevelWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeBallastStatusWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeBallastStatusWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeBallastStatusWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeMinLevelWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)writeAttributeMinLevelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeMinLevelWithValue:(NSNumber * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeMinLevelWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeMinLevelWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeMaxLevelWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)writeAttributeMaxLevelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeMaxLevelWithValue:(NSNumber * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeMaxLevelWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeMaxLevelWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeIntrinsicBalanceFactorWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)writeAttributeIntrinsicBalanceFactorWithValue:(NSNumber * _Nullable)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeIntrinsicBalanceFactorWithValue:(NSNumber * _Nullable)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeIntrinsicBalanceFactorWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler; ++ (void)readAttributeIntrinsicBalanceFactorWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeBallastFactorAdjustmentWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)writeAttributeBallastFactorAdjustmentWithValue:(NSNumber * _Nullable)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeBallastFactorAdjustmentWithValue:(NSNumber * _Nullable)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeBallastFactorAdjustmentWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler; ++ (void)readAttributeBallastFactorAdjustmentWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeLampQuantityWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeLampQuantityWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeLampQuantityWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeLampTypeWithCompletionHandler:(void (^)( + NSString * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)writeAttributeLampTypeWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeLampTypeWithValue:(NSString * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeLampTypeWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeLampTypeWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeLampManufacturerWithCompletionHandler:(void (^)(NSString * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)writeAttributeLampManufacturerWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeLampManufacturerWithValue:(NSString * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeLampManufacturerWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeLampManufacturerWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSString * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeLampRatedHoursWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)writeAttributeLampRatedHoursWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeLampRatedHoursWithValue:(NSNumber * _Nullable)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeLampRatedHoursWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeLampRatedHoursWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeLampBurnHoursWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)writeAttributeLampBurnHoursWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeLampBurnHoursWithValue:(NSNumber * _Nullable)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeLampBurnHoursWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeLampBurnHoursWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeLampAlarmModeWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)writeAttributeLampAlarmModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeLampAlarmModeWithValue:(NSNumber * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeLampAlarmModeWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeLampAlarmModeWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeLampBurnHoursTripPointWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)writeAttributeLampBurnHoursTripPointWithValue:(NSNumber * _Nullable)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeLampBurnHoursTripPointWithValue:(NSNumber * _Nullable)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeLampBurnHoursTripPointWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler; ++ (void)readAttributeLampBurnHoursTripPointWithAttributeCache:(MTRAttributeCacheContainer *)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; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeGeneratedCommandListWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeAcceptedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeAcceptedCommandListWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeAttributeListWithCompletionHandler:(void (^)( + NSArray * _Nullable value, NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeAttributeListWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeFeatureMapWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeFeatureMapWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeClusterRevisionWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + /** * Cluster Illuminance Measurement * diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index a90cdb0d88e814..0a987741f0fb1a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -52961,6 +52961,1582 @@ - (void)dealloc @end +@implementation MTRBaseClusterBallastConfiguration + +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + // Must allocate cppCluster on the Matter queue. + dispatch_sync(chip::DeviceLayer::PlatformMgrImpl().GetWorkQueue(), ^{ + *[self cppClusterSlot] = new chip::Controller::BallastConfigurationCluster( + *[device internalDevice]->GetExchangeManager(), [device internalDevice]->GetSecureSession().Value(), endpoint); + }); + if (self.cppCluster == nullptr) { + return nil; + } + } + return self; +} + +- (chip::Controller::BallastConfigurationCluster **)cppClusterSlot +{ + return &_cppCluster; +} + +- (void)readAttributePhysicalMinLevelWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::PhysicalMinLevel::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributePhysicalMinLevelWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRInt8uAttributeCallbackSubscriptionBridge( + 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 = BallastConfiguration::Attributes::PhysicalMinLevel::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], + MTRInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributePhysicalMinLevelWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::PhysicalMinLevel::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)readAttributePhysicalMaxLevelWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::PhysicalMaxLevel::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributePhysicalMaxLevelWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRInt8uAttributeCallbackSubscriptionBridge( + 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 = BallastConfiguration::Attributes::PhysicalMaxLevel::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], + MTRInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributePhysicalMaxLevelWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::PhysicalMaxLevel::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)readAttributeBallastStatusWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::BallastStatus::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeBallastStatusWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRInt8uAttributeCallbackSubscriptionBridge( + 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 = BallastConfiguration::Attributes::BallastStatus::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], + MTRInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeBallastStatusWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::BallastStatus::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)readAttributeMinLevelWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::MinLevel::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeMinLevelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + [self writeAttributeMinLevelWithValue:(NSNumber * _Nonnull) value params:nil completionHandler:completionHandler]; +} +- (void)writeAttributeMinLevelWithValue:(NSNumber * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler +{ + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil) { + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + new MTRDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BallastConfiguration::Attributes::MinLevel::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, timedWriteTimeout); + }); +} + +- (void)subscribeAttributeMinLevelWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRInt8uAttributeCallbackSubscriptionBridge( + 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 = BallastConfiguration::Attributes::MinLevel::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], + MTRInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeMinLevelWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::MinLevel::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)readAttributeMaxLevelWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::MaxLevel::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeMaxLevelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + [self writeAttributeMaxLevelWithValue:(NSNumber * _Nonnull) value params:nil completionHandler:completionHandler]; +} +- (void)writeAttributeMaxLevelWithValue:(NSNumber * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler +{ + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil) { + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + new MTRDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BallastConfiguration::Attributes::MaxLevel::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, timedWriteTimeout); + }); +} + +- (void)subscribeAttributeMaxLevelWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRInt8uAttributeCallbackSubscriptionBridge( + 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 = BallastConfiguration::Attributes::MaxLevel::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], + MTRInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeMaxLevelWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::MaxLevel::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)readAttributeIntrinsicBalanceFactorWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new MTRNullableInt8uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::IntrinsicBalanceFactor::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeIntrinsicBalanceFactorWithValue:(NSNumber * _Nullable)value + completionHandler:(StatusCompletion)completionHandler +{ + [self writeAttributeIntrinsicBalanceFactorWithValue:(NSNumber * _Nullable) value + params:nil + completionHandler:completionHandler]; +} +- (void)writeAttributeIntrinsicBalanceFactorWithValue:(NSNumber * _Nullable)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler +{ + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil) { + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + new MTRDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BallastConfiguration::Attributes::IntrinsicBalanceFactor::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedCharValue; + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->WriteAttribute( + cppValue, successFn->mContext, successFn->mCall, failureFn->mCall, timedWriteTimeout); + }); +} + +- (void)subscribeAttributeIntrinsicBalanceFactorWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRNullableInt8uAttributeCallbackSubscriptionBridge( + 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 = BallastConfiguration::Attributes::IntrinsicBalanceFactor::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], + MTRNullableInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeIntrinsicBalanceFactorWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRNullableInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::IntrinsicBalanceFactor::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)readAttributeBallastFactorAdjustmentWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new MTRNullableInt8uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::BallastFactorAdjustment::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeBallastFactorAdjustmentWithValue:(NSNumber * _Nullable)value + completionHandler:(StatusCompletion)completionHandler +{ + [self writeAttributeBallastFactorAdjustmentWithValue:(NSNumber * _Nullable) value + params:nil + completionHandler:completionHandler]; +} +- (void)writeAttributeBallastFactorAdjustmentWithValue:(NSNumber * _Nullable)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler +{ + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil) { + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + new MTRDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BallastConfiguration::Attributes::BallastFactorAdjustment::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedCharValue; + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->WriteAttribute( + cppValue, successFn->mContext, successFn->mCall, failureFn->mCall, timedWriteTimeout); + }); +} + +- (void)subscribeAttributeBallastFactorAdjustmentWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler +{ + new MTRNullableInt8uAttributeCallbackSubscriptionBridge( + 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 = BallastConfiguration::Attributes::BallastFactorAdjustment::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], + MTRNullableInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeBallastFactorAdjustmentWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRNullableInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::BallastFactorAdjustment::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)readAttributeLampQuantityWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::LampQuantity::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeLampQuantityWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRInt8uAttributeCallbackSubscriptionBridge( + 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 = BallastConfiguration::Attributes::LampQuantity::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], + MTRInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeLampQuantityWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::LampQuantity::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)readAttributeLampTypeWithCompletionHandler:(void (^)( + NSString * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRCharStringAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::LampType::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeLampTypeWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + [self writeAttributeLampTypeWithValue:(NSString * _Nonnull) value params:nil completionHandler:completionHandler]; +} +- (void)writeAttributeLampTypeWithValue:(NSString * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler +{ + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil) { + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + new MTRDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BallastConfiguration::Attributes::LampType::TypeInfo; + TypeInfo::Type cppValue; + cppValue = [self asCharSpan:value]; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->WriteAttribute( + cppValue, successFn->mContext, successFn->mCall, failureFn->mCall, timedWriteTimeout); + }); +} + +- (void)subscribeAttributeLampTypeWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRCharStringAttributeCallbackSubscriptionBridge( + 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 = BallastConfiguration::Attributes::LampType::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], + MTRCharStringAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeLampTypeWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRCharStringAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::LampType::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)readAttributeLampManufacturerWithCompletionHandler:(void (^)(NSString * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new MTRCharStringAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::LampManufacturer::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeLampManufacturerWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + [self writeAttributeLampManufacturerWithValue:(NSString * _Nonnull) value params:nil completionHandler:completionHandler]; +} +- (void)writeAttributeLampManufacturerWithValue:(NSString * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler +{ + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil) { + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + new MTRDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BallastConfiguration::Attributes::LampManufacturer::TypeInfo; + TypeInfo::Type cppValue; + cppValue = [self asCharSpan:value]; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->WriteAttribute( + cppValue, successFn->mContext, successFn->mCall, failureFn->mCall, timedWriteTimeout); + }); +} + +- (void)subscribeAttributeLampManufacturerWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRCharStringAttributeCallbackSubscriptionBridge( + 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 = BallastConfiguration::Attributes::LampManufacturer::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], + MTRCharStringAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeLampManufacturerWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSString * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRCharStringAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::LampManufacturer::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)readAttributeLampRatedHoursWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new MTRNullableInt32uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::LampRatedHours::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeLampRatedHoursWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler +{ + [self writeAttributeLampRatedHoursWithValue:(NSNumber * _Nullable) value params:nil completionHandler:completionHandler]; +} +- (void)writeAttributeLampRatedHoursWithValue:(NSNumber * _Nullable)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler +{ + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil) { + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + new MTRDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BallastConfiguration::Attributes::LampRatedHours::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedIntValue; + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->WriteAttribute( + cppValue, successFn->mContext, successFn->mCall, failureFn->mCall, timedWriteTimeout); + }); +} + +- (void)subscribeAttributeLampRatedHoursWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRNullableInt32uAttributeCallbackSubscriptionBridge( + 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 = BallastConfiguration::Attributes::LampRatedHours::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], + MTRNullableInt32uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeLampRatedHoursWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRNullableInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::LampRatedHours::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)readAttributeLampBurnHoursWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRNullableInt32uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::LampBurnHours::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeLampBurnHoursWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler +{ + [self writeAttributeLampBurnHoursWithValue:(NSNumber * _Nullable) value params:nil completionHandler:completionHandler]; +} +- (void)writeAttributeLampBurnHoursWithValue:(NSNumber * _Nullable)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler +{ + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil) { + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + new MTRDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BallastConfiguration::Attributes::LampBurnHours::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedIntValue; + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->WriteAttribute( + cppValue, successFn->mContext, successFn->mCall, failureFn->mCall, timedWriteTimeout); + }); +} + +- (void)subscribeAttributeLampBurnHoursWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRNullableInt32uAttributeCallbackSubscriptionBridge( + 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 = BallastConfiguration::Attributes::LampBurnHours::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], + MTRNullableInt32uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeLampBurnHoursWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRNullableInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::LampBurnHours::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)readAttributeLampAlarmModeWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::LampAlarmMode::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeLampAlarmModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + [self writeAttributeLampAlarmModeWithValue:(NSNumber * _Nonnull) value params:nil completionHandler:completionHandler]; +} +- (void)writeAttributeLampAlarmModeWithValue:(NSNumber * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler +{ + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil) { + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + new MTRDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BallastConfiguration::Attributes::LampAlarmMode::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, timedWriteTimeout); + }); +} + +- (void)subscribeAttributeLampAlarmModeWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRInt8uAttributeCallbackSubscriptionBridge( + 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 = BallastConfiguration::Attributes::LampAlarmMode::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], + MTRInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeLampAlarmModeWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::LampAlarmMode::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)readAttributeLampBurnHoursTripPointWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new MTRNullableInt32uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::LampBurnHoursTripPoint::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeLampBurnHoursTripPointWithValue:(NSNumber * _Nullable)value + completionHandler:(StatusCompletion)completionHandler +{ + [self writeAttributeLampBurnHoursTripPointWithValue:(NSNumber * _Nullable) value + params:nil + completionHandler:completionHandler]; +} +- (void)writeAttributeLampBurnHoursTripPointWithValue:(NSNumber * _Nullable)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler +{ + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil) { + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + new MTRDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BallastConfiguration::Attributes::LampBurnHoursTripPoint::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedIntValue; + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->WriteAttribute( + cppValue, successFn->mContext, successFn->mCall, failureFn->mCall, timedWriteTimeout); + }); +} + +- (void)subscribeAttributeLampBurnHoursTripPointWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRNullableInt32uAttributeCallbackSubscriptionBridge( + 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 = BallastConfiguration::Attributes::LampBurnHoursTripPoint::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], + MTRNullableInt32uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeLampBurnHoursTripPointWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRNullableInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::LampBurnHoursTripPoint::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 +{ + new MTRBallastConfigurationGeneratedCommandListListAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::GeneratedCommandList::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRBallastConfigurationGeneratedCommandListListAttributeCallbackSubscriptionBridge( + 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 = BallastConfiguration::Attributes::GeneratedCommandList::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], + MTRBallastConfigurationGeneratedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeGeneratedCommandListWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRBallastConfigurationGeneratedCommandListListAttributeCallbackBridge( + queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::GeneratedCommandList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeAcceptedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new MTRBallastConfigurationAcceptedCommandListListAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::AcceptedCommandList::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRBallastConfigurationAcceptedCommandListListAttributeCallbackSubscriptionBridge( + 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 = BallastConfiguration::Attributes::AcceptedCommandList::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], + MTRBallastConfigurationAcceptedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeAcceptedCommandListWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRBallastConfigurationAcceptedCommandListListAttributeCallbackBridge( + queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::AcceptedCommandList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeAttributeListWithCompletionHandler:(void (^)( + NSArray * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRBallastConfigurationAttributeListListAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::AttributeList::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRBallastConfigurationAttributeListListAttributeCallbackSubscriptionBridge( + 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 = BallastConfiguration::Attributes::AttributeList::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], + MTRBallastConfigurationAttributeListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeAttributeListWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRBallastConfigurationAttributeListListAttributeCallbackBridge( + queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeFeatureMapWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt32uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::FeatureMap::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRInt32uAttributeCallbackSubscriptionBridge( + 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 = BallastConfiguration::Attributes::FeatureMap::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + MTRInt32uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeFeatureMapWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new MTRInt16uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::ClusterRevision::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRInt16uAttributeCallbackSubscriptionBridge( + 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 = BallastConfiguration::Attributes::ClusterRevision::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], + MTRInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeClusterRevisionWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)dealloc +{ + // Must delete cppCluster on the Matter queue. + dispatch_sync(chip::DeviceLayer::PlatformMgrImpl().GetWorkQueue(), ^{ + if (self.cppCluster != nullptr) { + delete self.cppCluster; + } + }); +} + +@end + @implementation MTRBaseClusterIlluminanceMeasurement - (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_internal.h index d918ac6284b7ef..00d3b6a5d98626 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_internal.h @@ -288,6 +288,12 @@ - (chip::Controller::ColorControlCluster **)cppClusterSlot; @end +@interface MTRBaseClusterBallastConfiguration () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::BallastConfigurationCluster * cppCluster; +- (chip::Controller::BallastConfigurationCluster **)cppClusterSlot; +@end + @interface MTRBaseClusterIlluminanceMeasurement () // Must only touch cppCluster on the Matter queue. @property (readonly) chip::Controller::IlluminanceMeasurementCluster * cppCluster; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm index f5b83aeb87b9bb..1e7229a75fad35 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm @@ -7851,6 +7851,123 @@ } } +void MTRBallastConfigurationGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRBallastConfigurationGeneratedCommandListListAttributeCallbackSubscriptionBridge::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 MTRBallastConfigurationAcceptedCommandListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRBallastConfigurationAcceptedCommandListListAttributeCallbackSubscriptionBridge::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 MTRBallastConfigurationAttributeListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRBallastConfigurationAttributeListListAttributeCallbackSubscriptionBridge::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 MTRIlluminanceMeasurementGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge_internal.h index a0e07de4d7e35f..3e2b87500de6cb 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge_internal.h @@ -930,6 +930,12 @@ typedef void (*ColorControlAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*ColorControlAttributeListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*BallastConfigurationGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*BallastConfigurationAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*BallastConfigurationAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); typedef void (*IlluminanceMeasurementGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*IlluminanceMeasurementAcceptedCommandListListAttributeCallback)( @@ -6835,6 +6841,90 @@ class MTRColorControlAttributeListListAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; +class MTRBallastConfigurationGeneratedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRBallastConfigurationGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, bool keepAlive = false) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRBallastConfigurationGeneratedCommandListListAttributeCallbackSubscriptionBridge + : public MTRBallastConfigurationGeneratedCommandListListAttributeCallbackBridge +{ +public: + MTRBallastConfigurationGeneratedCommandListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, SubscriptionEstablishedHandler establishedHandler) : + MTRBallastConfigurationGeneratedCommandListListAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRBallastConfigurationAcceptedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRBallastConfigurationAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, bool keepAlive = false) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRBallastConfigurationAcceptedCommandListListAttributeCallbackSubscriptionBridge + : public MTRBallastConfigurationAcceptedCommandListListAttributeCallbackBridge +{ +public: + MTRBallastConfigurationAcceptedCommandListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, SubscriptionEstablishedHandler establishedHandler) : + MTRBallastConfigurationAcceptedCommandListListAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRBallastConfigurationAttributeListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRBallastConfigurationAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, bool keepAlive = false) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRBallastConfigurationAttributeListListAttributeCallbackSubscriptionBridge + : public MTRBallastConfigurationAttributeListListAttributeCallbackBridge +{ +public: + MTRBallastConfigurationAttributeListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + MTRBallastConfigurationAttributeListListAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class MTRIlluminanceMeasurementGeneratedCommandListListAttributeCallbackBridge : public MTRCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 8f0cc0966f1e18..880545c1cc509e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -1136,11 +1136,9 @@ typedef NS_ENUM(uint32_t, MTRClusterAttributeIDType) { MTRClusterBallastConfigurationAttributeBallastStatusID = 0x00000002, MTRClusterBallastConfigurationAttributeMinLevelID = 0x00000010, MTRClusterBallastConfigurationAttributeMaxLevelID = 0x00000011, - MTRClusterBallastConfigurationAttributePowerOnLevelID = 0x00000012, - MTRClusterBallastConfigurationAttributePowerOnFadeTimeID = 0x00000013, - MTRClusterBallastConfigurationAttributeIntrinsicBallastFactorID = 0x00000014, + MTRClusterBallastConfigurationAttributeIntrinsicBalanceFactorID = 0x00000014, MTRClusterBallastConfigurationAttributeBallastFactorAdjustmentID = 0x00000015, - MTRClusterBallastConfigurationAttributeLampQualityID = 0x00000020, + MTRClusterBallastConfigurationAttributeLampQuantityID = 0x00000020, MTRClusterBallastConfigurationAttributeLampTypeID = 0x00000030, MTRClusterBallastConfigurationAttributeLampManufacturerID = 0x00000031, MTRClusterBallastConfigurationAttributeLampRatedHoursID = 0x00000032, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 4b1717d3d2b1c7..4fd720ab45c0d1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -1865,6 +1865,16 @@ id MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRead } break; } + case Clusters::BallastConfiguration::Id: { + using namespace Clusters::BallastConfiguration; + switch (aPath.mEventId) { + + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case Clusters::IlluminanceMeasurement::Id: { using namespace Clusters::IlluminanceMeasurement; switch (aPath.mEventId) { 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 5089f54032e101..02c83fbab5bcd1 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 @@ -963,11 +963,9 @@ #define ZCL_BALLAST_STATUS_ATTRIBUTE_ID (0x0002) #define ZCL_MIN_LEVEL_ATTRIBUTE_ID (0x0010) #define ZCL_MAX_LEVEL_ATTRIBUTE_ID (0x0011) -#define ZCL_POWER_ON_LEVEL_ATTRIBUTE_ID (0x0012) -#define ZCL_POWER_ON_FADE_TIME_ATTRIBUTE_ID (0x0013) #define ZCL_INTRINSIC_BALLAST_FACTOR_ATTRIBUTE_ID (0x0014) #define ZCL_BALLAST_FACTOR_ADJUSTMENT_ATTRIBUTE_ID (0x0015) -#define ZCL_LAMP_QUALITY_ATTRIBUTE_ID (0x0020) +#define ZCL_LAMP_QUANTITY_ATTRIBUTE_ID (0x0020) #define ZCL_LAMP_TYPE_ATTRIBUTE_ID (0x0030) #define ZCL_LAMP_MANUFACTURER_ATTRIBUTE_ID (0x0031) #define ZCL_LAMP_RATED_HOURS_ATTRIBUTE_ID (0x0032) 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 4b3e6fb91fbd53..1d1e86768a01b9 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 @@ -23058,26 +23058,29 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) } // namespace MaxLevel -namespace PowerOnLevel { +namespace IntrinsicBalanceFactor { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } @@ -23087,59 +23090,50 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -} // namespace PowerOnLevel - -namespace PowerOnFadeTime { - -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus SetNull(chip::EndpointId endpoint) { - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::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; + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (value.IsNull()) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + return SetNull(endpoint); } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + + return Set(endpoint, value.Value()); } -} // namespace PowerOnFadeTime +} // namespace IntrinsicBalanceFactor -namespace IntrinsicBallastFactor { +namespace BallastFactorAdjustment { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } @@ -23149,40 +23143,28 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -} // namespace IntrinsicBallastFactor - -namespace BallastFactorAdjustment { - -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus SetNull(chip::EndpointId endpoint) { using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::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; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (value.IsNull()) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + return SetNull(endpoint); } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + + return Set(endpoint, value.Value()); } } // namespace BallastFactorAdjustment -namespace LampQuality { +namespace LampQuantity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { @@ -23211,7 +23193,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -} // namespace LampQuality +} // namespace LampQuantity namespace LampType { @@ -23277,24 +23259,27 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) namespace LampRatedHours { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { using Traits = NumericAttributeTraits>; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } @@ -23304,28 +23289,50 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE); } +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + } // namespace LampRatedHours namespace LampBurnHours { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { using Traits = NumericAttributeTraits>; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } @@ -23335,6 +23342,25 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE); } +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + } // namespace LampBurnHours namespace LampAlarmMode { @@ -23370,24 +23396,27 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) namespace LampBurnHoursTripPoint { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { using Traits = NumericAttributeTraits>; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } @@ -23397,6 +23426,25 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE); } +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + } // namespace LampBurnHoursTripPoint namespace FeatureMap { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 81ad62bda063db..e6930f6e15d0dc 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 @@ -3911,30 +3911,24 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace MaxLevel -namespace PowerOnLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); -} // namespace PowerOnLevel - -namespace PowerOnFadeTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); -} // namespace PowerOnFadeTime - -namespace IntrinsicBallastFactor { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +namespace IntrinsicBalanceFactor { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); -} // namespace IntrinsicBallastFactor +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +} // namespace IntrinsicBalanceFactor namespace BallastFactorAdjustment { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace BallastFactorAdjustment -namespace LampQuality { +namespace LampQuantity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); -} // namespace LampQuality +} // namespace LampQuantity namespace LampType { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string @@ -3947,13 +3941,17 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace LampManufacturer namespace LampRatedHours { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int24u +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int24u EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace LampRatedHours namespace LampBurnHours { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int24u +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int24u EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace LampBurnHours namespace LampAlarmMode { @@ -3962,8 +3960,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace LampAlarmMode namespace LampBurnHoursTripPoint { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int24u +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int24u EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace LampBurnHoursTripPoint namespace FeatureMap { 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 a952ac5190a615..1f0c91ef8c3056 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 @@ -17051,20 +17051,14 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre case Attributes::MaxLevel::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, maxLevel)); break; - case Attributes::PowerOnLevel::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, powerOnLevel)); - break; - case Attributes::PowerOnFadeTime::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, powerOnFadeTime)); - break; - case Attributes::IntrinsicBallastFactor::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, intrinsicBallastFactor)); + case Attributes::IntrinsicBalanceFactor::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, intrinsicBalanceFactor)); break; case Attributes::BallastFactorAdjustment::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, ballastFactorAdjustment)); break; - case Attributes::LampQuality::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, lampQuality)); + case Attributes::LampQuantity::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, lampQuantity)); break; case Attributes::LampType::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, lampType)); 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 fc20a1f967b678..1d94fdcf5d6783 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 @@ -22596,55 +22596,31 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace MaxLevel -namespace PowerOnLevel { +namespace IntrinsicBalanceFactor { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; - - static constexpr ClusterId GetClusterId() { return Clusters::BallastConfiguration::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::PowerOnLevel::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace PowerOnLevel -namespace PowerOnFadeTime { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::BallastConfiguration::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::PowerOnFadeTime::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace PowerOnFadeTime -namespace IntrinsicBallastFactor { -struct TypeInfo -{ - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::BallastConfiguration::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::IntrinsicBallastFactor::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::IntrinsicBalanceFactor::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; -} // namespace IntrinsicBallastFactor +} // namespace IntrinsicBalanceFactor namespace BallastFactorAdjustment { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::BallastConfiguration::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::BallastFactorAdjustment::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace BallastFactorAdjustment -namespace LampQuality { +namespace LampQuantity { struct TypeInfo { using Type = uint8_t; @@ -22652,10 +22628,10 @@ struct TypeInfo using DecodableArgType = uint8_t; static constexpr ClusterId GetClusterId() { return Clusters::BallastConfiguration::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::LampQuality::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::LampQuantity::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; -} // namespace LampQuality +} // namespace LampQuantity namespace LampType { struct TypeInfo { @@ -22685,9 +22661,9 @@ struct TypeInfo namespace LampRatedHours { struct TypeInfo { - using Type = uint32_t; - using DecodableType = uint32_t; - using DecodableArgType = uint32_t; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::BallastConfiguration::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::LampRatedHours::Id; } @@ -22697,9 +22673,9 @@ struct TypeInfo namespace LampBurnHours { struct TypeInfo { - using Type = uint32_t; - using DecodableType = uint32_t; - using DecodableArgType = uint32_t; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::BallastConfiguration::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::LampBurnHours::Id; } @@ -22721,9 +22697,9 @@ struct TypeInfo namespace LampBurnHoursTripPoint { struct TypeInfo { - using Type = uint32_t; - using DecodableType = uint32_t; - using DecodableArgType = uint32_t; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::BallastConfiguration::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::LampBurnHoursTripPoint::Id; } @@ -22769,22 +22745,20 @@ struct TypeInfo CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - Attributes::PhysicalMinLevel::TypeInfo::DecodableType physicalMinLevel = static_cast(0); - Attributes::PhysicalMaxLevel::TypeInfo::DecodableType physicalMaxLevel = static_cast(0); - Attributes::BallastStatus::TypeInfo::DecodableType ballastStatus = static_cast(0); - Attributes::MinLevel::TypeInfo::DecodableType minLevel = static_cast(0); - Attributes::MaxLevel::TypeInfo::DecodableType maxLevel = static_cast(0); - Attributes::PowerOnLevel::TypeInfo::DecodableType powerOnLevel = static_cast(0); - Attributes::PowerOnFadeTime::TypeInfo::DecodableType powerOnFadeTime = static_cast(0); - Attributes::IntrinsicBallastFactor::TypeInfo::DecodableType intrinsicBallastFactor = static_cast(0); - Attributes::BallastFactorAdjustment::TypeInfo::DecodableType ballastFactorAdjustment = static_cast(0); - Attributes::LampQuality::TypeInfo::DecodableType lampQuality = static_cast(0); + Attributes::PhysicalMinLevel::TypeInfo::DecodableType physicalMinLevel = static_cast(0); + Attributes::PhysicalMaxLevel::TypeInfo::DecodableType physicalMaxLevel = static_cast(0); + Attributes::BallastStatus::TypeInfo::DecodableType ballastStatus = static_cast(0); + Attributes::MinLevel::TypeInfo::DecodableType minLevel = static_cast(0); + Attributes::MaxLevel::TypeInfo::DecodableType maxLevel = static_cast(0); + Attributes::IntrinsicBalanceFactor::TypeInfo::DecodableType intrinsicBalanceFactor; + Attributes::BallastFactorAdjustment::TypeInfo::DecodableType ballastFactorAdjustment; + Attributes::LampQuantity::TypeInfo::DecodableType lampQuantity = static_cast(0); Attributes::LampType::TypeInfo::DecodableType lampType; Attributes::LampManufacturer::TypeInfo::DecodableType lampManufacturer; - Attributes::LampRatedHours::TypeInfo::DecodableType lampRatedHours = static_cast(0); - Attributes::LampBurnHours::TypeInfo::DecodableType lampBurnHours = static_cast(0); - Attributes::LampAlarmMode::TypeInfo::DecodableType lampAlarmMode = static_cast(0); - Attributes::LampBurnHoursTripPoint::TypeInfo::DecodableType lampBurnHoursTripPoint = static_cast(0); + Attributes::LampRatedHours::TypeInfo::DecodableType lampRatedHours; + Attributes::LampBurnHours::TypeInfo::DecodableType lampBurnHours; + Attributes::LampAlarmMode::TypeInfo::DecodableType lampAlarmMode = static_cast(0); + Attributes::LampBurnHoursTripPoint::TypeInfo::DecodableType lampBurnHoursTripPoint; 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/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index f41f3ebb818269..ff018c33ffa802 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 @@ -3886,25 +3886,17 @@ namespace MaxLevel { static constexpr AttributeId Id = 0x00000011; } // namespace MaxLevel -namespace PowerOnLevel { -static constexpr AttributeId Id = 0x00000012; -} // namespace PowerOnLevel - -namespace PowerOnFadeTime { -static constexpr AttributeId Id = 0x00000013; -} // namespace PowerOnFadeTime - -namespace IntrinsicBallastFactor { +namespace IntrinsicBalanceFactor { static constexpr AttributeId Id = 0x00000014; -} // namespace IntrinsicBallastFactor +} // namespace IntrinsicBalanceFactor namespace BallastFactorAdjustment { static constexpr AttributeId Id = 0x00000015; } // namespace BallastFactorAdjustment -namespace LampQuality { +namespace LampQuantity { static constexpr AttributeId Id = 0x00000020; -} // namespace LampQuality +} // namespace LampQuantity namespace LampType { static constexpr AttributeId Id = 0x00000030; diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 8de802c02a9098..6171f4426e7426 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -6735,11 +6735,9 @@ class ColorControlStepColorTemperature : public ClusterCommand | * BallastStatus | 0x0002 | | * MinLevel | 0x0010 | | * MaxLevel | 0x0011 | -| * PowerOnLevel | 0x0012 | -| * PowerOnFadeTime | 0x0013 | -| * IntrinsicBallastFactor | 0x0014 | +| * IntrinsicBalanceFactor | 0x0014 | | * BallastFactorAdjustment | 0x0015 | -| * LampQuality | 0x0020 | +| * LampQuantity | 0x0020 | | * LampType | 0x0030 | | * LampManufacturer | 0x0031 | | * LampRatedHours | 0x0032 | @@ -13954,11 +13952,9 @@ void registerClusterBallastConfiguration(Commands & commands, CredentialIssuerCo make_unique(Id, "ballast-status", Attributes::BallastStatus::Id, credsIssuerConfig), // make_unique(Id, "min-level", Attributes::MinLevel::Id, credsIssuerConfig), // make_unique(Id, "max-level", Attributes::MaxLevel::Id, credsIssuerConfig), // - make_unique(Id, "power-on-level", Attributes::PowerOnLevel::Id, credsIssuerConfig), // - make_unique(Id, "power-on-fade-time", Attributes::PowerOnFadeTime::Id, credsIssuerConfig), // - make_unique(Id, "intrinsic-ballast-factor", Attributes::IntrinsicBallastFactor::Id, credsIssuerConfig), // + make_unique(Id, "intrinsic-balance-factor", Attributes::IntrinsicBalanceFactor::Id, credsIssuerConfig), // make_unique(Id, "ballast-factor-adjustment", Attributes::BallastFactorAdjustment::Id, credsIssuerConfig), // - make_unique(Id, "lamp-quality", Attributes::LampQuality::Id, credsIssuerConfig), // + make_unique(Id, "lamp-quantity", Attributes::LampQuantity::Id, credsIssuerConfig), // make_unique(Id, "lamp-type", Attributes::LampType::Id, credsIssuerConfig), // make_unique(Id, "lamp-manufacturer", Attributes::LampManufacturer::Id, credsIssuerConfig), // make_unique(Id, "lamp-rated-hours", Attributes::LampRatedHours::Id, credsIssuerConfig), // @@ -13973,38 +13969,32 @@ void registerClusterBallastConfiguration(Commands & commands, CredentialIssuerCo make_unique>(Id, credsIssuerConfig), // make_unique>(Id, "min-level", 0, UINT8_MAX, Attributes::MinLevel::Id, credsIssuerConfig), // make_unique>(Id, "max-level", 0, UINT8_MAX, Attributes::MaxLevel::Id, credsIssuerConfig), // - make_unique>(Id, "power-on-level", 0, UINT8_MAX, Attributes::PowerOnLevel::Id, - credsIssuerConfig), // - make_unique>(Id, "power-on-fade-time", 0, UINT16_MAX, Attributes::PowerOnFadeTime::Id, - credsIssuerConfig), // - make_unique>(Id, "intrinsic-ballast-factor", 0, UINT8_MAX, Attributes::IntrinsicBallastFactor::Id, - credsIssuerConfig), // - make_unique>(Id, "ballast-factor-adjustment", 0, UINT8_MAX, Attributes::BallastFactorAdjustment::Id, - credsIssuerConfig), // - make_unique>(Id, "lamp-type", Attributes::LampType::Id, credsIssuerConfig), // + make_unique>>( + Id, "intrinsic-balance-factor", 0, UINT8_MAX, Attributes::IntrinsicBalanceFactor::Id, credsIssuerConfig), // + make_unique>>( + Id, "ballast-factor-adjustment", 0, UINT8_MAX, Attributes::BallastFactorAdjustment::Id, credsIssuerConfig), // + make_unique>(Id, "lamp-type", Attributes::LampType::Id, credsIssuerConfig), // make_unique>(Id, "lamp-manufacturer", Attributes::LampManufacturer::Id, credsIssuerConfig), // - make_unique>(Id, "lamp-rated-hours", 0, UINT32_MAX, Attributes::LampRatedHours::Id, - credsIssuerConfig), // - make_unique>(Id, "lamp-burn-hours", 0, UINT32_MAX, Attributes::LampBurnHours::Id, - credsIssuerConfig), // + make_unique>>(Id, "lamp-rated-hours", 0, UINT32_MAX, + Attributes::LampRatedHours::Id, credsIssuerConfig), // + make_unique>>(Id, "lamp-burn-hours", 0, UINT32_MAX, + Attributes::LampBurnHours::Id, credsIssuerConfig), // make_unique>(Id, "lamp-alarm-mode", 0, UINT8_MAX, Attributes::LampAlarmMode::Id, credsIssuerConfig), // - make_unique>(Id, "lamp-burn-hours-trip-point", 0, UINT32_MAX, - Attributes::LampBurnHoursTripPoint::Id, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, "physical-min-level", Attributes::PhysicalMinLevel::Id, credsIssuerConfig), // - make_unique(Id, "physical-max-level", Attributes::PhysicalMaxLevel::Id, credsIssuerConfig), // - make_unique(Id, "ballast-status", Attributes::BallastStatus::Id, credsIssuerConfig), // - make_unique(Id, "min-level", Attributes::MinLevel::Id, credsIssuerConfig), // - make_unique(Id, "max-level", Attributes::MaxLevel::Id, credsIssuerConfig), // - make_unique(Id, "power-on-level", Attributes::PowerOnLevel::Id, credsIssuerConfig), // - make_unique(Id, "power-on-fade-time", Attributes::PowerOnFadeTime::Id, credsIssuerConfig), // - make_unique(Id, "intrinsic-ballast-factor", Attributes::IntrinsicBallastFactor::Id, + make_unique>>( + Id, "lamp-burn-hours-trip-point", 0, UINT32_MAX, Attributes::LampBurnHoursTripPoint::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "physical-min-level", Attributes::PhysicalMinLevel::Id, credsIssuerConfig), // + make_unique(Id, "physical-max-level", Attributes::PhysicalMaxLevel::Id, credsIssuerConfig), // + make_unique(Id, "ballast-status", Attributes::BallastStatus::Id, credsIssuerConfig), // + make_unique(Id, "min-level", Attributes::MinLevel::Id, credsIssuerConfig), // + make_unique(Id, "max-level", Attributes::MaxLevel::Id, credsIssuerConfig), // + make_unique(Id, "intrinsic-balance-factor", Attributes::IntrinsicBalanceFactor::Id, credsIssuerConfig), // make_unique(Id, "ballast-factor-adjustment", Attributes::BallastFactorAdjustment::Id, credsIssuerConfig), // - make_unique(Id, "lamp-quality", Attributes::LampQuality::Id, credsIssuerConfig), // + make_unique(Id, "lamp-quantity", Attributes::LampQuantity::Id, credsIssuerConfig), // make_unique(Id, "lamp-type", Attributes::LampType::Id, credsIssuerConfig), // make_unique(Id, "lamp-manufacturer", Attributes::LampManufacturer::Id, credsIssuerConfig), // make_unique(Id, "lamp-rated-hours", Attributes::LampRatedHours::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 f7e482982a7862..f74a43dc5a4517 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -7925,6 +7925,107 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case BallastConfiguration::Id: { + switch (path.mAttributeId) + { + case BallastConfiguration::Attributes::PhysicalMinLevel::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PhysicalMinLevel", 1, value); + } + case BallastConfiguration::Attributes::PhysicalMaxLevel::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PhysicalMaxLevel", 1, value); + } + case BallastConfiguration::Attributes::BallastStatus::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("BallastStatus", 1, value); + } + case BallastConfiguration::Attributes::MinLevel::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MinLevel", 1, value); + } + case BallastConfiguration::Attributes::MaxLevel::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MaxLevel", 1, value); + } + case BallastConfiguration::Attributes::IntrinsicBalanceFactor::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("IntrinsicBalanceFactor", 1, value); + } + case BallastConfiguration::Attributes::BallastFactorAdjustment::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("BallastFactorAdjustment", 1, value); + } + case BallastConfiguration::Attributes::LampQuantity::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("LampQuantity", 1, value); + } + case BallastConfiguration::Attributes::LampType::Id: { + chip::CharSpan value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("LampType", 1, value); + } + case BallastConfiguration::Attributes::LampManufacturer::Id: { + chip::CharSpan value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("LampManufacturer", 1, value); + } + case BallastConfiguration::Attributes::LampRatedHours::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("LampRatedHours", 1, value); + } + case BallastConfiguration::Attributes::LampBurnHours::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("LampBurnHours", 1, value); + } + case BallastConfiguration::Attributes::LampAlarmMode::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("LampAlarmMode", 1, value); + } + case BallastConfiguration::Attributes::LampBurnHoursTripPoint::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("LampBurnHoursTripPoint", 1, value); + } + case BallastConfiguration::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + } + case BallastConfiguration::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + } + case BallastConfiguration::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AttributeList", 1, value); + } + case BallastConfiguration::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case BallastConfiguration::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } case IlluminanceMeasurement::Id: { switch (path.mAttributeId) { diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h index f362b1d0e9e37f..1331531e268026 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h @@ -367,6 +367,12 @@ typedef void (*ColorControlAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*ColorControlAttributeListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*BallastConfigurationGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*BallastConfigurationAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*BallastConfigurationAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); typedef void (*IlluminanceMeasurementGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*IlluminanceMeasurementAcceptedCommandListListAttributeCallback)( diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h index 7b515c2ba51d21..e4c2c1c4541b62 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h @@ -439,6 +439,15 @@ class DLL_EXPORT ColorControlCluster : public ClusterBase ~ColorControlCluster() {} }; +class DLL_EXPORT BallastConfigurationCluster : public ClusterBase +{ +public: + BallastConfigurationCluster(Messaging::ExchangeManager & exchangeManager, const SessionHandle & session, EndpointId endpoint) : + ClusterBase(exchangeManager, session, app::Clusters::BallastConfiguration::Id, endpoint) + {} + ~BallastConfigurationCluster() {} +}; + class DLL_EXPORT IlluminanceMeasurementCluster : public ClusterBase { public: diff --git a/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h b/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h index 2a939f3d431dd2..8deaa031f571d6 100644 --- a/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h @@ -66,6 +66,7 @@ MatterFanControlPluginClientInitCallback(); \ MatterThermostatUserInterfaceConfigurationPluginClientInitCallback(); \ MatterColorControlPluginClientInitCallback(); \ + MatterBallastConfigurationPluginClientInitCallback(); \ MatterIlluminanceMeasurementPluginClientInitCallback(); \ MatterTemperatureMeasurementPluginClientInitCallback(); \ MatterPressureMeasurementPluginClientInitCallback(); \ diff --git a/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp b/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp index 43d9fce595d6bb..f8dee5d0e42608 100644 --- a/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp +++ b/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp @@ -47,6 +47,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_AUDIO_OUTPUT_CLUSTER_ID: emberAfAudioOutputClusterInitCallback(endpoint); break; + case ZCL_BALLAST_CONFIGURATION_CLUSTER_ID: + emberAfBallastConfigurationClusterInitCallback(endpoint); + break; case ZCL_BARRIER_CONTROL_CLUSTER_ID: emberAfBarrierControlClusterInitCallback(endpoint); break; @@ -257,6 +260,11 @@ void __attribute__((weak)) emberAfAudioOutputClusterInitCallback(EndpointId endp // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfBallastConfigurationClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfBarrierControlClusterInitCallback(EndpointId endpoint) { // To prevent warning diff --git a/zzz_generated/controller-clusters/zap-generated/endpoint_config.h b/zzz_generated/controller-clusters/zap-generated/endpoint_config.h index 209cb7cda99b59..e4a89d5793365f 100644 --- a/zzz_generated/controller-clusters/zap-generated/endpoint_config.h +++ b/zzz_generated/controller-clusters/zap-generated/endpoint_config.h @@ -79,7 +79,7 @@ #define GENERATED_FUNCTION_ARRAYS #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 64 +#define GENERATED_CLUSTER_COUNT 65 // clang-format off #define GENERATED_CLUSTERS { \ @@ -567,6 +567,17 @@ .acceptedCommandList = nullptr ,\ .generatedCommandList = nullptr ,\ },\ + { \ + /* Endpoint: 1, Cluster: Ballast Configuration (client) */ \ + .clusterId = 0x00000301, \ + .attributes = ZAP_ATTRIBUTE_INDEX(0), \ + .attributeCount = 0, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .acceptedCommandList = nullptr ,\ + .generatedCommandList = nullptr ,\ + },\ { \ /* Endpoint: 1, Cluster: Illuminance Measurement (client) */ \ .clusterId = 0x00000400, \ @@ -798,7 +809,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 64, 0 }, \ + { ZAP_CLUSTER_INDEX(0), 65, 0 }, \ } // Largest attribute size is needed for various buffers diff --git a/zzz_generated/controller-clusters/zap-generated/gen_config.h b/zzz_generated/controller-clusters/zap-generated/gen_config.h index bcb14dfe6829c4..b10de1afafc777 100644 --- a/zzz_generated/controller-clusters/zap-generated/gen_config.h +++ b/zzz_generated/controller-clusters/zap-generated/gen_config.h @@ -73,6 +73,7 @@ #define EMBER_AF_FAN_CONTROL_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_THERMOSTAT_UI_CONFIG_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_COLOR_CONTROL_CLUSTER_CLIENT_ENDPOINT_COUNT (1) +#define EMBER_AF_BALLAST_CONFIGURATION_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_ILLUMINANCE_MEASUREMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_TEMP_MEASUREMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_PRESSURE_MEASUREMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) @@ -272,6 +273,10 @@ #define ZCL_USING_COLOR_CONTROL_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_COLOR_CONTROL_CLIENT +// Use this macro to check if the client side of the Ballast Configuration cluster is included +#define ZCL_USING_BALLAST_CONFIGURATION_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_BALLAST_CONFIGURATION_CLIENT + // Use this macro to check if the client side of the Illuminance Measurement cluster is included #define ZCL_USING_ILLUMINANCE_MEASUREMENT_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_ILLUMINANCE_MEASUREMENT_CLIENT diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 68e3a004d0456e..d4790c3e65d354 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -59553,6 +59553,1732 @@ class SubscribeAttributeColorControlClusterRevision : public SubscribeAttribute } }; +/*----------------------------------------------------------------------------*\ +| Cluster BallastConfiguration | 0x0301 | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * PhysicalMinLevel | 0x0000 | +| * PhysicalMaxLevel | 0x0001 | +| * BallastStatus | 0x0002 | +| * MinLevel | 0x0010 | +| * MaxLevel | 0x0011 | +| * IntrinsicBalanceFactor | 0x0014 | +| * BallastFactorAdjustment | 0x0015 | +| * LampQuantity | 0x0020 | +| * LampType | 0x0030 | +| * LampManufacturer | 0x0031 | +| * LampRatedHours | 0x0032 | +| * LampBurnHours | 0x0033 | +| * LampAlarmMode | 0x0034 | +| * LampBurnHoursTripPoint | 0x0035 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Attribute PhysicalMinLevel + */ +class ReadBallastConfigurationPhysicalMinLevel : public ReadAttribute { +public: + ReadBallastConfigurationPhysicalMinLevel() + : ReadAttribute("physical-min-level") + { + } + + ~ReadBallastConfigurationPhysicalMinLevel() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributePhysicalMinLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.PhysicalMinLevel response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration PhysicalMinLevel read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeBallastConfigurationPhysicalMinLevel : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationPhysicalMinLevel() + : SubscribeAttribute("physical-min-level") + { + } + + ~SubscribeAttributeBallastConfigurationPhysicalMinLevel() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributePhysicalMinLevelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.PhysicalMinLevel response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute PhysicalMaxLevel + */ +class ReadBallastConfigurationPhysicalMaxLevel : public ReadAttribute { +public: + ReadBallastConfigurationPhysicalMaxLevel() + : ReadAttribute("physical-max-level") + { + } + + ~ReadBallastConfigurationPhysicalMaxLevel() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributePhysicalMaxLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.PhysicalMaxLevel response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration PhysicalMaxLevel read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeBallastConfigurationPhysicalMaxLevel : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationPhysicalMaxLevel() + : SubscribeAttribute("physical-max-level") + { + } + + ~SubscribeAttributeBallastConfigurationPhysicalMaxLevel() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributePhysicalMaxLevelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.PhysicalMaxLevel response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute BallastStatus + */ +class ReadBallastConfigurationBallastStatus : public ReadAttribute { +public: + ReadBallastConfigurationBallastStatus() + : ReadAttribute("ballast-status") + { + } + + ~ReadBallastConfigurationBallastStatus() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeBallastStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.BallastStatus response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration BallastStatus read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeBallastConfigurationBallastStatus : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationBallastStatus() + : SubscribeAttribute("ballast-status") + { + } + + ~SubscribeAttributeBallastConfigurationBallastStatus() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBallastStatusWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.BallastStatus response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute MinLevel + */ +class ReadBallastConfigurationMinLevel : public ReadAttribute { +public: + ReadBallastConfigurationMinLevel() + : ReadAttribute("min-level") + { + } + + ~ReadBallastConfigurationMinLevel() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000010) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeMinLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.MinLevel response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration MinLevel read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteBallastConfigurationMinLevel : public WriteAttribute { +public: + WriteBallastConfigurationMinLevel() + : WriteAttribute("min-level") + { + AddArgument("attr-name", "min-level"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteBallastConfigurationMinLevel() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) WriteAttribute (0x00000010) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRWriteParams * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeMinLevelWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("BallastConfiguration MinLevel write Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeBallastConfigurationMinLevel : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationMinLevel() + : SubscribeAttribute("min-level") + { + } + + ~SubscribeAttributeBallastConfigurationMinLevel() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000010) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeMinLevelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.MinLevel response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute MaxLevel + */ +class ReadBallastConfigurationMaxLevel : public ReadAttribute { +public: + ReadBallastConfigurationMaxLevel() + : ReadAttribute("max-level") + { + } + + ~ReadBallastConfigurationMaxLevel() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000011) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeMaxLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.MaxLevel response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration MaxLevel read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteBallastConfigurationMaxLevel : public WriteAttribute { +public: + WriteBallastConfigurationMaxLevel() + : WriteAttribute("max-level") + { + AddArgument("attr-name", "max-level"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteBallastConfigurationMaxLevel() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) WriteAttribute (0x00000011) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRWriteParams * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeMaxLevelWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("BallastConfiguration MaxLevel write Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeBallastConfigurationMaxLevel : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationMaxLevel() + : SubscribeAttribute("max-level") + { + } + + ~SubscribeAttributeBallastConfigurationMaxLevel() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000011) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeMaxLevelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.MaxLevel response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute IntrinsicBalanceFactor + */ +class ReadBallastConfigurationIntrinsicBalanceFactor : public ReadAttribute { +public: + ReadBallastConfigurationIntrinsicBalanceFactor() + : ReadAttribute("intrinsic-balance-factor") + { + } + + ~ReadBallastConfigurationIntrinsicBalanceFactor() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000014) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeIntrinsicBalanceFactorWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.IntrinsicBalanceFactor response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration IntrinsicBalanceFactor read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteBallastConfigurationIntrinsicBalanceFactor : public WriteAttribute { +public: + WriteBallastConfigurationIntrinsicBalanceFactor() + : WriteAttribute("intrinsic-balance-factor") + { + AddArgument("attr-name", "intrinsic-balance-factor"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteBallastConfigurationIntrinsicBalanceFactor() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) WriteAttribute (0x00000014) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRWriteParams * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeIntrinsicBalanceFactorWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("BallastConfiguration IntrinsicBalanceFactor write Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeBallastConfigurationIntrinsicBalanceFactor : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationIntrinsicBalanceFactor() + : SubscribeAttribute("intrinsic-balance-factor") + { + } + + ~SubscribeAttributeBallastConfigurationIntrinsicBalanceFactor() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000014) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeIntrinsicBalanceFactorWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.IntrinsicBalanceFactor response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute BallastFactorAdjustment + */ +class ReadBallastConfigurationBallastFactorAdjustment : public ReadAttribute { +public: + ReadBallastConfigurationBallastFactorAdjustment() + : ReadAttribute("ballast-factor-adjustment") + { + } + + ~ReadBallastConfigurationBallastFactorAdjustment() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000015) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster + readAttributeBallastFactorAdjustmentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.BallastFactorAdjustment response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration BallastFactorAdjustment read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteBallastConfigurationBallastFactorAdjustment : public WriteAttribute { +public: + WriteBallastConfigurationBallastFactorAdjustment() + : WriteAttribute("ballast-factor-adjustment") + { + AddArgument("attr-name", "ballast-factor-adjustment"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteBallastConfigurationBallastFactorAdjustment() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) WriteAttribute (0x00000015) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRWriteParams * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeBallastFactorAdjustmentWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("BallastConfiguration BallastFactorAdjustment write Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeBallastConfigurationBallastFactorAdjustment : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationBallastFactorAdjustment() + : SubscribeAttribute("ballast-factor-adjustment") + { + } + + ~SubscribeAttributeBallastConfigurationBallastFactorAdjustment() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000015) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBallastFactorAdjustmentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.BallastFactorAdjustment response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute LampQuantity + */ +class ReadBallastConfigurationLampQuantity : public ReadAttribute { +public: + ReadBallastConfigurationLampQuantity() + : ReadAttribute("lamp-quantity") + { + } + + ~ReadBallastConfigurationLampQuantity() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000020) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeLampQuantityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampQuantity response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration LampQuantity read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeBallastConfigurationLampQuantity : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationLampQuantity() + : SubscribeAttribute("lamp-quantity") + { + } + + ~SubscribeAttributeBallastConfigurationLampQuantity() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000020) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeLampQuantityWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampQuantity response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute LampType + */ +class ReadBallastConfigurationLampType : public ReadAttribute { +public: + ReadBallastConfigurationLampType() + : ReadAttribute("lamp-type") + { + } + + ~ReadBallastConfigurationLampType() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000030) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeLampTypeWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampType response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration LampType read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteBallastConfigurationLampType : public WriteAttribute { +public: + WriteBallastConfigurationLampType() + : WriteAttribute("lamp-type") + { + AddArgument("attr-name", "lamp-type"); + AddArgument("attr-value", &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteBallastConfigurationLampType() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) WriteAttribute (0x00000030) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRWriteParams * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() + length:mValue.size() + encoding:NSUTF8StringEncoding]; + + [cluster writeAttributeLampTypeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("BallastConfiguration LampType write Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + chip::ByteSpan mValue; +}; + +class SubscribeAttributeBallastConfigurationLampType : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationLampType() + : SubscribeAttribute("lamp-type") + { + } + + ~SubscribeAttributeBallastConfigurationLampType() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000030) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeLampTypeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampType response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute LampManufacturer + */ +class ReadBallastConfigurationLampManufacturer : public ReadAttribute { +public: + ReadBallastConfigurationLampManufacturer() + : ReadAttribute("lamp-manufacturer") + { + } + + ~ReadBallastConfigurationLampManufacturer() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000031) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeLampManufacturerWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampManufacturer response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration LampManufacturer read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteBallastConfigurationLampManufacturer : public WriteAttribute { +public: + WriteBallastConfigurationLampManufacturer() + : WriteAttribute("lamp-manufacturer") + { + AddArgument("attr-name", "lamp-manufacturer"); + AddArgument("attr-value", &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteBallastConfigurationLampManufacturer() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) WriteAttribute (0x00000031) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRWriteParams * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() + length:mValue.size() + encoding:NSUTF8StringEncoding]; + + [cluster writeAttributeLampManufacturerWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("BallastConfiguration LampManufacturer write Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + chip::ByteSpan mValue; +}; + +class SubscribeAttributeBallastConfigurationLampManufacturer : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationLampManufacturer() + : SubscribeAttribute("lamp-manufacturer") + { + } + + ~SubscribeAttributeBallastConfigurationLampManufacturer() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000031) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeLampManufacturerWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampManufacturer response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute LampRatedHours + */ +class ReadBallastConfigurationLampRatedHours : public ReadAttribute { +public: + ReadBallastConfigurationLampRatedHours() + : ReadAttribute("lamp-rated-hours") + { + } + + ~ReadBallastConfigurationLampRatedHours() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000032) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeLampRatedHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampRatedHours response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration LampRatedHours read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteBallastConfigurationLampRatedHours : public WriteAttribute { +public: + WriteBallastConfigurationLampRatedHours() + : WriteAttribute("lamp-rated-hours") + { + AddArgument("attr-name", "lamp-rated-hours"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteBallastConfigurationLampRatedHours() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) WriteAttribute (0x00000032) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRWriteParams * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + + [cluster writeAttributeLampRatedHoursWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("BallastConfiguration LampRatedHours write Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint32_t mValue; +}; + +class SubscribeAttributeBallastConfigurationLampRatedHours : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationLampRatedHours() + : SubscribeAttribute("lamp-rated-hours") + { + } + + ~SubscribeAttributeBallastConfigurationLampRatedHours() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000032) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeLampRatedHoursWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampRatedHours response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute LampBurnHours + */ +class ReadBallastConfigurationLampBurnHours : public ReadAttribute { +public: + ReadBallastConfigurationLampBurnHours() + : ReadAttribute("lamp-burn-hours") + { + } + + ~ReadBallastConfigurationLampBurnHours() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000033) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeLampBurnHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampBurnHours response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration LampBurnHours read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteBallastConfigurationLampBurnHours : public WriteAttribute { +public: + WriteBallastConfigurationLampBurnHours() + : WriteAttribute("lamp-burn-hours") + { + AddArgument("attr-name", "lamp-burn-hours"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteBallastConfigurationLampBurnHours() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) WriteAttribute (0x00000033) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRWriteParams * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + + [cluster writeAttributeLampBurnHoursWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("BallastConfiguration LampBurnHours write Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint32_t mValue; +}; + +class SubscribeAttributeBallastConfigurationLampBurnHours : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationLampBurnHours() + : SubscribeAttribute("lamp-burn-hours") + { + } + + ~SubscribeAttributeBallastConfigurationLampBurnHours() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000033) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeLampBurnHoursWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampBurnHours response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute LampAlarmMode + */ +class ReadBallastConfigurationLampAlarmMode : public ReadAttribute { +public: + ReadBallastConfigurationLampAlarmMode() + : ReadAttribute("lamp-alarm-mode") + { + } + + ~ReadBallastConfigurationLampAlarmMode() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000034) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeLampAlarmModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampAlarmMode response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration LampAlarmMode read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteBallastConfigurationLampAlarmMode : public WriteAttribute { +public: + WriteBallastConfigurationLampAlarmMode() + : WriteAttribute("lamp-alarm-mode") + { + AddArgument("attr-name", "lamp-alarm-mode"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteBallastConfigurationLampAlarmMode() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) WriteAttribute (0x00000034) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRWriteParams * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeLampAlarmModeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("BallastConfiguration LampAlarmMode write Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeBallastConfigurationLampAlarmMode : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationLampAlarmMode() + : SubscribeAttribute("lamp-alarm-mode") + { + } + + ~SubscribeAttributeBallastConfigurationLampAlarmMode() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000034) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeLampAlarmModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampAlarmMode response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute LampBurnHoursTripPoint + */ +class ReadBallastConfigurationLampBurnHoursTripPoint : public ReadAttribute { +public: + ReadBallastConfigurationLampBurnHoursTripPoint() + : ReadAttribute("lamp-burn-hours-trip-point") + { + } + + ~ReadBallastConfigurationLampBurnHoursTripPoint() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000035) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeLampBurnHoursTripPointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampBurnHoursTripPoint response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration LampBurnHoursTripPoint read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteBallastConfigurationLampBurnHoursTripPoint : public WriteAttribute { +public: + WriteBallastConfigurationLampBurnHoursTripPoint() + : WriteAttribute("lamp-burn-hours-trip-point") + { + AddArgument("attr-name", "lamp-burn-hours-trip-point"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteBallastConfigurationLampBurnHoursTripPoint() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) WriteAttribute (0x00000035) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRWriteParams * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + + [cluster writeAttributeLampBurnHoursTripPointWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("BallastConfiguration LampBurnHoursTripPoint write Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint32_t mValue; +}; + +class SubscribeAttributeBallastConfigurationLampBurnHoursTripPoint : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationLampBurnHoursTripPoint() + : SubscribeAttribute("lamp-burn-hours-trip-point") + { + } + + ~SubscribeAttributeBallastConfigurationLampBurnHoursTripPoint() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000035) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeLampBurnHoursTripPointWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampBurnHoursTripPoint response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadBallastConfigurationGeneratedCommandList : public ReadAttribute { +public: + ReadBallastConfigurationGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadBallastConfigurationGeneratedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.GeneratedCommandList response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration GeneratedCommandList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeBallastConfigurationGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeBallastConfigurationGeneratedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.GeneratedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadBallastConfigurationAcceptedCommandList : public ReadAttribute { +public: + ReadBallastConfigurationAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadBallastConfigurationAcceptedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.AcceptedCommandList response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration AcceptedCommandList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeBallastConfigurationAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeBallastConfigurationAcceptedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.AcceptedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute AttributeList + */ +class ReadBallastConfigurationAttributeList : public ReadAttribute { +public: + ReadBallastConfigurationAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadBallastConfigurationAttributeList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.AttributeList response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration AttributeList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeBallastConfigurationAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeBallastConfigurationAttributeList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute FeatureMap + */ +class ReadBallastConfigurationFeatureMap : public ReadAttribute { +public: + ReadBallastConfigurationFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadBallastConfigurationFeatureMap() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.FeatureMap response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration FeatureMap read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeBallastConfigurationFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeBallastConfigurationFeatureMap() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadBallastConfigurationClusterRevision : public ReadAttribute { +public: + ReadBallastConfigurationClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadBallastConfigurationClusterRevision() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.ClusterRevision response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration ClusterRevision read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeBallastConfigurationClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeBallastConfigurationClusterRevision() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + /*----------------------------------------------------------------------------*\ | Cluster IlluminanceMeasurement | 0x0400 | |------------------------------------------------------------------------------| @@ -95785,6 +97511,69 @@ void registerClusterColorControl(Commands & commands) commands.Register(clusterName, clusterCommands); } +void registerClusterBallastConfiguration(Commands & commands) +{ + using namespace chip::app::Clusters::BallastConfiguration; + + const char * clusterName = "BallastConfiguration"; + + commands_list clusterCommands = { + make_unique(Id), // + make_unique(Id), // + make_unique(), // + make_unique(Id), // + make_unique(Id), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + }; + + commands.Register(clusterName, clusterCommands); +} void registerClusterIlluminanceMeasurement(Commands & commands) { using namespace chip::app::Clusters::IlluminanceMeasurement; @@ -97055,6 +98844,7 @@ void registerClusters(Commands & commands) registerClusterFanControl(commands); registerClusterThermostatUserInterfaceConfiguration(commands); registerClusterColorControl(commands); + registerClusterBallastConfiguration(commands); registerClusterIlluminanceMeasurement(commands); registerClusterTemperatureMeasurement(commands); registerClusterPressureMeasurement(commands);