From feabe0b2fe2fafbd9dcd0a1a1f2d6cd6c2d5c9dd Mon Sep 17 00:00:00 2001 From: Erik Hove Date: Wed, 1 Nov 2023 15:07:44 -0500 Subject: [PATCH] zap_regen_all & build chip-tool --- .../data_model/controller-clusters.matter | 432 +-- .../CHIPAttributeTLVValueDecoder.cpp | 2039 +----------- .../CHIPEventTLVValueDecoder.cpp | 643 +--- .../java/zap-generated/CHIPReadCallbacks.cpp | 2854 +---------------- .../python/chip/clusters/Objects.py | 1810 +---------- .../MTRAttributeSpecifiedCheck.mm | 180 +- .../MTRAttributeTLVValueDecoder.mm | 681 +--- .../CHIP/zap-generated/MTRBaseClusters.mm | 2535 ++------------- .../CHIP/zap-generated/MTRClusters.mm | 695 +--- .../zap-generated/MTRCommandTimedCheck.mm | 44 +- .../zap-generated/MTREventTLVValueDecoder.mm | 270 +- .../zap-generated/attributes/Accessors.cpp | 1422 ++------ .../zap-generated/attributes/Accessors.h | 226 +- .../zap-generated/cluster-enums-check.h | 185 +- .../app-common/zap-generated/cluster-enums.h | 290 +- .../app-common/zap-generated/ids/Attributes.h | 206 +- .../cluster/logging/DataModelLogger.cpp | 869 +---- 17 files changed, 1037 insertions(+), 14344 deletions(-) diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 533767e110f582..8788a8dfc6c92c 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -399,12 +399,12 @@ client cluster OnOffSwitchConfiguration = 7 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ client cluster LevelControl = 8 { - enum MoveModeEnum : enum8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepModeEnum : enum8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } @@ -415,7 +415,7 @@ client cluster LevelControl = 8 { kFrequency = 0x4; } - bitmap OptionsBitmap : bitmap8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -427,7 +427,7 @@ client cluster LevelControl = 8 { readonly attribute optional int16u currentFrequency = 4; readonly attribute optional int16u minFrequency = 5; readonly attribute optional int16u maxFrequency = 6; - attribute OptionsBitmap options = 15; + attribute LevelControlOptions options = 15; attribute optional int16u onOffTransitionTime = 16; attribute nullable int8u onLevel = 17; attribute optional nullable int16u onTransitionTime = 18; @@ -444,55 +444,55 @@ client cluster LevelControl = 8 { request struct MoveToLevelRequest { int8u level = 0; nullable int16u transitionTime = 1; - OptionsBitmap optionsMask = 2; - OptionsBitmap optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveRequest { - MoveModeEnum moveMode = 0; + MoveMode moveMode = 0; nullable int8u rate = 1; - OptionsBitmap optionsMask = 2; - OptionsBitmap optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepRequest { - StepModeEnum stepMode = 0; + StepMode stepMode = 0; int8u stepSize = 1; nullable int16u transitionTime = 2; - OptionsBitmap optionsMask = 3; - OptionsBitmap optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopRequest { - OptionsBitmap optionsMask = 0; - OptionsBitmap optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } request struct MoveToLevelWithOnOffRequest { int8u level = 0; nullable int16u transitionTime = 1; - OptionsBitmap optionsMask = 2; - OptionsBitmap optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct MoveWithOnOffRequest { - MoveModeEnum moveMode = 0; + MoveMode moveMode = 0; nullable int8u rate = 1; - OptionsBitmap optionsMask = 2; - OptionsBitmap optionsOverride = 3; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; } request struct StepWithOnOffRequest { - StepModeEnum stepMode = 0; + StepMode stepMode = 0; int8u stepSize = 1; nullable int16u transitionTime = 2; - OptionsBitmap optionsMask = 3; - OptionsBitmap optionsOverride = 4; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; } request struct StopWithOnOffRequest { - OptionsBitmap optionsMask = 0; - OptionsBitmap optionsOverride = 1; + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; } request struct MoveToClosestFrequencyRequest { @@ -930,8 +930,6 @@ client cluster BasicInformation = 40 { readonly attribute optional char_string<32> uniqueID = 18; readonly attribute CapabilityMinimaStruct capabilityMinima = 19; readonly attribute optional ProductAppearanceStruct productAppearance = 20; - readonly attribute int32u specificationVersion = 21; - readonly attribute int16u maxPathsPerInvoke = 22; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1479,12 +1477,12 @@ client cluster GeneralCommissioning = 48 { response struct ArmFailSafeResponse = 1 { CommissioningErrorEnum errorCode = 0; - char_string<128> debugText = 1; + char_string debugText = 1; } request struct SetRegulatoryConfigRequest { RegulatoryLocationTypeEnum newRegulatoryConfig = 0; - char_string<2> countryCode = 1; + char_string countryCode = 1; int64u breadcrumb = 2; } @@ -2835,49 +2833,24 @@ client cluster IcdManagement = 70 { command access(invoke: manage) StayActiveRequest(): DefaultSuccess = 3; } -/** This cluster supports creating a simple timer functionality. */ -provisional client cluster Timer = 71 { - enum TimerStatusEnum : enum8 { - kRunning = 0; - kPaused = 1; - kExpired = 2; - kReady = 3; - } - - bitmap Feature : bitmap32 { - kReset = 0x1; +/** This cluster supports remotely monitoring and controling the different typs of + functionality available to a drying device, such as a laundry dryer. */ +client cluster LaundryDryerControls = 74 { + enum DrynessLevelEnum : enum8 { + kLow = 0; + kNormal = 1; + kExtra = 2; + kMax = 3; } - readonly attribute elapsed_s setTime = 0; - readonly attribute elapsed_s timeRemaining = 1; - readonly attribute TimerStatusEnum timerState = 2; + readonly attribute optional DrynessLevelEnum supportedDrynessLevels[] = 0; + attribute optional nullable DrynessLevelEnum selectedDrynessLevel = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; readonly attribute attrib_id attributeList[] = 65531; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - - request struct SetTimerRequest { - elapsed_s newTime = 0; - } - - request struct AddTimeRequest { - elapsed_s additionalTime = 0; - } - - request struct ReduceTimeRequest { - elapsed_s timeReduction = 0; - } - - /** This command is used to set the timer. */ - command SetTimer(SetTimerRequest): DefaultSuccess = 0; - /** This command is used to reset the timer to the original value. */ - command ResetTimer(): DefaultSuccess = 1; - /** This command is used to add time to the existing timer. */ - command AddTime(AddTimeRequest): DefaultSuccess = 2; - /** This command is used to reduce time on the existing timer. */ - command ReduceTime(ReduceTimeRequest): DefaultSuccess = 3; } /** Attributes and commands for selecting a mode from a list of supported options. */ @@ -3780,314 +3753,6 @@ client cluster ActivatedCarbonFilterMonitoring = 114 { command ResetCondition(): DefaultSuccess = 0; } -/** This cluster is used to configure a boolean sensor. */ -provisional client cluster BooleanSensorConfiguration = 128 { - enum SensitivityEnum : enum8 { - kHigh = 0; - kStandard = 1; - kLow = 2; - } - - bitmap AlarmModeBitmap : bitmap8 { - kVisual = 0x1; - kAudible = 0x2; - } - - bitmap Feature : bitmap32 { - kVisual = 0x1; - kAudible = 0x2; - kAlarmSuppress = 0x4; - kSensitivityLevel = 0x8; - } - - info event AlarmsStateChanged = 0 { - AlarmModeBitmap alarmsActive = 0; - optional AlarmModeBitmap alarmsSuppressed = 1; - } - - info event SensorFault = 1 { - } - - attribute optional SensitivityEnum sensitivityLevel = 0; - readonly attribute optional AlarmModeBitmap alarmsActive = 1; - readonly attribute optional AlarmModeBitmap alarmsSuppressed = 2; - attribute optional AlarmModeBitmap alarmsEnabled = 3; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct SuppressRequestRequest { - AlarmModeBitmap alarmsToSuppress = 0; - } - - /** This command is used to suppress the specified alarm. */ - command SuppressRequest(SuppressRequestRequest): DefaultSuccess = 0; -} - -/** This cluster is used to configure a valve. */ -provisional client cluster ValveConfigurationAndControl = 129 { - enum ValveStateEnum : enum8 { - kOpen = 0; - kClosed = 1; - } - - bitmap Feature : bitmap32 { - kTimeSync = 0x1; - kLevel = 0x2; - } - - bitmap ValveFaultBitmap : bitmap16 { - kGeneralFault = 0x1; - kBlocked = 0x2; - kLeaking = 0x4; - } - - info event ValveStateChanged = 0 { - ValveStateEnum valveState = 0; - } - - info event ValveFault = 1 { - ValveFaultBitmap valveFault = 0; - } - - attribute access(write: manage) nullable elapsed_s openDuration = 0; - readonly attribute optional nullable epoch_us autoCloseTime = 1; - readonly attribute optional nullable elapsed_s remainingDuration = 2; - readonly attribute nullable ValveStateEnum currentState = 3; - readonly attribute nullable ValveStateEnum targetState = 4; - attribute access(write: manage) optional ValveStateEnum startUpState = 5; - readonly attribute optional nullable percent currentLevel = 6; - readonly attribute optional nullable percent targetLevel = 7; - attribute access(write: manage) optional nullable percent openLevel = 8; - readonly attribute optional ValveFaultBitmap valveFault = 9; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct OpenRequest { - optional elapsed_s openDuration = 0; - } - - request struct SetLevelRequest { - percent level = 0; - optional elapsed_s openDuration = 1; - } - - /** This command is used to set the valve to its fully open position. */ - command Open(OpenRequest): DefaultSuccess = 0; - /** This command is used to set the valve to its fully closed position. */ - command Close(): DefaultSuccess = 1; - /** This command is used to set the valve to a specific level. */ - command SetLevel(SetLevelRequest): DefaultSuccess = 2; -} - -/** This cluster provides an interface to the functionality of Smart Energy Demand Response and Load Control. */ -client cluster DemandResponseLoadControl = 150 { - enum CriticalityLevelEnum : enum8 { - kUnknown = 0; - kGreen = 1; - kLevel1 = 2; - kLevel2 = 3; - kLevel3 = 4; - kLevel4 = 5; - kLevel5 = 6; - kEmergency = 7; - kPlannedOutage = 8; - kServiceDisconnect = 9; - } - - enum HeatingSourceEnum : enum8 { - kAny = 0; - kElectric = 1; - kNonElectric = 2; - } - - enum LoadControlEventChangeSourceEnum : enum8 { - kAutomatic = 0; - kUserAction = 1; - } - - enum LoadControlEventStatusEnum : enum8 { - kUnknown = 0; - kReceived = 1; - kInProgress = 2; - kCompleted = 3; - kOptedOut = 4; - kOptedIn = 5; - kCanceled = 6; - kSuperseded = 7; - kPartialOptedOut = 8; - kPartialOptedIn = 9; - kNoParticipation = 10; - kUnavailable = 11; - kFailed = 12; - } - - enum PowerSavingsEnum : enum8 { - kLow = 0; - kMedium = 1; - kHigh = 2; - } - - bitmap CancelControlBitmap : bitmap16 { - kRandomEnd = 0x1; - } - - bitmap DeviceClassBitmap : bitmap32 { - kHVAC = 0x1; - kStripHeater = 0x2; - kWaterHeater = 0x4; - kPoolPump = 0x8; - kSmartAppliance = 0x10; - kIrrigationPump = 0x20; - kCommercialLoad = 0x40; - kResidentialLoad = 0x80; - kExteriorLighting = 0x100; - kInteriorLighting = 0x200; - kEV = 0x400; - kGenerationSystem = 0x800; - kSmartInverter = 0x1000; - kEVSE = 0x2000; - kRESU = 0x4000; - kEMS = 0x8000; - kSEM = 0x10000; - } - - bitmap EventControlBitmap : bitmap16 { - kRandomStart = 0x1; - } - - bitmap EventTransitionControlBitmap : bitmap16 { - kRandomDuration = 0x1; - kIgnoreOptOut = 0x2; - } - - bitmap Feature : bitmap32 { - kEnrollmentGroups = 0x1; - kTemperatureOffset = 0x2; - kTemperatureSetpoint = 0x4; - kLoadAdjustment = 0x8; - kDutyCycle = 0x10; - kPowerSavings = 0x20; - kHeatingSource = 0x40; - } - - struct HeatingSourceControlStruct { - HeatingSourceEnum heatingSource = 0; - } - - struct PowerSavingsControlStruct { - PowerSavingsEnum powerSavings = 0; - } - - struct DutyCycleControlStruct { - percent dutyCycle = 0; - } - - struct AverageLoadControlStruct { - int8s loadAdjustment = 0; - } - - struct TemperatureControlStruct { - optional nullable int16u coolingTempOffset = 0; - optional nullable int16u heatingtTempOffset = 1; - optional nullable temperature coolingTempSetpoint = 2; - optional nullable temperature heatingTempSetpoint = 3; - } - - struct LoadControlEventTransitionStruct { - int16u duration = 0; - EventTransitionControlBitmap control = 1; - optional TemperatureControlStruct temperatureControl = 2; - optional AverageLoadControlStruct averageLoadControl = 3; - optional DutyCycleControlStruct dutyCycleControl = 4; - optional PowerSavingsControlStruct powerSavingsControl = 5; - optional HeatingSourceControlStruct heatingSourceControl = 6; - } - - struct LoadControlEventStruct { - octet_string<16> eventID = 0; - nullable octet_string<16> programID = 1; - EventControlBitmap control = 2; - DeviceClassBitmap deviceClass = 3; - optional int8u enrollmentGroup = 4; - CriticalityLevelEnum criticality = 5; - nullable epoch_s startTime = 6; - LoadControlEventTransitionStruct transitions[] = 7; - } - - struct LoadControlProgramStruct { - octet_string<16> programID = 0; - long_char_string<32> name = 1; - nullable int8u enrollmentGroup = 2; - nullable int8u randomStartMinutes = 3; - nullable int8u randomDurationMinutes = 4; - } - - info event LoadControlEventStatusChange = 0 { - octet_string eventID = 0; - nullable int8u transitionIndex = 1; - LoadControlEventStatusEnum status = 2; - CriticalityLevelEnum criticality = 3; - EventControlBitmap control = 4; - optional nullable TemperatureControlStruct temperatureControl = 5; - optional nullable AverageLoadControlStruct averageLoadControl = 6; - optional nullable DutyCycleControlStruct dutyCycleControl = 7; - optional nullable PowerSavingsControlStruct powerSavingsControl = 8; - optional nullable HeatingSourceControlStruct heatingSourceControl = 9; - } - - readonly attribute DeviceClassBitmap deviceClass = 0; - readonly attribute LoadControlProgramStruct loadControlPrograms[] = 1; - readonly attribute int8u numberOfLoadControlPrograms = 2; - readonly attribute LoadControlEventStruct events[] = 3; - readonly attribute LoadControlEventStruct activeEvents[] = 4; - readonly attribute int8u numberOfEventsPerProgram = 5; - readonly attribute int8u numberOfTransistions = 6; - attribute access(write: manage) int8u defaultRandomStart = 7; - attribute access(write: manage) int8u defaultRandomDuration = 8; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct RegisterLoadControlProgramRequestRequest { - LoadControlProgramStruct loadControlProgram = 0; - } - - request struct UnregisterLoadControlProgramRequestRequest { - octet_string<16> loadControlProgramID = 0; - } - - request struct AddLoadControlEventRequestRequest { - LoadControlEventStruct event = 0; - } - - request struct RemoveLoadControlEventRequestRequest { - octet_string<16> eventID = 0; - CancelControlBitmap cancelControl = 1; - } - - /** Upon receipt, this SHALL insert a new LoadControlProgramStruct into LoadControlPrograms, or if the ProgramID matches an existing LoadControlProgramStruct, then the provider SHALL be updated with the provided values. */ - command RegisterLoadControlProgramRequest(RegisterLoadControlProgramRequestRequest): DefaultSuccess = 0; - /** Upon receipt, this SHALL remove a the LoadControlProgramStruct from LoadControlPrograms with the matching ProgramID. */ - command UnregisterLoadControlProgramRequest(UnregisterLoadControlProgramRequestRequest): DefaultSuccess = 1; - /** On receipt of the AddLoadControlEventsRequest command, the server SHALL add a load control event. */ - command AddLoadControlEventRequest(AddLoadControlEventRequestRequest): DefaultSuccess = 2; - /** Upon receipt, this SHALL remove the LoadControlEventStruct with the matching EventID from LoadEventPrograms. */ - command RemoveLoadControlEventRequest(RemoveLoadControlEventRequestRequest): DefaultSuccess = 3; - /** Upon receipt, this SHALL clear all the load control events. */ - command ClearLoadControlEventsRequest(): DefaultSuccess = 4; -} - /** An interface to a generic way to secure a door */ client cluster DoorLock = 257 { enum AlarmCodeEnum : enum8 { @@ -5260,28 +4925,9 @@ provisional client cluster FanControl = 514 { /** An interface for configuring the user interface of a thermostat (which may be remote from the thermostat). */ client cluster ThermostatUserInterfaceConfiguration = 516 { - enum KeypadLockoutEnum : enum8 { - kNoLockout = 0; - kLockout1 = 1; - kLockout2 = 2; - kLockout3 = 3; - kLockout4 = 4; - kLockout5 = 5; - } - - enum ScheduleProgrammingVisibilityEnum : enum8 { - kScheduleProgrammingPermitted = 0; - kScheduleProgrammingDenied = 1; - } - - enum TemperatureDisplayModeEnum : enum8 { - kCelsius = 0; - kFahrenheit = 1; - } - - attribute TemperatureDisplayModeEnum temperatureDisplayMode = 0; - attribute access(write: manage) KeypadLockoutEnum keypadLockout = 1; - attribute access(write: manage) optional ScheduleProgrammingVisibilityEnum scheduleProgrammingVisibility = 2; + attribute enum8 temperatureDisplayMode = 0; + attribute access(write: manage) enum8 keypadLockout = 1; + attribute access(write: manage) optional enum8 scheduleProgrammingVisibility = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 8b170677a47186..2705a4dc86b134 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -3623,38 +3623,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value_primaryColor); return value; } - case Attributes::SpecificationVersion::Id: { - using TypeInfo = Attributes::SpecificationVersion::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - jlong jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - return value; - } - case Attributes::MaxPathsPerInvoke::Id: { - using TypeInfo = Attributes::MaxPathsPerInvoke::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -12796,12 +12764,12 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::Timer::Id: { - using namespace app::Clusters::Timer; + case app::Clusters::LaundryDryerControls::Id: { + using namespace app::Clusters::LaundryDryerControls; switch (aPath.mAttributeId) { - case Attributes::SetTime::Id: { - using TypeInfo = Attributes::SetTime::TypeInfo; + case Attributes::SupportedDrynessLevels::Id: { + using TypeInfo = Attributes::SupportedDrynessLevels::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -12809,31 +12777,24 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - jlong jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - return value; - } - case Attributes::TimeRemaining::Id: { - using TypeInfo = Attributes::TimeRemaining::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) { - return nullptr; + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Integer"; + std::string newElement_0CtorSignature = "(I)V"; + jint jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); } - jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - jlong jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); return value; } - case Attributes::TimerState::Id: { - using TypeInfo = Attributes::TimerState::TypeInfo; + case Attributes::SelectedDrynessLevel::Id: { + using TypeInfo = Attributes::SelectedDrynessLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -12841,11 +12802,18 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + } return value; } case Attributes::GeneratedCommandList::Id: { @@ -18236,1953 +18204,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::BooleanSensorConfiguration::Id: { - using namespace app::Clusters::BooleanSensorConfiguration; - switch (aPath.mAttributeId) - { - case Attributes::SensitivityLevel::Id: { - using TypeInfo = Attributes::SensitivityLevel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AlarmsActive::Id: { - using TypeInfo = Attributes::AlarmsActive::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AlarmsSuppressed::Id: { - using TypeInfo = Attributes::AlarmsSuppressed::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AlarmsEnabled::Id: { - using TypeInfo = Attributes::AlarmsEnabled::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - jlong jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - break; - } - break; - } - case app::Clusters::ValveConfigurationAndControl::Id: { - using namespace app::Clusters::ValveConfigurationAndControl; - switch (aPath.mAttributeId) - { - case Attributes::OpenDuration::Id: { - using TypeInfo = Attributes::OpenDuration::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"; - jlong jnivalue = static_cast(cppValue.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - } - return value; - } - case Attributes::AutoCloseTime::Id: { - using TypeInfo = Attributes::AutoCloseTime::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"; - jlong jnivalue = static_cast(cppValue.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - } - return value; - } - case Attributes::RemainingDuration::Id: { - using TypeInfo = Attributes::RemainingDuration::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"; - jlong jnivalue = static_cast(cppValue.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - } - return value; - } - case Attributes::CurrentState::Id: { - using TypeInfo = Attributes::CurrentState::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"; - jint jnivalue = static_cast(cppValue.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - } - return value; - } - case Attributes::TargetState::Id: { - using TypeInfo = Attributes::TargetState::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"; - jint jnivalue = static_cast(cppValue.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - } - return value; - } - case Attributes::StartUpState::Id: { - using TypeInfo = Attributes::StartUpState::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::CurrentLevel::Id: { - using TypeInfo = Attributes::CurrentLevel::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"; - jint jnivalue = static_cast(cppValue.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - } - return value; - } - case Attributes::TargetLevel::Id: { - using TypeInfo = Attributes::TargetLevel::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"; - jint jnivalue = static_cast(cppValue.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - } - return value; - } - case Attributes::OpenLevel::Id: { - using TypeInfo = Attributes::OpenLevel::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"; - jint jnivalue = static_cast(cppValue.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - } - return value; - } - case Attributes::ValveFault::Id: { - using TypeInfo = Attributes::ValveFault::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - jlong jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - break; - } - break; - } - case app::Clusters::DemandResponseLoadControl::Id: { - using namespace app::Clusters::DemandResponseLoadControl; - switch (aPath.mAttributeId) - { - case Attributes::DeviceClass::Id: { - using TypeInfo = Attributes::DeviceClass::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - jlong jnivalue = static_cast(cppValue.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - return value; - } - case Attributes::LoadControlPrograms::Id: { - using TypeInfo = Attributes::LoadControlPrograms::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; - jobject newElement_0_programID; - jbyteArray newElement_0_programIDByteArray = env->NewByteArray(static_cast(entry_0.programID.size())); - env->SetByteArrayRegion(newElement_0_programIDByteArray, 0, static_cast(entry_0.programID.size()), - reinterpret_cast(entry_0.programID.data())); - newElement_0_programID = newElement_0_programIDByteArray; - jobject newElement_0_name; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); - jobject newElement_0_enrollmentGroup; - if (entry_0.enrollmentGroup.IsNull()) - { - newElement_0_enrollmentGroup = nullptr; - } - else - { - std::string newElement_0_enrollmentGroupClassName = "java/lang/Integer"; - std::string newElement_0_enrollmentGroupCtorSignature = "(I)V"; - jint jninewElement_0_enrollmentGroup = static_cast(entry_0.enrollmentGroup.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_enrollmentGroupClassName.c_str(), newElement_0_enrollmentGroupCtorSignature.c_str(), - jninewElement_0_enrollmentGroup, newElement_0_enrollmentGroup); - } - jobject newElement_0_randomStartMinutes; - if (entry_0.randomStartMinutes.IsNull()) - { - newElement_0_randomStartMinutes = nullptr; - } - else - { - std::string newElement_0_randomStartMinutesClassName = "java/lang/Integer"; - std::string newElement_0_randomStartMinutesCtorSignature = "(I)V"; - jint jninewElement_0_randomStartMinutes = static_cast(entry_0.randomStartMinutes.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_randomStartMinutesClassName.c_str(), newElement_0_randomStartMinutesCtorSignature.c_str(), - jninewElement_0_randomStartMinutes, newElement_0_randomStartMinutes); - } - jobject newElement_0_randomDurationMinutes; - if (entry_0.randomDurationMinutes.IsNull()) - { - newElement_0_randomDurationMinutes = nullptr; - } - else - { - std::string newElement_0_randomDurationMinutesClassName = "java/lang/Integer"; - std::string newElement_0_randomDurationMinutesCtorSignature = "(I)V"; - jint jninewElement_0_randomDurationMinutes = static_cast(entry_0.randomDurationMinutes.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_randomDurationMinutesClassName.c_str(), - newElement_0_randomDurationMinutesCtorSignature.c_str(), jninewElement_0_randomDurationMinutes, - newElement_0_randomDurationMinutes); - } - - jclass loadControlProgramStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlProgramStruct", - loadControlProgramStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlProgramStruct"); - return nullptr; - } - jmethodID loadControlProgramStructStructCtor_1 = - env->GetMethodID(loadControlProgramStructStructClass_1, "", - "([BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); - if (loadControlProgramStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlProgramStruct constructor"); - return nullptr; - } - - newElement_0 = env->NewObject(loadControlProgramStructStructClass_1, loadControlProgramStructStructCtor_1, - newElement_0_programID, newElement_0_name, newElement_0_enrollmentGroup, - newElement_0_randomStartMinutes, newElement_0_randomDurationMinutes); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::NumberOfLoadControlPrograms::Id: { - using TypeInfo = Attributes::NumberOfLoadControlPrograms::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::Events::Id: { - using TypeInfo = Attributes::Events::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; - jobject newElement_0_eventID; - jbyteArray newElement_0_eventIDByteArray = env->NewByteArray(static_cast(entry_0.eventID.size())); - env->SetByteArrayRegion(newElement_0_eventIDByteArray, 0, static_cast(entry_0.eventID.size()), - reinterpret_cast(entry_0.eventID.data())); - newElement_0_eventID = newElement_0_eventIDByteArray; - jobject newElement_0_programID; - if (entry_0.programID.IsNull()) - { - newElement_0_programID = nullptr; - } - else - { - jbyteArray newElement_0_programIDByteArray = - env->NewByteArray(static_cast(entry_0.programID.Value().size())); - env->SetByteArrayRegion(newElement_0_programIDByteArray, 0, - static_cast(entry_0.programID.Value().size()), - reinterpret_cast(entry_0.programID.Value().data())); - newElement_0_programID = newElement_0_programIDByteArray; - } - jobject newElement_0_control; - std::string newElement_0_controlClassName = "java/lang/Integer"; - std::string newElement_0_controlCtorSignature = "(I)V"; - jint jninewElement_0_control = static_cast(entry_0.control.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_controlClassName.c_str(), - newElement_0_controlCtorSignature.c_str(), - jninewElement_0_control, newElement_0_control); - jobject newElement_0_deviceClass; - std::string newElement_0_deviceClassClassName = "java/lang/Long"; - std::string newElement_0_deviceClassCtorSignature = "(J)V"; - jlong jninewElement_0_deviceClass = static_cast(entry_0.deviceClass.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_deviceClassClassName.c_str(), - newElement_0_deviceClassCtorSignature.c_str(), - jninewElement_0_deviceClass, newElement_0_deviceClass); - jobject newElement_0_enrollmentGroup; - if (!entry_0.enrollmentGroup.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_enrollmentGroup); - } - else - { - jobject newElement_0_enrollmentGroupInsideOptional; - std::string newElement_0_enrollmentGroupInsideOptionalClassName = "java/lang/Integer"; - std::string newElement_0_enrollmentGroupInsideOptionalCtorSignature = "(I)V"; - jint jninewElement_0_enrollmentGroupInsideOptional = static_cast(entry_0.enrollmentGroup.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_enrollmentGroupInsideOptionalClassName.c_str(), - newElement_0_enrollmentGroupInsideOptionalCtorSignature.c_str(), - jninewElement_0_enrollmentGroupInsideOptional, newElement_0_enrollmentGroupInsideOptional); - chip::JniReferences::GetInstance().CreateOptional(newElement_0_enrollmentGroupInsideOptional, - newElement_0_enrollmentGroup); - } - jobject newElement_0_criticality; - std::string newElement_0_criticalityClassName = "java/lang/Integer"; - std::string newElement_0_criticalityCtorSignature = "(I)V"; - jint jninewElement_0_criticality = static_cast(entry_0.criticality); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_criticalityClassName.c_str(), - newElement_0_criticalityCtorSignature.c_str(), - jninewElement_0_criticality, newElement_0_criticality); - jobject newElement_0_startTime; - if (entry_0.startTime.IsNull()) - { - newElement_0_startTime = nullptr; - } - else - { - std::string newElement_0_startTimeClassName = "java/lang/Long"; - std::string newElement_0_startTimeCtorSignature = "(J)V"; - jlong jninewElement_0_startTime = static_cast(entry_0.startTime.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_startTimeClassName.c_str(), - newElement_0_startTimeCtorSignature.c_str(), - jninewElement_0_startTime, newElement_0_startTime); - } - jobject newElement_0_transitions; - chip::JniReferences::GetInstance().CreateArrayList(newElement_0_transitions); - - auto iter_newElement_0_transitions_2 = entry_0.transitions.begin(); - while (iter_newElement_0_transitions_2.Next()) - { - auto & entry_2 = iter_newElement_0_transitions_2.GetValue(); - jobject newElement_2; - jobject newElement_2_duration; - std::string newElement_2_durationClassName = "java/lang/Integer"; - std::string newElement_2_durationCtorSignature = "(I)V"; - jint jninewElement_2_duration = static_cast(entry_2.duration); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_durationClassName.c_str(), - newElement_2_durationCtorSignature.c_str(), - jninewElement_2_duration, newElement_2_duration); - jobject newElement_2_control; - std::string newElement_2_controlClassName = "java/lang/Integer"; - std::string newElement_2_controlCtorSignature = "(I)V"; - jint jninewElement_2_control = static_cast(entry_2.control.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_controlClassName.c_str(), - newElement_2_controlCtorSignature.c_str(), - jninewElement_2_control, newElement_2_control); - jobject newElement_2_temperatureControl; - if (!entry_2.temperatureControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_temperatureControl); - } - else - { - jobject newElement_2_temperatureControlInsideOptional; - jobject newElement_2_temperatureControlInsideOptional_coolingTempOffset; - if (!entry_2.temperatureControl.Value().coolingTempOffset.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional( - nullptr, newElement_2_temperatureControlInsideOptional_coolingTempOffset); - } - else - { - jobject newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional; - if (entry_2.temperatureControl.Value().coolingTempOffset.Value().IsNull()) - { - newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional = nullptr; - } - else - { - std::string newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptionalClassName = - "java/lang/Integer"; - std::string - newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptionalCtorSignature = - "(I)V"; - jint jninewElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional = - static_cast(entry_2.temperatureControl.Value().coolingTempOffset.Value().Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptionalClassName.c_str(), - newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptionalCtorSignature - .c_str(), - jninewElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional, - newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional); - } - chip::JniReferences::GetInstance().CreateOptional( - newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional, - newElement_2_temperatureControlInsideOptional_coolingTempOffset); - } - jobject newElement_2_temperatureControlInsideOptional_heatingtTempOffset; - if (!entry_2.temperatureControl.Value().heatingtTempOffset.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional( - nullptr, newElement_2_temperatureControlInsideOptional_heatingtTempOffset); - } - else - { - jobject newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional; - if (entry_2.temperatureControl.Value().heatingtTempOffset.Value().IsNull()) - { - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional = nullptr; - } - else - { - std::string - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptionalClassName = - "java/lang/Integer"; - std::string - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptionalCtorSignature = - "(I)V"; - jint jninewElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional = - static_cast(entry_2.temperatureControl.Value().heatingtTempOffset.Value().Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptionalClassName.c_str(), - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptionalCtorSignature - .c_str(), - jninewElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional, - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional); - } - chip::JniReferences::GetInstance().CreateOptional( - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional, - newElement_2_temperatureControlInsideOptional_heatingtTempOffset); - } - jobject newElement_2_temperatureControlInsideOptional_coolingTempSetpoint; - if (!entry_2.temperatureControl.Value().coolingTempSetpoint.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional( - nullptr, newElement_2_temperatureControlInsideOptional_coolingTempSetpoint); - } - else - { - jobject newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional; - if (entry_2.temperatureControl.Value().coolingTempSetpoint.Value().IsNull()) - { - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional = nullptr; - } - else - { - std::string - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptionalClassName = - "java/lang/Integer"; - std::string - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptionalCtorSignature = - "(I)V"; - jint jninewElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional = - static_cast(entry_2.temperatureControl.Value().coolingTempSetpoint.Value().Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptionalClassName - .c_str(), - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptionalCtorSignature - .c_str(), - jninewElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional, - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional); - } - chip::JniReferences::GetInstance().CreateOptional( - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional, - newElement_2_temperatureControlInsideOptional_coolingTempSetpoint); - } - jobject newElement_2_temperatureControlInsideOptional_heatingTempSetpoint; - if (!entry_2.temperatureControl.Value().heatingTempSetpoint.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional( - nullptr, newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); - } - else - { - jobject newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional; - if (entry_2.temperatureControl.Value().heatingTempSetpoint.Value().IsNull()) - { - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional = nullptr; - } - else - { - std::string - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptionalClassName = - "java/lang/Integer"; - std::string - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptionalCtorSignature = - "(I)V"; - jint jninewElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional = - static_cast(entry_2.temperatureControl.Value().heatingTempSetpoint.Value().Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptionalClassName - .c_str(), - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptionalCtorSignature - .c_str(), - jninewElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional, - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional); - } - chip::JniReferences::GetInstance().CreateOptional( - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional, - newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); - } - - jclass temperatureControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct", - temperatureControlStructStructClass_5); - if (err != CHIP_NO_ERROR) - { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct"); - return nullptr; - } - jmethodID temperatureControlStructStructCtor_5 = - env->GetMethodID(temperatureControlStructStructClass_5, "", - "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V"); - if (temperatureControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct constructor"); - return nullptr; - } - - newElement_2_temperatureControlInsideOptional = - env->NewObject(temperatureControlStructStructClass_5, temperatureControlStructStructCtor_5, - newElement_2_temperatureControlInsideOptional_coolingTempOffset, - newElement_2_temperatureControlInsideOptional_heatingtTempOffset, - newElement_2_temperatureControlInsideOptional_coolingTempSetpoint, - newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_temperatureControlInsideOptional, - newElement_2_temperatureControl); - } - jobject newElement_2_averageLoadControl; - if (!entry_2.averageLoadControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_averageLoadControl); - } - else - { - jobject newElement_2_averageLoadControlInsideOptional; - jobject newElement_2_averageLoadControlInsideOptional_loadAdjustment; - std::string newElement_2_averageLoadControlInsideOptional_loadAdjustmentClassName = "java/lang/Integer"; - std::string newElement_2_averageLoadControlInsideOptional_loadAdjustmentCtorSignature = "(I)V"; - jint jninewElement_2_averageLoadControlInsideOptional_loadAdjustment = - static_cast(entry_2.averageLoadControl.Value().loadAdjustment); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_averageLoadControlInsideOptional_loadAdjustmentClassName.c_str(), - newElement_2_averageLoadControlInsideOptional_loadAdjustmentCtorSignature.c_str(), - jninewElement_2_averageLoadControlInsideOptional_loadAdjustment, - newElement_2_averageLoadControlInsideOptional_loadAdjustment); - - jclass averageLoadControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct", - averageLoadControlStructStructClass_5); - if (err != CHIP_NO_ERROR) - { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct"); - return nullptr; - } - jmethodID averageLoadControlStructStructCtor_5 = - env->GetMethodID(averageLoadControlStructStructClass_5, "", "(Ljava/lang/Integer;)V"); - if (averageLoadControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct constructor"); - return nullptr; - } - - newElement_2_averageLoadControlInsideOptional = - env->NewObject(averageLoadControlStructStructClass_5, averageLoadControlStructStructCtor_5, - newElement_2_averageLoadControlInsideOptional_loadAdjustment); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_averageLoadControlInsideOptional, - newElement_2_averageLoadControl); - } - jobject newElement_2_dutyCycleControl; - if (!entry_2.dutyCycleControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_dutyCycleControl); - } - else - { - jobject newElement_2_dutyCycleControlInsideOptional; - jobject newElement_2_dutyCycleControlInsideOptional_dutyCycle; - std::string newElement_2_dutyCycleControlInsideOptional_dutyCycleClassName = "java/lang/Integer"; - std::string newElement_2_dutyCycleControlInsideOptional_dutyCycleCtorSignature = "(I)V"; - jint jninewElement_2_dutyCycleControlInsideOptional_dutyCycle = - static_cast(entry_2.dutyCycleControl.Value().dutyCycle); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_dutyCycleControlInsideOptional_dutyCycleClassName.c_str(), - newElement_2_dutyCycleControlInsideOptional_dutyCycleCtorSignature.c_str(), - jninewElement_2_dutyCycleControlInsideOptional_dutyCycle, - newElement_2_dutyCycleControlInsideOptional_dutyCycle); - - jclass dutyCycleControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct", - dutyCycleControlStructStructClass_5); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct"); - return nullptr; - } - jmethodID dutyCycleControlStructStructCtor_5 = - env->GetMethodID(dutyCycleControlStructStructClass_5, "", "(Ljava/lang/Integer;)V"); - if (dutyCycleControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct constructor"); - return nullptr; - } - - newElement_2_dutyCycleControlInsideOptional = - env->NewObject(dutyCycleControlStructStructClass_5, dutyCycleControlStructStructCtor_5, - newElement_2_dutyCycleControlInsideOptional_dutyCycle); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_dutyCycleControlInsideOptional, - newElement_2_dutyCycleControl); - } - jobject newElement_2_powerSavingsControl; - if (!entry_2.powerSavingsControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_powerSavingsControl); - } - else - { - jobject newElement_2_powerSavingsControlInsideOptional; - jobject newElement_2_powerSavingsControlInsideOptional_powerSavings; - std::string newElement_2_powerSavingsControlInsideOptional_powerSavingsClassName = "java/lang/Integer"; - std::string newElement_2_powerSavingsControlInsideOptional_powerSavingsCtorSignature = "(I)V"; - jint jninewElement_2_powerSavingsControlInsideOptional_powerSavings = - static_cast(entry_2.powerSavingsControl.Value().powerSavings); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_powerSavingsControlInsideOptional_powerSavingsClassName.c_str(), - newElement_2_powerSavingsControlInsideOptional_powerSavingsCtorSignature.c_str(), - jninewElement_2_powerSavingsControlInsideOptional_powerSavings, - newElement_2_powerSavingsControlInsideOptional_powerSavings); - - jclass powerSavingsControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct", - powerSavingsControlStructStructClass_5); - if (err != CHIP_NO_ERROR) - { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct"); - return nullptr; - } - jmethodID powerSavingsControlStructStructCtor_5 = - env->GetMethodID(powerSavingsControlStructStructClass_5, "", "(Ljava/lang/Integer;)V"); - if (powerSavingsControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct constructor"); - return nullptr; - } - - newElement_2_powerSavingsControlInsideOptional = - env->NewObject(powerSavingsControlStructStructClass_5, powerSavingsControlStructStructCtor_5, - newElement_2_powerSavingsControlInsideOptional_powerSavings); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_powerSavingsControlInsideOptional, - newElement_2_powerSavingsControl); - } - jobject newElement_2_heatingSourceControl; - if (!entry_2.heatingSourceControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_heatingSourceControl); - } - else - { - jobject newElement_2_heatingSourceControlInsideOptional; - jobject newElement_2_heatingSourceControlInsideOptional_heatingSource; - std::string newElement_2_heatingSourceControlInsideOptional_heatingSourceClassName = "java/lang/Integer"; - std::string newElement_2_heatingSourceControlInsideOptional_heatingSourceCtorSignature = "(I)V"; - jint jninewElement_2_heatingSourceControlInsideOptional_heatingSource = - static_cast(entry_2.heatingSourceControl.Value().heatingSource); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_heatingSourceControlInsideOptional_heatingSourceClassName.c_str(), - newElement_2_heatingSourceControlInsideOptional_heatingSourceCtorSignature.c_str(), - jninewElement_2_heatingSourceControlInsideOptional_heatingSource, - newElement_2_heatingSourceControlInsideOptional_heatingSource); - - jclass heatingSourceControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct", - heatingSourceControlStructStructClass_5); - if (err != CHIP_NO_ERROR) - { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct"); - return nullptr; - } - jmethodID heatingSourceControlStructStructCtor_5 = - env->GetMethodID(heatingSourceControlStructStructClass_5, "", "(Ljava/lang/Integer;)V"); - if (heatingSourceControlStructStructCtor_5 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct " - "constructor"); - return nullptr; - } - - newElement_2_heatingSourceControlInsideOptional = - env->NewObject(heatingSourceControlStructStructClass_5, heatingSourceControlStructStructCtor_5, - newElement_2_heatingSourceControlInsideOptional_heatingSource); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_heatingSourceControlInsideOptional, - newElement_2_heatingSourceControl); - } - - jclass loadControlEventTransitionStructStructClass_3; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct", - loadControlEventTransitionStructStructClass_3); - if (err != CHIP_NO_ERROR) - { - ChipLogError( - Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct"); - return nullptr; - } - jmethodID loadControlEventTransitionStructStructCtor_3 = - env->GetMethodID(loadControlEventTransitionStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/" - "util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V"); - if (loadControlEventTransitionStructStructCtor_3 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct " - "constructor"); - return nullptr; - } - - newElement_2 = - env->NewObject(loadControlEventTransitionStructStructClass_3, loadControlEventTransitionStructStructCtor_3, - newElement_2_duration, newElement_2_control, newElement_2_temperatureControl, - newElement_2_averageLoadControl, newElement_2_dutyCycleControl, - newElement_2_powerSavingsControl, newElement_2_heatingSourceControl); - chip::JniReferences::GetInstance().AddToList(newElement_0_transitions, newElement_2); - } - - jclass loadControlEventStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct", - loadControlEventStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct"); - return nullptr; - } - jmethodID loadControlEventStructStructCtor_1 = - env->GetMethodID(loadControlEventStructStructClass_1, "", - "([B[BLjava/lang/Integer;Ljava/lang/Long;Ljava/util/Optional;Ljava/lang/Integer;Ljava/lang/" - "Long;Ljava/util/ArrayList;)V"); - if (loadControlEventStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct constructor"); - return nullptr; - } - - newElement_0 = env->NewObject(loadControlEventStructStructClass_1, loadControlEventStructStructCtor_1, - newElement_0_eventID, newElement_0_programID, newElement_0_control, - newElement_0_deviceClass, newElement_0_enrollmentGroup, newElement_0_criticality, - newElement_0_startTime, newElement_0_transitions); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::ActiveEvents::Id: { - using TypeInfo = Attributes::ActiveEvents::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; - jobject newElement_0_eventID; - jbyteArray newElement_0_eventIDByteArray = env->NewByteArray(static_cast(entry_0.eventID.size())); - env->SetByteArrayRegion(newElement_0_eventIDByteArray, 0, static_cast(entry_0.eventID.size()), - reinterpret_cast(entry_0.eventID.data())); - newElement_0_eventID = newElement_0_eventIDByteArray; - jobject newElement_0_programID; - if (entry_0.programID.IsNull()) - { - newElement_0_programID = nullptr; - } - else - { - jbyteArray newElement_0_programIDByteArray = - env->NewByteArray(static_cast(entry_0.programID.Value().size())); - env->SetByteArrayRegion(newElement_0_programIDByteArray, 0, - static_cast(entry_0.programID.Value().size()), - reinterpret_cast(entry_0.programID.Value().data())); - newElement_0_programID = newElement_0_programIDByteArray; - } - jobject newElement_0_control; - std::string newElement_0_controlClassName = "java/lang/Integer"; - std::string newElement_0_controlCtorSignature = "(I)V"; - jint jninewElement_0_control = static_cast(entry_0.control.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_controlClassName.c_str(), - newElement_0_controlCtorSignature.c_str(), - jninewElement_0_control, newElement_0_control); - jobject newElement_0_deviceClass; - std::string newElement_0_deviceClassClassName = "java/lang/Long"; - std::string newElement_0_deviceClassCtorSignature = "(J)V"; - jlong jninewElement_0_deviceClass = static_cast(entry_0.deviceClass.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_deviceClassClassName.c_str(), - newElement_0_deviceClassCtorSignature.c_str(), - jninewElement_0_deviceClass, newElement_0_deviceClass); - jobject newElement_0_enrollmentGroup; - if (!entry_0.enrollmentGroup.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_enrollmentGroup); - } - else - { - jobject newElement_0_enrollmentGroupInsideOptional; - std::string newElement_0_enrollmentGroupInsideOptionalClassName = "java/lang/Integer"; - std::string newElement_0_enrollmentGroupInsideOptionalCtorSignature = "(I)V"; - jint jninewElement_0_enrollmentGroupInsideOptional = static_cast(entry_0.enrollmentGroup.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_enrollmentGroupInsideOptionalClassName.c_str(), - newElement_0_enrollmentGroupInsideOptionalCtorSignature.c_str(), - jninewElement_0_enrollmentGroupInsideOptional, newElement_0_enrollmentGroupInsideOptional); - chip::JniReferences::GetInstance().CreateOptional(newElement_0_enrollmentGroupInsideOptional, - newElement_0_enrollmentGroup); - } - jobject newElement_0_criticality; - std::string newElement_0_criticalityClassName = "java/lang/Integer"; - std::string newElement_0_criticalityCtorSignature = "(I)V"; - jint jninewElement_0_criticality = static_cast(entry_0.criticality); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_criticalityClassName.c_str(), - newElement_0_criticalityCtorSignature.c_str(), - jninewElement_0_criticality, newElement_0_criticality); - jobject newElement_0_startTime; - if (entry_0.startTime.IsNull()) - { - newElement_0_startTime = nullptr; - } - else - { - std::string newElement_0_startTimeClassName = "java/lang/Long"; - std::string newElement_0_startTimeCtorSignature = "(J)V"; - jlong jninewElement_0_startTime = static_cast(entry_0.startTime.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_startTimeClassName.c_str(), - newElement_0_startTimeCtorSignature.c_str(), - jninewElement_0_startTime, newElement_0_startTime); - } - jobject newElement_0_transitions; - chip::JniReferences::GetInstance().CreateArrayList(newElement_0_transitions); - - auto iter_newElement_0_transitions_2 = entry_0.transitions.begin(); - while (iter_newElement_0_transitions_2.Next()) - { - auto & entry_2 = iter_newElement_0_transitions_2.GetValue(); - jobject newElement_2; - jobject newElement_2_duration; - std::string newElement_2_durationClassName = "java/lang/Integer"; - std::string newElement_2_durationCtorSignature = "(I)V"; - jint jninewElement_2_duration = static_cast(entry_2.duration); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_durationClassName.c_str(), - newElement_2_durationCtorSignature.c_str(), - jninewElement_2_duration, newElement_2_duration); - jobject newElement_2_control; - std::string newElement_2_controlClassName = "java/lang/Integer"; - std::string newElement_2_controlCtorSignature = "(I)V"; - jint jninewElement_2_control = static_cast(entry_2.control.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_controlClassName.c_str(), - newElement_2_controlCtorSignature.c_str(), - jninewElement_2_control, newElement_2_control); - jobject newElement_2_temperatureControl; - if (!entry_2.temperatureControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_temperatureControl); - } - else - { - jobject newElement_2_temperatureControlInsideOptional; - jobject newElement_2_temperatureControlInsideOptional_coolingTempOffset; - if (!entry_2.temperatureControl.Value().coolingTempOffset.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional( - nullptr, newElement_2_temperatureControlInsideOptional_coolingTempOffset); - } - else - { - jobject newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional; - if (entry_2.temperatureControl.Value().coolingTempOffset.Value().IsNull()) - { - newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional = nullptr; - } - else - { - std::string newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptionalClassName = - "java/lang/Integer"; - std::string - newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptionalCtorSignature = - "(I)V"; - jint jninewElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional = - static_cast(entry_2.temperatureControl.Value().coolingTempOffset.Value().Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptionalClassName.c_str(), - newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptionalCtorSignature - .c_str(), - jninewElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional, - newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional); - } - chip::JniReferences::GetInstance().CreateOptional( - newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional, - newElement_2_temperatureControlInsideOptional_coolingTempOffset); - } - jobject newElement_2_temperatureControlInsideOptional_heatingtTempOffset; - if (!entry_2.temperatureControl.Value().heatingtTempOffset.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional( - nullptr, newElement_2_temperatureControlInsideOptional_heatingtTempOffset); - } - else - { - jobject newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional; - if (entry_2.temperatureControl.Value().heatingtTempOffset.Value().IsNull()) - { - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional = nullptr; - } - else - { - std::string - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptionalClassName = - "java/lang/Integer"; - std::string - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptionalCtorSignature = - "(I)V"; - jint jninewElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional = - static_cast(entry_2.temperatureControl.Value().heatingtTempOffset.Value().Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptionalClassName.c_str(), - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptionalCtorSignature - .c_str(), - jninewElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional, - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional); - } - chip::JniReferences::GetInstance().CreateOptional( - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional, - newElement_2_temperatureControlInsideOptional_heatingtTempOffset); - } - jobject newElement_2_temperatureControlInsideOptional_coolingTempSetpoint; - if (!entry_2.temperatureControl.Value().coolingTempSetpoint.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional( - nullptr, newElement_2_temperatureControlInsideOptional_coolingTempSetpoint); - } - else - { - jobject newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional; - if (entry_2.temperatureControl.Value().coolingTempSetpoint.Value().IsNull()) - { - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional = nullptr; - } - else - { - std::string - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptionalClassName = - "java/lang/Integer"; - std::string - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptionalCtorSignature = - "(I)V"; - jint jninewElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional = - static_cast(entry_2.temperatureControl.Value().coolingTempSetpoint.Value().Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptionalClassName - .c_str(), - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptionalCtorSignature - .c_str(), - jninewElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional, - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional); - } - chip::JniReferences::GetInstance().CreateOptional( - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional, - newElement_2_temperatureControlInsideOptional_coolingTempSetpoint); - } - jobject newElement_2_temperatureControlInsideOptional_heatingTempSetpoint; - if (!entry_2.temperatureControl.Value().heatingTempSetpoint.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional( - nullptr, newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); - } - else - { - jobject newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional; - if (entry_2.temperatureControl.Value().heatingTempSetpoint.Value().IsNull()) - { - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional = nullptr; - } - else - { - std::string - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptionalClassName = - "java/lang/Integer"; - std::string - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptionalCtorSignature = - "(I)V"; - jint jninewElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional = - static_cast(entry_2.temperatureControl.Value().heatingTempSetpoint.Value().Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptionalClassName - .c_str(), - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptionalCtorSignature - .c_str(), - jninewElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional, - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional); - } - chip::JniReferences::GetInstance().CreateOptional( - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional, - newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); - } - - jclass temperatureControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct", - temperatureControlStructStructClass_5); - if (err != CHIP_NO_ERROR) - { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct"); - return nullptr; - } - jmethodID temperatureControlStructStructCtor_5 = - env->GetMethodID(temperatureControlStructStructClass_5, "", - "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V"); - if (temperatureControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct constructor"); - return nullptr; - } - - newElement_2_temperatureControlInsideOptional = - env->NewObject(temperatureControlStructStructClass_5, temperatureControlStructStructCtor_5, - newElement_2_temperatureControlInsideOptional_coolingTempOffset, - newElement_2_temperatureControlInsideOptional_heatingtTempOffset, - newElement_2_temperatureControlInsideOptional_coolingTempSetpoint, - newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_temperatureControlInsideOptional, - newElement_2_temperatureControl); - } - jobject newElement_2_averageLoadControl; - if (!entry_2.averageLoadControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_averageLoadControl); - } - else - { - jobject newElement_2_averageLoadControlInsideOptional; - jobject newElement_2_averageLoadControlInsideOptional_loadAdjustment; - std::string newElement_2_averageLoadControlInsideOptional_loadAdjustmentClassName = "java/lang/Integer"; - std::string newElement_2_averageLoadControlInsideOptional_loadAdjustmentCtorSignature = "(I)V"; - jint jninewElement_2_averageLoadControlInsideOptional_loadAdjustment = - static_cast(entry_2.averageLoadControl.Value().loadAdjustment); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_averageLoadControlInsideOptional_loadAdjustmentClassName.c_str(), - newElement_2_averageLoadControlInsideOptional_loadAdjustmentCtorSignature.c_str(), - jninewElement_2_averageLoadControlInsideOptional_loadAdjustment, - newElement_2_averageLoadControlInsideOptional_loadAdjustment); - - jclass averageLoadControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct", - averageLoadControlStructStructClass_5); - if (err != CHIP_NO_ERROR) - { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct"); - return nullptr; - } - jmethodID averageLoadControlStructStructCtor_5 = - env->GetMethodID(averageLoadControlStructStructClass_5, "", "(Ljava/lang/Integer;)V"); - if (averageLoadControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct constructor"); - return nullptr; - } - - newElement_2_averageLoadControlInsideOptional = - env->NewObject(averageLoadControlStructStructClass_5, averageLoadControlStructStructCtor_5, - newElement_2_averageLoadControlInsideOptional_loadAdjustment); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_averageLoadControlInsideOptional, - newElement_2_averageLoadControl); - } - jobject newElement_2_dutyCycleControl; - if (!entry_2.dutyCycleControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_dutyCycleControl); - } - else - { - jobject newElement_2_dutyCycleControlInsideOptional; - jobject newElement_2_dutyCycleControlInsideOptional_dutyCycle; - std::string newElement_2_dutyCycleControlInsideOptional_dutyCycleClassName = "java/lang/Integer"; - std::string newElement_2_dutyCycleControlInsideOptional_dutyCycleCtorSignature = "(I)V"; - jint jninewElement_2_dutyCycleControlInsideOptional_dutyCycle = - static_cast(entry_2.dutyCycleControl.Value().dutyCycle); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_dutyCycleControlInsideOptional_dutyCycleClassName.c_str(), - newElement_2_dutyCycleControlInsideOptional_dutyCycleCtorSignature.c_str(), - jninewElement_2_dutyCycleControlInsideOptional_dutyCycle, - newElement_2_dutyCycleControlInsideOptional_dutyCycle); - - jclass dutyCycleControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct", - dutyCycleControlStructStructClass_5); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct"); - return nullptr; - } - jmethodID dutyCycleControlStructStructCtor_5 = - env->GetMethodID(dutyCycleControlStructStructClass_5, "", "(Ljava/lang/Integer;)V"); - if (dutyCycleControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct constructor"); - return nullptr; - } - - newElement_2_dutyCycleControlInsideOptional = - env->NewObject(dutyCycleControlStructStructClass_5, dutyCycleControlStructStructCtor_5, - newElement_2_dutyCycleControlInsideOptional_dutyCycle); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_dutyCycleControlInsideOptional, - newElement_2_dutyCycleControl); - } - jobject newElement_2_powerSavingsControl; - if (!entry_2.powerSavingsControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_powerSavingsControl); - } - else - { - jobject newElement_2_powerSavingsControlInsideOptional; - jobject newElement_2_powerSavingsControlInsideOptional_powerSavings; - std::string newElement_2_powerSavingsControlInsideOptional_powerSavingsClassName = "java/lang/Integer"; - std::string newElement_2_powerSavingsControlInsideOptional_powerSavingsCtorSignature = "(I)V"; - jint jninewElement_2_powerSavingsControlInsideOptional_powerSavings = - static_cast(entry_2.powerSavingsControl.Value().powerSavings); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_powerSavingsControlInsideOptional_powerSavingsClassName.c_str(), - newElement_2_powerSavingsControlInsideOptional_powerSavingsCtorSignature.c_str(), - jninewElement_2_powerSavingsControlInsideOptional_powerSavings, - newElement_2_powerSavingsControlInsideOptional_powerSavings); - - jclass powerSavingsControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct", - powerSavingsControlStructStructClass_5); - if (err != CHIP_NO_ERROR) - { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct"); - return nullptr; - } - jmethodID powerSavingsControlStructStructCtor_5 = - env->GetMethodID(powerSavingsControlStructStructClass_5, "", "(Ljava/lang/Integer;)V"); - if (powerSavingsControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct constructor"); - return nullptr; - } - - newElement_2_powerSavingsControlInsideOptional = - env->NewObject(powerSavingsControlStructStructClass_5, powerSavingsControlStructStructCtor_5, - newElement_2_powerSavingsControlInsideOptional_powerSavings); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_powerSavingsControlInsideOptional, - newElement_2_powerSavingsControl); - } - jobject newElement_2_heatingSourceControl; - if (!entry_2.heatingSourceControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_heatingSourceControl); - } - else - { - jobject newElement_2_heatingSourceControlInsideOptional; - jobject newElement_2_heatingSourceControlInsideOptional_heatingSource; - std::string newElement_2_heatingSourceControlInsideOptional_heatingSourceClassName = "java/lang/Integer"; - std::string newElement_2_heatingSourceControlInsideOptional_heatingSourceCtorSignature = "(I)V"; - jint jninewElement_2_heatingSourceControlInsideOptional_heatingSource = - static_cast(entry_2.heatingSourceControl.Value().heatingSource); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_heatingSourceControlInsideOptional_heatingSourceClassName.c_str(), - newElement_2_heatingSourceControlInsideOptional_heatingSourceCtorSignature.c_str(), - jninewElement_2_heatingSourceControlInsideOptional_heatingSource, - newElement_2_heatingSourceControlInsideOptional_heatingSource); - - jclass heatingSourceControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct", - heatingSourceControlStructStructClass_5); - if (err != CHIP_NO_ERROR) - { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct"); - return nullptr; - } - jmethodID heatingSourceControlStructStructCtor_5 = - env->GetMethodID(heatingSourceControlStructStructClass_5, "", "(Ljava/lang/Integer;)V"); - if (heatingSourceControlStructStructCtor_5 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct " - "constructor"); - return nullptr; - } - - newElement_2_heatingSourceControlInsideOptional = - env->NewObject(heatingSourceControlStructStructClass_5, heatingSourceControlStructStructCtor_5, - newElement_2_heatingSourceControlInsideOptional_heatingSource); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_heatingSourceControlInsideOptional, - newElement_2_heatingSourceControl); - } - - jclass loadControlEventTransitionStructStructClass_3; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct", - loadControlEventTransitionStructStructClass_3); - if (err != CHIP_NO_ERROR) - { - ChipLogError( - Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct"); - return nullptr; - } - jmethodID loadControlEventTransitionStructStructCtor_3 = - env->GetMethodID(loadControlEventTransitionStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/" - "util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V"); - if (loadControlEventTransitionStructStructCtor_3 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct " - "constructor"); - return nullptr; - } - - newElement_2 = - env->NewObject(loadControlEventTransitionStructStructClass_3, loadControlEventTransitionStructStructCtor_3, - newElement_2_duration, newElement_2_control, newElement_2_temperatureControl, - newElement_2_averageLoadControl, newElement_2_dutyCycleControl, - newElement_2_powerSavingsControl, newElement_2_heatingSourceControl); - chip::JniReferences::GetInstance().AddToList(newElement_0_transitions, newElement_2); - } - - jclass loadControlEventStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct", - loadControlEventStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct"); - return nullptr; - } - jmethodID loadControlEventStructStructCtor_1 = - env->GetMethodID(loadControlEventStructStructClass_1, "", - "([B[BLjava/lang/Integer;Ljava/lang/Long;Ljava/util/Optional;Ljava/lang/Integer;Ljava/lang/" - "Long;Ljava/util/ArrayList;)V"); - if (loadControlEventStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct constructor"); - return nullptr; - } - - newElement_0 = env->NewObject(loadControlEventStructStructClass_1, loadControlEventStructStructCtor_1, - newElement_0_eventID, newElement_0_programID, newElement_0_control, - newElement_0_deviceClass, newElement_0_enrollmentGroup, newElement_0_criticality, - newElement_0_startTime, newElement_0_transitions); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::NumberOfEventsPerProgram::Id: { - using TypeInfo = Attributes::NumberOfEventsPerProgram::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::NumberOfTransistions::Id: { - using TypeInfo = Attributes::NumberOfTransistions::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::DefaultRandomStart::Id: { - using TypeInfo = Attributes::DefaultRandomStart::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::DefaultRandomDuration::Id: { - using TypeInfo = Attributes::DefaultRandomDuration::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - jlong jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - break; - } - break; - } case app::Clusters::DoorLock::Id: { using namespace app::Clusters::DoorLock; switch (aPath.mAttributeId) diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 9a0482f90238ac..12b4b404e4f252 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -2479,8 +2479,8 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } - case app::Clusters::Timer::Id: { - using namespace app::Clusters::Timer; + case app::Clusters::LaundryDryerControls::Id: { + using namespace app::Clusters::LaundryDryerControls; switch (aPath.mEventId) { default: @@ -3467,645 +3467,6 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } - case app::Clusters::BooleanSensorConfiguration::Id: { - using namespace app::Clusters::BooleanSensorConfiguration; - switch (aPath.mEventId) - { - case Events::AlarmsStateChanged::Id: { - Events::AlarmsStateChanged::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value_alarmsActive; - std::string value_alarmsActiveClassName = "java/lang/Integer"; - std::string value_alarmsActiveCtorSignature = "(I)V"; - jint jnivalue_alarmsActive = static_cast(cppValue.alarmsActive.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject(value_alarmsActiveClassName.c_str(), - value_alarmsActiveCtorSignature.c_str(), - jnivalue_alarmsActive, value_alarmsActive); - - jobject value_alarmsSuppressed; - if (!cppValue.alarmsSuppressed.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, value_alarmsSuppressed); - } - else - { - jobject value_alarmsSuppressedInsideOptional; - std::string value_alarmsSuppressedInsideOptionalClassName = "java/lang/Integer"; - std::string value_alarmsSuppressedInsideOptionalCtorSignature = "(I)V"; - jint jnivalue_alarmsSuppressedInsideOptional = static_cast(cppValue.alarmsSuppressed.Value().Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject( - value_alarmsSuppressedInsideOptionalClassName.c_str(), - value_alarmsSuppressedInsideOptionalCtorSignature.c_str(), jnivalue_alarmsSuppressedInsideOptional, - value_alarmsSuppressedInsideOptional); - chip::JniReferences::GetInstance().CreateOptional(value_alarmsSuppressedInsideOptional, value_alarmsSuppressed); - } - - jclass alarmsStateChangedStructClass; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipEventStructs$BooleanSensorConfigurationClusterAlarmsStateChangedEvent", - alarmsStateChangedStructClass); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipEventStructs$BooleanSensorConfigurationClusterAlarmsStateChangedEvent"); - return nullptr; - } - jmethodID alarmsStateChangedStructCtor = - env->GetMethodID(alarmsStateChangedStructClass, "", "(Ljava/lang/Integer;Ljava/util/Optional;)V"); - if (alarmsStateChangedStructCtor == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipEventStructs$BooleanSensorConfigurationClusterAlarmsStateChangedEvent constructor"); - return nullptr; - } - - jobject value = env->NewObject(alarmsStateChangedStructClass, alarmsStateChangedStructCtor, value_alarmsActive, - value_alarmsSuppressed); - - return value; - } - case Events::SensorFault::Id: { - Events::SensorFault::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jclass sensorFaultStructClass; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipEventStructs$BooleanSensorConfigurationClusterSensorFaultEvent", - sensorFaultStructClass); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipEventStructs$BooleanSensorConfigurationClusterSensorFaultEvent"); - return nullptr; - } - jmethodID sensorFaultStructCtor = env->GetMethodID(sensorFaultStructClass, "", "()V"); - if (sensorFaultStructCtor == nullptr) - { - ChipLogError(Zcl, "Could not find ChipEventStructs$BooleanSensorConfigurationClusterSensorFaultEvent constructor"); - return nullptr; - } - - jobject value = env->NewObject(sensorFaultStructClass, sensorFaultStructCtor); - - return value; - } - default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; - break; - } - break; - } - case app::Clusters::ValveConfigurationAndControl::Id: { - using namespace app::Clusters::ValveConfigurationAndControl; - switch (aPath.mEventId) - { - case Events::ValveStateChanged::Id: { - Events::ValveStateChanged::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value_valveState; - std::string value_valveStateClassName = "java/lang/Integer"; - std::string value_valveStateCtorSignature = "(I)V"; - jint jnivalue_valveState = static_cast(cppValue.valveState); - chip::JniReferences::GetInstance().CreateBoxedObject( - value_valveStateClassName.c_str(), value_valveStateCtorSignature.c_str(), jnivalue_valveState, value_valveState); - - jclass valveStateChangedStructClass; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipEventStructs$ValveConfigurationAndControlClusterValveStateChangedEvent", - valveStateChangedStructClass); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, - "Could not find class ChipEventStructs$ValveConfigurationAndControlClusterValveStateChangedEvent"); - return nullptr; - } - jmethodID valveStateChangedStructCtor = - env->GetMethodID(valveStateChangedStructClass, "", "(Ljava/lang/Integer;)V"); - if (valveStateChangedStructCtor == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipEventStructs$ValveConfigurationAndControlClusterValveStateChangedEvent constructor"); - return nullptr; - } - - jobject value = env->NewObject(valveStateChangedStructClass, valveStateChangedStructCtor, value_valveState); - - return value; - } - case Events::ValveFault::Id: { - Events::ValveFault::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value_valveFault; - std::string value_valveFaultClassName = "java/lang/Integer"; - std::string value_valveFaultCtorSignature = "(I)V"; - jint jnivalue_valveFault = static_cast(cppValue.valveFault.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject( - value_valveFaultClassName.c_str(), value_valveFaultCtorSignature.c_str(), jnivalue_valveFault, value_valveFault); - - jclass valveFaultStructClass; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipEventStructs$ValveConfigurationAndControlClusterValveFaultEvent", - valveFaultStructClass); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipEventStructs$ValveConfigurationAndControlClusterValveFaultEvent"); - return nullptr; - } - jmethodID valveFaultStructCtor = env->GetMethodID(valveFaultStructClass, "", "(Ljava/lang/Integer;)V"); - if (valveFaultStructCtor == nullptr) - { - ChipLogError(Zcl, "Could not find ChipEventStructs$ValveConfigurationAndControlClusterValveFaultEvent constructor"); - return nullptr; - } - - jobject value = env->NewObject(valveFaultStructClass, valveFaultStructCtor, value_valveFault); - - return value; - } - default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; - break; - } - break; - } - case app::Clusters::DemandResponseLoadControl::Id: { - using namespace app::Clusters::DemandResponseLoadControl; - switch (aPath.mEventId) - { - case Events::LoadControlEventStatusChange::Id: { - Events::LoadControlEventStatusChange::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value_eventID; - jbyteArray value_eventIDByteArray = env->NewByteArray(static_cast(cppValue.eventID.size())); - env->SetByteArrayRegion(value_eventIDByteArray, 0, static_cast(cppValue.eventID.size()), - reinterpret_cast(cppValue.eventID.data())); - value_eventID = value_eventIDByteArray; - - jobject value_transitionIndex; - if (cppValue.transitionIndex.IsNull()) - { - value_transitionIndex = nullptr; - } - else - { - std::string value_transitionIndexClassName = "java/lang/Integer"; - std::string value_transitionIndexCtorSignature = "(I)V"; - jint jnivalue_transitionIndex = static_cast(cppValue.transitionIndex.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(value_transitionIndexClassName.c_str(), - value_transitionIndexCtorSignature.c_str(), - jnivalue_transitionIndex, value_transitionIndex); - } - - jobject value_status; - std::string value_statusClassName = "java/lang/Integer"; - std::string value_statusCtorSignature = "(I)V"; - jint jnivalue_status = static_cast(cppValue.status); - chip::JniReferences::GetInstance().CreateBoxedObject( - value_statusClassName.c_str(), value_statusCtorSignature.c_str(), jnivalue_status, value_status); - - jobject value_criticality; - std::string value_criticalityClassName = "java/lang/Integer"; - std::string value_criticalityCtorSignature = "(I)V"; - jint jnivalue_criticality = static_cast(cppValue.criticality); - chip::JniReferences::GetInstance().CreateBoxedObject(value_criticalityClassName.c_str(), - value_criticalityCtorSignature.c_str(), jnivalue_criticality, - value_criticality); - - jobject value_control; - std::string value_controlClassName = "java/lang/Integer"; - std::string value_controlCtorSignature = "(I)V"; - jint jnivalue_control = static_cast(cppValue.control.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject( - value_controlClassName.c_str(), value_controlCtorSignature.c_str(), jnivalue_control, value_control); - - jobject value_temperatureControl; - if (!cppValue.temperatureControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, value_temperatureControl); - } - else - { - jobject value_temperatureControlInsideOptional; - if (cppValue.temperatureControl.Value().IsNull()) - { - value_temperatureControlInsideOptional = nullptr; - } - else - { - jobject value_temperatureControlInsideOptional_coolingTempOffset; - if (!cppValue.temperatureControl.Value().Value().coolingTempOffset.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, - value_temperatureControlInsideOptional_coolingTempOffset); - } - else - { - jobject value_temperatureControlInsideOptional_coolingTempOffsetInsideOptional; - if (cppValue.temperatureControl.Value().Value().coolingTempOffset.Value().IsNull()) - { - value_temperatureControlInsideOptional_coolingTempOffsetInsideOptional = nullptr; - } - else - { - std::string value_temperatureControlInsideOptional_coolingTempOffsetInsideOptionalClassName = - "java/lang/Integer"; - std::string value_temperatureControlInsideOptional_coolingTempOffsetInsideOptionalCtorSignature = - "(I)V"; - jint jnivalue_temperatureControlInsideOptional_coolingTempOffsetInsideOptional = - static_cast(cppValue.temperatureControl.Value().Value().coolingTempOffset.Value().Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - value_temperatureControlInsideOptional_coolingTempOffsetInsideOptionalClassName.c_str(), - value_temperatureControlInsideOptional_coolingTempOffsetInsideOptionalCtorSignature.c_str(), - jnivalue_temperatureControlInsideOptional_coolingTempOffsetInsideOptional, - value_temperatureControlInsideOptional_coolingTempOffsetInsideOptional); - } - chip::JniReferences::GetInstance().CreateOptional( - value_temperatureControlInsideOptional_coolingTempOffsetInsideOptional, - value_temperatureControlInsideOptional_coolingTempOffset); - } - jobject value_temperatureControlInsideOptional_heatingtTempOffset; - if (!cppValue.temperatureControl.Value().Value().heatingtTempOffset.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional( - nullptr, value_temperatureControlInsideOptional_heatingtTempOffset); - } - else - { - jobject value_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional; - if (cppValue.temperatureControl.Value().Value().heatingtTempOffset.Value().IsNull()) - { - value_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional = nullptr; - } - else - { - std::string value_temperatureControlInsideOptional_heatingtTempOffsetInsideOptionalClassName = - "java/lang/Integer"; - std::string value_temperatureControlInsideOptional_heatingtTempOffsetInsideOptionalCtorSignature = - "(I)V"; - jint jnivalue_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional = - static_cast(cppValue.temperatureControl.Value().Value().heatingtTempOffset.Value().Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - value_temperatureControlInsideOptional_heatingtTempOffsetInsideOptionalClassName.c_str(), - value_temperatureControlInsideOptional_heatingtTempOffsetInsideOptionalCtorSignature.c_str(), - jnivalue_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional, - value_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional); - } - chip::JniReferences::GetInstance().CreateOptional( - value_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional, - value_temperatureControlInsideOptional_heatingtTempOffset); - } - jobject value_temperatureControlInsideOptional_coolingTempSetpoint; - if (!cppValue.temperatureControl.Value().Value().coolingTempSetpoint.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional( - nullptr, value_temperatureControlInsideOptional_coolingTempSetpoint); - } - else - { - jobject value_temperatureControlInsideOptional_coolingTempSetpointInsideOptional; - if (cppValue.temperatureControl.Value().Value().coolingTempSetpoint.Value().IsNull()) - { - value_temperatureControlInsideOptional_coolingTempSetpointInsideOptional = nullptr; - } - else - { - std::string value_temperatureControlInsideOptional_coolingTempSetpointInsideOptionalClassName = - "java/lang/Integer"; - std::string value_temperatureControlInsideOptional_coolingTempSetpointInsideOptionalCtorSignature = - "(I)V"; - jint jnivalue_temperatureControlInsideOptional_coolingTempSetpointInsideOptional = - static_cast(cppValue.temperatureControl.Value().Value().coolingTempSetpoint.Value().Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - value_temperatureControlInsideOptional_coolingTempSetpointInsideOptionalClassName.c_str(), - value_temperatureControlInsideOptional_coolingTempSetpointInsideOptionalCtorSignature.c_str(), - jnivalue_temperatureControlInsideOptional_coolingTempSetpointInsideOptional, - value_temperatureControlInsideOptional_coolingTempSetpointInsideOptional); - } - chip::JniReferences::GetInstance().CreateOptional( - value_temperatureControlInsideOptional_coolingTempSetpointInsideOptional, - value_temperatureControlInsideOptional_coolingTempSetpoint); - } - jobject value_temperatureControlInsideOptional_heatingTempSetpoint; - if (!cppValue.temperatureControl.Value().Value().heatingTempSetpoint.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional( - nullptr, value_temperatureControlInsideOptional_heatingTempSetpoint); - } - else - { - jobject value_temperatureControlInsideOptional_heatingTempSetpointInsideOptional; - if (cppValue.temperatureControl.Value().Value().heatingTempSetpoint.Value().IsNull()) - { - value_temperatureControlInsideOptional_heatingTempSetpointInsideOptional = nullptr; - } - else - { - std::string value_temperatureControlInsideOptional_heatingTempSetpointInsideOptionalClassName = - "java/lang/Integer"; - std::string value_temperatureControlInsideOptional_heatingTempSetpointInsideOptionalCtorSignature = - "(I)V"; - jint jnivalue_temperatureControlInsideOptional_heatingTempSetpointInsideOptional = - static_cast(cppValue.temperatureControl.Value().Value().heatingTempSetpoint.Value().Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - value_temperatureControlInsideOptional_heatingTempSetpointInsideOptionalClassName.c_str(), - value_temperatureControlInsideOptional_heatingTempSetpointInsideOptionalCtorSignature.c_str(), - jnivalue_temperatureControlInsideOptional_heatingTempSetpointInsideOptional, - value_temperatureControlInsideOptional_heatingTempSetpointInsideOptional); - } - chip::JniReferences::GetInstance().CreateOptional( - value_temperatureControlInsideOptional_heatingTempSetpointInsideOptional, - value_temperatureControlInsideOptional_heatingTempSetpoint); - } - - jclass temperatureControlStructStructClass_2; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct", - temperatureControlStructStructClass_2); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct"); - return nullptr; - } - jmethodID temperatureControlStructStructCtor_2 = - env->GetMethodID(temperatureControlStructStructClass_2, "", - "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V"); - if (temperatureControlStructStructCtor_2 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct constructor"); - return nullptr; - } - - value_temperatureControlInsideOptional = - env->NewObject(temperatureControlStructStructClass_2, temperatureControlStructStructCtor_2, - value_temperatureControlInsideOptional_coolingTempOffset, - value_temperatureControlInsideOptional_heatingtTempOffset, - value_temperatureControlInsideOptional_coolingTempSetpoint, - value_temperatureControlInsideOptional_heatingTempSetpoint); - } - chip::JniReferences::GetInstance().CreateOptional(value_temperatureControlInsideOptional, value_temperatureControl); - } - - jobject value_averageLoadControl; - if (!cppValue.averageLoadControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, value_averageLoadControl); - } - else - { - jobject value_averageLoadControlInsideOptional; - if (cppValue.averageLoadControl.Value().IsNull()) - { - value_averageLoadControlInsideOptional = nullptr; - } - else - { - jobject value_averageLoadControlInsideOptional_loadAdjustment; - std::string value_averageLoadControlInsideOptional_loadAdjustmentClassName = "java/lang/Integer"; - std::string value_averageLoadControlInsideOptional_loadAdjustmentCtorSignature = "(I)V"; - jint jnivalue_averageLoadControlInsideOptional_loadAdjustment = - static_cast(cppValue.averageLoadControl.Value().Value().loadAdjustment); - chip::JniReferences::GetInstance().CreateBoxedObject( - value_averageLoadControlInsideOptional_loadAdjustmentClassName.c_str(), - value_averageLoadControlInsideOptional_loadAdjustmentCtorSignature.c_str(), - jnivalue_averageLoadControlInsideOptional_loadAdjustment, - value_averageLoadControlInsideOptional_loadAdjustment); - - jclass averageLoadControlStructStructClass_2; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct", - averageLoadControlStructStructClass_2); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct"); - return nullptr; - } - jmethodID averageLoadControlStructStructCtor_2 = - env->GetMethodID(averageLoadControlStructStructClass_2, "", "(Ljava/lang/Integer;)V"); - if (averageLoadControlStructStructCtor_2 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct constructor"); - return nullptr; - } - - value_averageLoadControlInsideOptional = - env->NewObject(averageLoadControlStructStructClass_2, averageLoadControlStructStructCtor_2, - value_averageLoadControlInsideOptional_loadAdjustment); - } - chip::JniReferences::GetInstance().CreateOptional(value_averageLoadControlInsideOptional, value_averageLoadControl); - } - - jobject value_dutyCycleControl; - if (!cppValue.dutyCycleControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, value_dutyCycleControl); - } - else - { - jobject value_dutyCycleControlInsideOptional; - if (cppValue.dutyCycleControl.Value().IsNull()) - { - value_dutyCycleControlInsideOptional = nullptr; - } - else - { - jobject value_dutyCycleControlInsideOptional_dutyCycle; - std::string value_dutyCycleControlInsideOptional_dutyCycleClassName = "java/lang/Integer"; - std::string value_dutyCycleControlInsideOptional_dutyCycleCtorSignature = "(I)V"; - jint jnivalue_dutyCycleControlInsideOptional_dutyCycle = - static_cast(cppValue.dutyCycleControl.Value().Value().dutyCycle); - chip::JniReferences::GetInstance().CreateBoxedObject( - value_dutyCycleControlInsideOptional_dutyCycleClassName.c_str(), - value_dutyCycleControlInsideOptional_dutyCycleCtorSignature.c_str(), - jnivalue_dutyCycleControlInsideOptional_dutyCycle, value_dutyCycleControlInsideOptional_dutyCycle); - - jclass dutyCycleControlStructStructClass_2; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct", - dutyCycleControlStructStructClass_2); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct"); - return nullptr; - } - jmethodID dutyCycleControlStructStructCtor_2 = - env->GetMethodID(dutyCycleControlStructStructClass_2, "", "(Ljava/lang/Integer;)V"); - if (dutyCycleControlStructStructCtor_2 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct constructor"); - return nullptr; - } - - value_dutyCycleControlInsideOptional = - env->NewObject(dutyCycleControlStructStructClass_2, dutyCycleControlStructStructCtor_2, - value_dutyCycleControlInsideOptional_dutyCycle); - } - chip::JniReferences::GetInstance().CreateOptional(value_dutyCycleControlInsideOptional, value_dutyCycleControl); - } - - jobject value_powerSavingsControl; - if (!cppValue.powerSavingsControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, value_powerSavingsControl); - } - else - { - jobject value_powerSavingsControlInsideOptional; - if (cppValue.powerSavingsControl.Value().IsNull()) - { - value_powerSavingsControlInsideOptional = nullptr; - } - else - { - jobject value_powerSavingsControlInsideOptional_powerSavings; - std::string value_powerSavingsControlInsideOptional_powerSavingsClassName = "java/lang/Integer"; - std::string value_powerSavingsControlInsideOptional_powerSavingsCtorSignature = "(I)V"; - jint jnivalue_powerSavingsControlInsideOptional_powerSavings = - static_cast(cppValue.powerSavingsControl.Value().Value().powerSavings); - chip::JniReferences::GetInstance().CreateBoxedObject( - value_powerSavingsControlInsideOptional_powerSavingsClassName.c_str(), - value_powerSavingsControlInsideOptional_powerSavingsCtorSignature.c_str(), - jnivalue_powerSavingsControlInsideOptional_powerSavings, - value_powerSavingsControlInsideOptional_powerSavings); - - jclass powerSavingsControlStructStructClass_2; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct", - powerSavingsControlStructStructClass_2); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct"); - return nullptr; - } - jmethodID powerSavingsControlStructStructCtor_2 = - env->GetMethodID(powerSavingsControlStructStructClass_2, "", "(Ljava/lang/Integer;)V"); - if (powerSavingsControlStructStructCtor_2 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct constructor"); - return nullptr; - } - - value_powerSavingsControlInsideOptional = - env->NewObject(powerSavingsControlStructStructClass_2, powerSavingsControlStructStructCtor_2, - value_powerSavingsControlInsideOptional_powerSavings); - } - chip::JniReferences::GetInstance().CreateOptional(value_powerSavingsControlInsideOptional, - value_powerSavingsControl); - } - - jobject value_heatingSourceControl; - if (!cppValue.heatingSourceControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, value_heatingSourceControl); - } - else - { - jobject value_heatingSourceControlInsideOptional; - if (cppValue.heatingSourceControl.Value().IsNull()) - { - value_heatingSourceControlInsideOptional = nullptr; - } - else - { - jobject value_heatingSourceControlInsideOptional_heatingSource; - std::string value_heatingSourceControlInsideOptional_heatingSourceClassName = "java/lang/Integer"; - std::string value_heatingSourceControlInsideOptional_heatingSourceCtorSignature = "(I)V"; - jint jnivalue_heatingSourceControlInsideOptional_heatingSource = - static_cast(cppValue.heatingSourceControl.Value().Value().heatingSource); - chip::JniReferences::GetInstance().CreateBoxedObject( - value_heatingSourceControlInsideOptional_heatingSourceClassName.c_str(), - value_heatingSourceControlInsideOptional_heatingSourceCtorSignature.c_str(), - jnivalue_heatingSourceControlInsideOptional_heatingSource, - value_heatingSourceControlInsideOptional_heatingSource); - - jclass heatingSourceControlStructStructClass_2; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct", - heatingSourceControlStructStructClass_2); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct"); - return nullptr; - } - jmethodID heatingSourceControlStructStructCtor_2 = - env->GetMethodID(heatingSourceControlStructStructClass_2, "", "(Ljava/lang/Integer;)V"); - if (heatingSourceControlStructStructCtor_2 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct constructor"); - return nullptr; - } - - value_heatingSourceControlInsideOptional = - env->NewObject(heatingSourceControlStructStructClass_2, heatingSourceControlStructStructCtor_2, - value_heatingSourceControlInsideOptional_heatingSource); - } - chip::JniReferences::GetInstance().CreateOptional(value_heatingSourceControlInsideOptional, - value_heatingSourceControl); - } - - jclass loadControlEventStatusChangeStructClass; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipEventStructs$DemandResponseLoadControlClusterLoadControlEventStatusChangeEvent", - loadControlEventStatusChangeStructClass); - if (err != CHIP_NO_ERROR) - { - ChipLogError( - Zcl, "Could not find class ChipEventStructs$DemandResponseLoadControlClusterLoadControlEventStatusChangeEvent"); - return nullptr; - } - jmethodID loadControlEventStatusChangeStructCtor = - env->GetMethodID(loadControlEventStatusChangeStructClass, "", - "([BLjava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/" - "Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V"); - if (loadControlEventStatusChangeStructCtor == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipEventStructs$DemandResponseLoadControlClusterLoadControlEventStatusChangeEvent " - "constructor"); - return nullptr; - } - - jobject value = env->NewObject(loadControlEventStatusChangeStructClass, loadControlEventStatusChangeStructCtor, - value_eventID, value_transitionIndex, value_status, value_criticality, value_control, - value_temperatureControl, value_averageLoadControl, value_dutyCycleControl, - value_powerSavingsControl, value_heatingSourceControl); - - return value; - } - default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; - break; - } - break; - } case app::Clusters::DoorLock::Id: { using namespace app::Clusters::DoorLock; switch (aPath.mEventId) diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index b9daa797c64049..6531edf5f0e991 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -19673,9 +19673,10 @@ void CHIPIcdManagementAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPTimerGeneratedCommandListAttributeCallback::CHIPTimerGeneratedCommandListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPLaundryDryerControlsSupportedDrynessLevelsAttributeCallback::CHIPLaundryDryerControlsSupportedDrynessLevelsAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -19691,7 +19692,7 @@ CHIPTimerGeneratedCommandListAttributeCallback::CHIPTimerGeneratedCommandListAtt } } -CHIPTimerGeneratedCommandListAttributeCallback::~CHIPTimerGeneratedCommandListAttributeCallback() +CHIPLaundryDryerControlsSupportedDrynessLevelsAttributeCallback::~CHIPLaundryDryerControlsSupportedDrynessLevelsAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -19702,8 +19703,148 @@ CHIPTimerGeneratedCommandListAttributeCallback::~CHIPTimerGeneratedCommandListAt env->DeleteGlobalRef(javaCallbackRef); } -void CHIPTimerGeneratedCommandListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPLaundryDryerControlsSupportedDrynessLevelsAttributeCallback::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/Integer"; + std::string newElement_0CtorSignature = "(I)V"; + jint jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), + jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPLaundryDryerControlsSelectedDrynessLevelAttributeCallback::CHIPLaundryDryerControlsSelectedDrynessLevelAttributeCallback( + 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"); + } +} + +CHIPLaundryDryerControlsSelectedDrynessLevelAttributeCallback::~CHIPLaundryDryerControlsSelectedDrynessLevelAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPLaundryDryerControlsSelectedDrynessLevelAttributeCallback::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"; + jint jnijavaValue = static_cast(value.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + jnijavaValue, javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPLaundryDryerControlsGeneratedCommandListAttributeCallback::CHIPLaundryDryerControlsGeneratedCommandListAttributeCallback( + 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"); + } +} + +CHIPLaundryDryerControlsGeneratedCommandListAttributeCallback::~CHIPLaundryDryerControlsGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPLaundryDryerControlsGeneratedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -19712,8 +19853,8 @@ void CHIPTimerGeneratedCommandListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -19744,8 +19885,10 @@ void CHIPTimerGeneratedCommandListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPTimerAcceptedCommandListAttributeCallback::CHIPTimerAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPLaundryDryerControlsAcceptedCommandListAttributeCallback::CHIPLaundryDryerControlsAcceptedCommandListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -19761,7 +19904,7 @@ CHIPTimerAcceptedCommandListAttributeCallback::CHIPTimerAcceptedCommandListAttri } } -CHIPTimerAcceptedCommandListAttributeCallback::~CHIPTimerAcceptedCommandListAttributeCallback() +CHIPLaundryDryerControlsAcceptedCommandListAttributeCallback::~CHIPLaundryDryerControlsAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -19772,8 +19915,8 @@ CHIPTimerAcceptedCommandListAttributeCallback::~CHIPTimerAcceptedCommandListAttr env->DeleteGlobalRef(javaCallbackRef); } -void CHIPTimerAcceptedCommandListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPLaundryDryerControlsAcceptedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -19782,8 +19925,8 @@ void CHIPTimerAcceptedCommandListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -19814,8 +19957,9 @@ void CHIPTimerAcceptedCommandListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPTimerEventListAttributeCallback::CHIPTimerEventListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPLaundryDryerControlsEventListAttributeCallback::CHIPLaundryDryerControlsEventListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -19831,7 +19975,7 @@ CHIPTimerEventListAttributeCallback::CHIPTimerEventListAttributeCallback(jobject } } -CHIPTimerEventListAttributeCallback::~CHIPTimerEventListAttributeCallback() +CHIPLaundryDryerControlsEventListAttributeCallback::~CHIPLaundryDryerControlsEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -19842,8 +19986,8 @@ CHIPTimerEventListAttributeCallback::~CHIPTimerEventListAttributeCallback() env->DeleteGlobalRef(javaCallbackRef); } -void CHIPTimerEventListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPLaundryDryerControlsEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -19852,8 +19996,8 @@ void CHIPTimerEventListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -19884,8 +20028,10 @@ void CHIPTimerEventListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPTimerAttributeListAttributeCallback::CHIPTimerAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPLaundryDryerControlsAttributeListAttributeCallback::CHIPLaundryDryerControlsAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -19901,7 +20047,7 @@ CHIPTimerAttributeListAttributeCallback::CHIPTimerAttributeListAttributeCallback } } -CHIPTimerAttributeListAttributeCallback::~CHIPTimerAttributeListAttributeCallback() +CHIPLaundryDryerControlsAttributeListAttributeCallback::~CHIPLaundryDryerControlsAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -19912,8 +20058,8 @@ CHIPTimerAttributeListAttributeCallback::~CHIPTimerAttributeListAttributeCallbac env->DeleteGlobalRef(javaCallbackRef); } -void CHIPTimerAttributeListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPLaundryDryerControlsAttributeListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -19922,8 +20068,8 @@ void CHIPTimerAttributeListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -28685,2656 +28831,6 @@ void CHIPActivatedCarbonFilterMonitoringAttributeListAttributeCallback::Callback env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPBooleanSensorConfigurationGeneratedCommandListAttributeCallback:: -CHIPBooleanSensorConfigurationGeneratedCommandListAttributeCallback(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"); - } -} - -CHIPBooleanSensorConfigurationGeneratedCommandListAttributeCallback::~ -CHIPBooleanSensorConfigurationGeneratedCommandListAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPBooleanSensorConfigurationGeneratedCommandListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); - - // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. - javaCallbackRef = cppCallback.get()->javaCallbackRef; - VerifyOrReturn(javaCallbackRef != nullptr, - ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); - - jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - - jobject arrayListObj; - chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - - auto iter_arrayListObj_0 = list.begin(); - while (iter_arrayListObj_0.Next()) - { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); - } - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} - -CHIPBooleanSensorConfigurationAcceptedCommandListAttributeCallback:: -CHIPBooleanSensorConfigurationAcceptedCommandListAttributeCallback(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"); - } -} - -CHIPBooleanSensorConfigurationAcceptedCommandListAttributeCallback::~ -CHIPBooleanSensorConfigurationAcceptedCommandListAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPBooleanSensorConfigurationAcceptedCommandListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); - - // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. - javaCallbackRef = cppCallback.get()->javaCallbackRef; - VerifyOrReturn(javaCallbackRef != nullptr, - ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); - - jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - - jobject arrayListObj; - chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - - auto iter_arrayListObj_0 = list.begin(); - while (iter_arrayListObj_0.Next()) - { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); - } - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} - -CHIPBooleanSensorConfigurationEventListAttributeCallback::CHIPBooleanSensorConfigurationEventListAttributeCallback( - 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"); - } -} - -CHIPBooleanSensorConfigurationEventListAttributeCallback::~CHIPBooleanSensorConfigurationEventListAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPBooleanSensorConfigurationEventListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); - - // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. - javaCallbackRef = cppCallback.get()->javaCallbackRef; - VerifyOrReturn(javaCallbackRef != nullptr, - ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); - - jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - - jobject arrayListObj; - chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - - auto iter_arrayListObj_0 = list.begin(); - while (iter_arrayListObj_0.Next()) - { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); - } - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} - -CHIPBooleanSensorConfigurationAttributeListAttributeCallback::CHIPBooleanSensorConfigurationAttributeListAttributeCallback( - 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"); - } -} - -CHIPBooleanSensorConfigurationAttributeListAttributeCallback::~CHIPBooleanSensorConfigurationAttributeListAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPBooleanSensorConfigurationAttributeListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); - - // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. - javaCallbackRef = cppCallback.get()->javaCallbackRef; - VerifyOrReturn(javaCallbackRef != nullptr, - ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); - - jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - - jobject arrayListObj; - chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - - auto iter_arrayListObj_0 = list.begin(); - while (iter_arrayListObj_0.Next()) - { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); - } - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} - -CHIPValveConfigurationAndControlOpenDurationAttributeCallback::CHIPValveConfigurationAndControlOpenDurationAttributeCallback( - 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"); - } -} - -CHIPValveConfigurationAndControlOpenDurationAttributeCallback::~CHIPValveConfigurationAndControlOpenDurationAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPValveConfigurationAndControlOpenDurationAttributeCallback::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"; - jlong jnijavaValue = static_cast(value.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), - jnijavaValue, javaValue); - } - - env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); -} - -CHIPValveConfigurationAndControlAutoCloseTimeAttributeCallback::CHIPValveConfigurationAndControlAutoCloseTimeAttributeCallback( - 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"); - } -} - -CHIPValveConfigurationAndControlAutoCloseTimeAttributeCallback::~CHIPValveConfigurationAndControlAutoCloseTimeAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPValveConfigurationAndControlAutoCloseTimeAttributeCallback::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"; - jlong jnijavaValue = static_cast(value.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), - jnijavaValue, javaValue); - } - - env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); -} - -CHIPValveConfigurationAndControlRemainingDurationAttributeCallback:: -CHIPValveConfigurationAndControlRemainingDurationAttributeCallback(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"); - } -} - -CHIPValveConfigurationAndControlRemainingDurationAttributeCallback::~ -CHIPValveConfigurationAndControlRemainingDurationAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPValveConfigurationAndControlRemainingDurationAttributeCallback::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"; - jlong jnijavaValue = static_cast(value.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), - jnijavaValue, javaValue); - } - - env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); -} - -CHIPValveConfigurationAndControlCurrentStateAttributeCallback::CHIPValveConfigurationAndControlCurrentStateAttributeCallback( - 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"); - } -} - -CHIPValveConfigurationAndControlCurrentStateAttributeCallback::~CHIPValveConfigurationAndControlCurrentStateAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPValveConfigurationAndControlCurrentStateAttributeCallback::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"; - jint jnijavaValue = static_cast(value.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), - jnijavaValue, javaValue); - } - - env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); -} - -CHIPValveConfigurationAndControlTargetStateAttributeCallback::CHIPValveConfigurationAndControlTargetStateAttributeCallback( - 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"); - } -} - -CHIPValveConfigurationAndControlTargetStateAttributeCallback::~CHIPValveConfigurationAndControlTargetStateAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPValveConfigurationAndControlTargetStateAttributeCallback::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"; - jint jnijavaValue = static_cast(value.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), - jnijavaValue, javaValue); - } - - env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); -} - -CHIPValveConfigurationAndControlCurrentLevelAttributeCallback::CHIPValveConfigurationAndControlCurrentLevelAttributeCallback( - 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"); - } -} - -CHIPValveConfigurationAndControlCurrentLevelAttributeCallback::~CHIPValveConfigurationAndControlCurrentLevelAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPValveConfigurationAndControlCurrentLevelAttributeCallback::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"; - jint jnijavaValue = static_cast(value.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), - jnijavaValue, javaValue); - } - - env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); -} - -CHIPValveConfigurationAndControlTargetLevelAttributeCallback::CHIPValveConfigurationAndControlTargetLevelAttributeCallback( - 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"); - } -} - -CHIPValveConfigurationAndControlTargetLevelAttributeCallback::~CHIPValveConfigurationAndControlTargetLevelAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPValveConfigurationAndControlTargetLevelAttributeCallback::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"; - jint jnijavaValue = static_cast(value.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), - jnijavaValue, javaValue); - } - - env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); -} - -CHIPValveConfigurationAndControlOpenLevelAttributeCallback::CHIPValveConfigurationAndControlOpenLevelAttributeCallback( - 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"); - } -} - -CHIPValveConfigurationAndControlOpenLevelAttributeCallback::~CHIPValveConfigurationAndControlOpenLevelAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPValveConfigurationAndControlOpenLevelAttributeCallback::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"; - jint jnijavaValue = static_cast(value.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), - jnijavaValue, javaValue); - } - - env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); -} - -CHIPValveConfigurationAndControlGeneratedCommandListAttributeCallback:: -CHIPValveConfigurationAndControlGeneratedCommandListAttributeCallback(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"); - } -} - -CHIPValveConfigurationAndControlGeneratedCommandListAttributeCallback::~ -CHIPValveConfigurationAndControlGeneratedCommandListAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPValveConfigurationAndControlGeneratedCommandListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); - - // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. - javaCallbackRef = cppCallback.get()->javaCallbackRef; - VerifyOrReturn(javaCallbackRef != nullptr, - ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); - - jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - - jobject arrayListObj; - chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - - auto iter_arrayListObj_0 = list.begin(); - while (iter_arrayListObj_0.Next()) - { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); - } - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} - -CHIPValveConfigurationAndControlAcceptedCommandListAttributeCallback:: -CHIPValveConfigurationAndControlAcceptedCommandListAttributeCallback(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"); - } -} - -CHIPValveConfigurationAndControlAcceptedCommandListAttributeCallback::~ -CHIPValveConfigurationAndControlAcceptedCommandListAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPValveConfigurationAndControlAcceptedCommandListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); - - // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. - javaCallbackRef = cppCallback.get()->javaCallbackRef; - VerifyOrReturn(javaCallbackRef != nullptr, - ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); - - jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - - jobject arrayListObj; - chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - - auto iter_arrayListObj_0 = list.begin(); - while (iter_arrayListObj_0.Next()) - { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); - } - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} - -CHIPValveConfigurationAndControlEventListAttributeCallback::CHIPValveConfigurationAndControlEventListAttributeCallback( - 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"); - } -} - -CHIPValveConfigurationAndControlEventListAttributeCallback::~CHIPValveConfigurationAndControlEventListAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPValveConfigurationAndControlEventListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); - - // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. - javaCallbackRef = cppCallback.get()->javaCallbackRef; - VerifyOrReturn(javaCallbackRef != nullptr, - ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); - - jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - - jobject arrayListObj; - chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - - auto iter_arrayListObj_0 = list.begin(); - while (iter_arrayListObj_0.Next()) - { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); - } - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} - -CHIPValveConfigurationAndControlAttributeListAttributeCallback::CHIPValveConfigurationAndControlAttributeListAttributeCallback( - 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"); - } -} - -CHIPValveConfigurationAndControlAttributeListAttributeCallback::~CHIPValveConfigurationAndControlAttributeListAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPValveConfigurationAndControlAttributeListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); - - // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. - javaCallbackRef = cppCallback.get()->javaCallbackRef; - VerifyOrReturn(javaCallbackRef != nullptr, - ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); - - jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - - jobject arrayListObj; - chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - - auto iter_arrayListObj_0 = list.begin(); - while (iter_arrayListObj_0.Next()) - { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); - } - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} - -CHIPDemandResponseLoadControlLoadControlProgramsAttributeCallback:: -CHIPDemandResponseLoadControlLoadControlProgramsAttributeCallback(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"); - } -} - -CHIPDemandResponseLoadControlLoadControlProgramsAttributeCallback::~ -CHIPDemandResponseLoadControlLoadControlProgramsAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPDemandResponseLoadControlLoadControlProgramsAttributeCallback::CallbackFn( - void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::DemandResponseLoadControl::Structs::LoadControlProgramStruct::DecodableType> & 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; - jobject newElement_0_programID; - jbyteArray newElement_0_programIDByteArray = env->NewByteArray(static_cast(entry_0.programID.size())); - env->SetByteArrayRegion(newElement_0_programIDByteArray, 0, static_cast(entry_0.programID.size()), - reinterpret_cast(entry_0.programID.data())); - newElement_0_programID = newElement_0_programIDByteArray; - jobject newElement_0_name; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); - jobject newElement_0_enrollmentGroup; - if (entry_0.enrollmentGroup.IsNull()) - { - newElement_0_enrollmentGroup = nullptr; - } - else - { - std::string newElement_0_enrollmentGroupClassName = "java/lang/Integer"; - std::string newElement_0_enrollmentGroupCtorSignature = "(I)V"; - jint jninewElement_0_enrollmentGroup = static_cast(entry_0.enrollmentGroup.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_enrollmentGroupClassName.c_str(), newElement_0_enrollmentGroupCtorSignature.c_str(), - jninewElement_0_enrollmentGroup, newElement_0_enrollmentGroup); - } - jobject newElement_0_randomStartMinutes; - if (entry_0.randomStartMinutes.IsNull()) - { - newElement_0_randomStartMinutes = nullptr; - } - else - { - std::string newElement_0_randomStartMinutesClassName = "java/lang/Integer"; - std::string newElement_0_randomStartMinutesCtorSignature = "(I)V"; - jint jninewElement_0_randomStartMinutes = static_cast(entry_0.randomStartMinutes.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_randomStartMinutesClassName.c_str(), newElement_0_randomStartMinutesCtorSignature.c_str(), - jninewElement_0_randomStartMinutes, newElement_0_randomStartMinutes); - } - jobject newElement_0_randomDurationMinutes; - if (entry_0.randomDurationMinutes.IsNull()) - { - newElement_0_randomDurationMinutes = nullptr; - } - else - { - std::string newElement_0_randomDurationMinutesClassName = "java/lang/Integer"; - std::string newElement_0_randomDurationMinutesCtorSignature = "(I)V"; - jint jninewElement_0_randomDurationMinutes = static_cast(entry_0.randomDurationMinutes.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_randomDurationMinutesClassName.c_str(), newElement_0_randomDurationMinutesCtorSignature.c_str(), - jninewElement_0_randomDurationMinutes, newElement_0_randomDurationMinutes); - } - - jclass loadControlProgramStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlProgramStruct", - loadControlProgramStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlProgramStruct"); - return; - } - jmethodID loadControlProgramStructStructCtor_1 = - env->GetMethodID(loadControlProgramStructStructClass_1, "", - "([BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); - if (loadControlProgramStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlProgramStruct constructor"); - return; - } - - newElement_0 = env->NewObject(loadControlProgramStructStructClass_1, loadControlProgramStructStructCtor_1, - newElement_0_programID, newElement_0_name, newElement_0_enrollmentGroup, - newElement_0_randomStartMinutes, newElement_0_randomDurationMinutes); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); - } - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} - -CHIPDemandResponseLoadControlEventsAttributeCallback::CHIPDemandResponseLoadControlEventsAttributeCallback(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"); - } -} - -CHIPDemandResponseLoadControlEventsAttributeCallback::~CHIPDemandResponseLoadControlEventsAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPDemandResponseLoadControlEventsAttributeCallback::CallbackFn( - void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::DemandResponseLoadControl::Structs::LoadControlEventStruct::DecodableType> & 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; - jobject newElement_0_eventID; - jbyteArray newElement_0_eventIDByteArray = env->NewByteArray(static_cast(entry_0.eventID.size())); - env->SetByteArrayRegion(newElement_0_eventIDByteArray, 0, static_cast(entry_0.eventID.size()), - reinterpret_cast(entry_0.eventID.data())); - newElement_0_eventID = newElement_0_eventIDByteArray; - jobject newElement_0_programID; - if (entry_0.programID.IsNull()) - { - newElement_0_programID = nullptr; - } - else - { - jbyteArray newElement_0_programIDByteArray = env->NewByteArray(static_cast(entry_0.programID.Value().size())); - env->SetByteArrayRegion(newElement_0_programIDByteArray, 0, static_cast(entry_0.programID.Value().size()), - reinterpret_cast(entry_0.programID.Value().data())); - newElement_0_programID = newElement_0_programIDByteArray; - } - jobject newElement_0_control; - std::string newElement_0_controlClassName = "java/lang/Integer"; - std::string newElement_0_controlCtorSignature = "(I)V"; - jint jninewElement_0_control = static_cast(entry_0.control.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_controlClassName.c_str(), - newElement_0_controlCtorSignature.c_str(), - jninewElement_0_control, newElement_0_control); - jobject newElement_0_deviceClass; - std::string newElement_0_deviceClassClassName = "java/lang/Long"; - std::string newElement_0_deviceClassCtorSignature = "(J)V"; - jlong jninewElement_0_deviceClass = static_cast(entry_0.deviceClass.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_deviceClassClassName.c_str(), - newElement_0_deviceClassCtorSignature.c_str(), - jninewElement_0_deviceClass, newElement_0_deviceClass); - jobject newElement_0_enrollmentGroup; - if (!entry_0.enrollmentGroup.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_enrollmentGroup); - } - else - { - jobject newElement_0_enrollmentGroupInsideOptional; - std::string newElement_0_enrollmentGroupInsideOptionalClassName = "java/lang/Integer"; - std::string newElement_0_enrollmentGroupInsideOptionalCtorSignature = "(I)V"; - jint jninewElement_0_enrollmentGroupInsideOptional = static_cast(entry_0.enrollmentGroup.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_enrollmentGroupInsideOptionalClassName.c_str(), - newElement_0_enrollmentGroupInsideOptionalCtorSignature.c_str(), jninewElement_0_enrollmentGroupInsideOptional, - newElement_0_enrollmentGroupInsideOptional); - chip::JniReferences::GetInstance().CreateOptional(newElement_0_enrollmentGroupInsideOptional, - newElement_0_enrollmentGroup); - } - jobject newElement_0_criticality; - std::string newElement_0_criticalityClassName = "java/lang/Integer"; - std::string newElement_0_criticalityCtorSignature = "(I)V"; - jint jninewElement_0_criticality = static_cast(entry_0.criticality); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_criticalityClassName.c_str(), - newElement_0_criticalityCtorSignature.c_str(), - jninewElement_0_criticality, newElement_0_criticality); - jobject newElement_0_startTime; - if (entry_0.startTime.IsNull()) - { - newElement_0_startTime = nullptr; - } - else - { - std::string newElement_0_startTimeClassName = "java/lang/Long"; - std::string newElement_0_startTimeCtorSignature = "(J)V"; - jlong jninewElement_0_startTime = static_cast(entry_0.startTime.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_startTimeClassName.c_str(), - newElement_0_startTimeCtorSignature.c_str(), - jninewElement_0_startTime, newElement_0_startTime); - } - jobject newElement_0_transitions; - chip::JniReferences::GetInstance().CreateArrayList(newElement_0_transitions); - - auto iter_newElement_0_transitions_2 = entry_0.transitions.begin(); - while (iter_newElement_0_transitions_2.Next()) - { - auto & entry_2 = iter_newElement_0_transitions_2.GetValue(); - jobject newElement_2; - jobject newElement_2_duration; - std::string newElement_2_durationClassName = "java/lang/Integer"; - std::string newElement_2_durationCtorSignature = "(I)V"; - jint jninewElement_2_duration = static_cast(entry_2.duration); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_durationClassName.c_str(), - newElement_2_durationCtorSignature.c_str(), - jninewElement_2_duration, newElement_2_duration); - jobject newElement_2_control; - std::string newElement_2_controlClassName = "java/lang/Integer"; - std::string newElement_2_controlCtorSignature = "(I)V"; - jint jninewElement_2_control = static_cast(entry_2.control.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_controlClassName.c_str(), - newElement_2_controlCtorSignature.c_str(), - jninewElement_2_control, newElement_2_control); - jobject newElement_2_temperatureControl; - if (!entry_2.temperatureControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_temperatureControl); - } - else - { - jobject newElement_2_temperatureControlInsideOptional; - jobject newElement_2_temperatureControlInsideOptional_coolingTempOffset; - if (!entry_2.temperatureControl.Value().coolingTempOffset.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional( - nullptr, newElement_2_temperatureControlInsideOptional_coolingTempOffset); - } - else - { - jobject newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional; - if (entry_2.temperatureControl.Value().coolingTempOffset.Value().IsNull()) - { - newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional = nullptr; - } - else - { - std::string newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptionalClassName = - "java/lang/Integer"; - std::string newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptionalCtorSignature = - "(I)V"; - jint jninewElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional = - static_cast(entry_2.temperatureControl.Value().coolingTempOffset.Value().Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptionalClassName.c_str(), - newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptionalCtorSignature.c_str(), - jninewElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional, - newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional); - } - chip::JniReferences::GetInstance().CreateOptional( - newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional, - newElement_2_temperatureControlInsideOptional_coolingTempOffset); - } - jobject newElement_2_temperatureControlInsideOptional_heatingtTempOffset; - if (!entry_2.temperatureControl.Value().heatingtTempOffset.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional( - nullptr, newElement_2_temperatureControlInsideOptional_heatingtTempOffset); - } - else - { - jobject newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional; - if (entry_2.temperatureControl.Value().heatingtTempOffset.Value().IsNull()) - { - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional = nullptr; - } - else - { - std::string newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptionalClassName = - "java/lang/Integer"; - std::string newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptionalCtorSignature = - "(I)V"; - jint jninewElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional = - static_cast(entry_2.temperatureControl.Value().heatingtTempOffset.Value().Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptionalClassName.c_str(), - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptionalCtorSignature.c_str(), - jninewElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional, - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional); - } - chip::JniReferences::GetInstance().CreateOptional( - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional, - newElement_2_temperatureControlInsideOptional_heatingtTempOffset); - } - jobject newElement_2_temperatureControlInsideOptional_coolingTempSetpoint; - if (!entry_2.temperatureControl.Value().coolingTempSetpoint.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional( - nullptr, newElement_2_temperatureControlInsideOptional_coolingTempSetpoint); - } - else - { - jobject newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional; - if (entry_2.temperatureControl.Value().coolingTempSetpoint.Value().IsNull()) - { - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional = nullptr; - } - else - { - std::string newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptionalClassName = - "java/lang/Integer"; - std::string newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptionalCtorSignature = - "(I)V"; - jint jninewElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional = - static_cast(entry_2.temperatureControl.Value().coolingTempSetpoint.Value().Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptionalClassName.c_str(), - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptionalCtorSignature.c_str(), - jninewElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional, - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional); - } - chip::JniReferences::GetInstance().CreateOptional( - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional, - newElement_2_temperatureControlInsideOptional_coolingTempSetpoint); - } - jobject newElement_2_temperatureControlInsideOptional_heatingTempSetpoint; - if (!entry_2.temperatureControl.Value().heatingTempSetpoint.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional( - nullptr, newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); - } - else - { - jobject newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional; - if (entry_2.temperatureControl.Value().heatingTempSetpoint.Value().IsNull()) - { - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional = nullptr; - } - else - { - std::string newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptionalClassName = - "java/lang/Integer"; - std::string newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptionalCtorSignature = - "(I)V"; - jint jninewElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional = - static_cast(entry_2.temperatureControl.Value().heatingTempSetpoint.Value().Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptionalClassName.c_str(), - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptionalCtorSignature.c_str(), - jninewElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional, - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional); - } - chip::JniReferences::GetInstance().CreateOptional( - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional, - newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); - } - - jclass temperatureControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct", - temperatureControlStructStructClass_5); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct"); - return; - } - jmethodID temperatureControlStructStructCtor_5 = - env->GetMethodID(temperatureControlStructStructClass_5, "", - "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V"); - if (temperatureControlStructStructCtor_5 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct constructor"); - return; - } - - newElement_2_temperatureControlInsideOptional = - env->NewObject(temperatureControlStructStructClass_5, temperatureControlStructStructCtor_5, - newElement_2_temperatureControlInsideOptional_coolingTempOffset, - newElement_2_temperatureControlInsideOptional_heatingtTempOffset, - newElement_2_temperatureControlInsideOptional_coolingTempSetpoint, - newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_temperatureControlInsideOptional, - newElement_2_temperatureControl); - } - jobject newElement_2_averageLoadControl; - if (!entry_2.averageLoadControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_averageLoadControl); - } - else - { - jobject newElement_2_averageLoadControlInsideOptional; - jobject newElement_2_averageLoadControlInsideOptional_loadAdjustment; - std::string newElement_2_averageLoadControlInsideOptional_loadAdjustmentClassName = "java/lang/Integer"; - std::string newElement_2_averageLoadControlInsideOptional_loadAdjustmentCtorSignature = "(I)V"; - jint jninewElement_2_averageLoadControlInsideOptional_loadAdjustment = - static_cast(entry_2.averageLoadControl.Value().loadAdjustment); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_averageLoadControlInsideOptional_loadAdjustmentClassName.c_str(), - newElement_2_averageLoadControlInsideOptional_loadAdjustmentCtorSignature.c_str(), - jninewElement_2_averageLoadControlInsideOptional_loadAdjustment, - newElement_2_averageLoadControlInsideOptional_loadAdjustment); - - jclass averageLoadControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct", - averageLoadControlStructStructClass_5); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct"); - return; - } - jmethodID averageLoadControlStructStructCtor_5 = - env->GetMethodID(averageLoadControlStructStructClass_5, "", "(Ljava/lang/Integer;)V"); - if (averageLoadControlStructStructCtor_5 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct constructor"); - return; - } - - newElement_2_averageLoadControlInsideOptional = - env->NewObject(averageLoadControlStructStructClass_5, averageLoadControlStructStructCtor_5, - newElement_2_averageLoadControlInsideOptional_loadAdjustment); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_averageLoadControlInsideOptional, - newElement_2_averageLoadControl); - } - jobject newElement_2_dutyCycleControl; - if (!entry_2.dutyCycleControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_dutyCycleControl); - } - else - { - jobject newElement_2_dutyCycleControlInsideOptional; - jobject newElement_2_dutyCycleControlInsideOptional_dutyCycle; - std::string newElement_2_dutyCycleControlInsideOptional_dutyCycleClassName = "java/lang/Integer"; - std::string newElement_2_dutyCycleControlInsideOptional_dutyCycleCtorSignature = "(I)V"; - jint jninewElement_2_dutyCycleControlInsideOptional_dutyCycle = - static_cast(entry_2.dutyCycleControl.Value().dutyCycle); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_dutyCycleControlInsideOptional_dutyCycleClassName.c_str(), - newElement_2_dutyCycleControlInsideOptional_dutyCycleCtorSignature.c_str(), - jninewElement_2_dutyCycleControlInsideOptional_dutyCycle, - newElement_2_dutyCycleControlInsideOptional_dutyCycle); - - jclass dutyCycleControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct", - dutyCycleControlStructStructClass_5); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct"); - return; - } - jmethodID dutyCycleControlStructStructCtor_5 = - env->GetMethodID(dutyCycleControlStructStructClass_5, "", "(Ljava/lang/Integer;)V"); - if (dutyCycleControlStructStructCtor_5 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct constructor"); - return; - } - - newElement_2_dutyCycleControlInsideOptional = - env->NewObject(dutyCycleControlStructStructClass_5, dutyCycleControlStructStructCtor_5, - newElement_2_dutyCycleControlInsideOptional_dutyCycle); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_dutyCycleControlInsideOptional, - newElement_2_dutyCycleControl); - } - jobject newElement_2_powerSavingsControl; - if (!entry_2.powerSavingsControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_powerSavingsControl); - } - else - { - jobject newElement_2_powerSavingsControlInsideOptional; - jobject newElement_2_powerSavingsControlInsideOptional_powerSavings; - std::string newElement_2_powerSavingsControlInsideOptional_powerSavingsClassName = "java/lang/Integer"; - std::string newElement_2_powerSavingsControlInsideOptional_powerSavingsCtorSignature = "(I)V"; - jint jninewElement_2_powerSavingsControlInsideOptional_powerSavings = - static_cast(entry_2.powerSavingsControl.Value().powerSavings); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_powerSavingsControlInsideOptional_powerSavingsClassName.c_str(), - newElement_2_powerSavingsControlInsideOptional_powerSavingsCtorSignature.c_str(), - jninewElement_2_powerSavingsControlInsideOptional_powerSavings, - newElement_2_powerSavingsControlInsideOptional_powerSavings); - - jclass powerSavingsControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct", - powerSavingsControlStructStructClass_5); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct"); - return; - } - jmethodID powerSavingsControlStructStructCtor_5 = - env->GetMethodID(powerSavingsControlStructStructClass_5, "", "(Ljava/lang/Integer;)V"); - if (powerSavingsControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct constructor"); - return; - } - - newElement_2_powerSavingsControlInsideOptional = - env->NewObject(powerSavingsControlStructStructClass_5, powerSavingsControlStructStructCtor_5, - newElement_2_powerSavingsControlInsideOptional_powerSavings); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_powerSavingsControlInsideOptional, - newElement_2_powerSavingsControl); - } - jobject newElement_2_heatingSourceControl; - if (!entry_2.heatingSourceControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_heatingSourceControl); - } - else - { - jobject newElement_2_heatingSourceControlInsideOptional; - jobject newElement_2_heatingSourceControlInsideOptional_heatingSource; - std::string newElement_2_heatingSourceControlInsideOptional_heatingSourceClassName = "java/lang/Integer"; - std::string newElement_2_heatingSourceControlInsideOptional_heatingSourceCtorSignature = "(I)V"; - jint jninewElement_2_heatingSourceControlInsideOptional_heatingSource = - static_cast(entry_2.heatingSourceControl.Value().heatingSource); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_heatingSourceControlInsideOptional_heatingSourceClassName.c_str(), - newElement_2_heatingSourceControlInsideOptional_heatingSourceCtorSignature.c_str(), - jninewElement_2_heatingSourceControlInsideOptional_heatingSource, - newElement_2_heatingSourceControlInsideOptional_heatingSource); - - jclass heatingSourceControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct", - heatingSourceControlStructStructClass_5); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct"); - return; - } - jmethodID heatingSourceControlStructStructCtor_5 = - env->GetMethodID(heatingSourceControlStructStructClass_5, "", "(Ljava/lang/Integer;)V"); - if (heatingSourceControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct constructor"); - return; - } - - newElement_2_heatingSourceControlInsideOptional = - env->NewObject(heatingSourceControlStructStructClass_5, heatingSourceControlStructStructCtor_5, - newElement_2_heatingSourceControlInsideOptional_heatingSource); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_heatingSourceControlInsideOptional, - newElement_2_heatingSourceControl); - } - - jclass loadControlEventTransitionStructStructClass_3; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct", - loadControlEventTransitionStructStructClass_3); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct"); - return; - } - jmethodID loadControlEventTransitionStructStructCtor_3 = - env->GetMethodID(loadControlEventTransitionStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" - "Optional;Ljava/util/Optional;Ljava/util/Optional;)V"); - if (loadControlEventTransitionStructStructCtor_3 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct constructor"); - return; - } - - newElement_2 = env->NewObject( - loadControlEventTransitionStructStructClass_3, loadControlEventTransitionStructStructCtor_3, newElement_2_duration, - newElement_2_control, newElement_2_temperatureControl, newElement_2_averageLoadControl, - newElement_2_dutyCycleControl, newElement_2_powerSavingsControl, newElement_2_heatingSourceControl); - chip::JniReferences::GetInstance().AddToList(newElement_0_transitions, newElement_2); - } - - jclass loadControlEventStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct", - loadControlEventStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct"); - return; - } - jmethodID loadControlEventStructStructCtor_1 = - env->GetMethodID(loadControlEventStructStructClass_1, "", - "([B[BLjava/lang/Integer;Ljava/lang/Long;Ljava/util/Optional;Ljava/lang/Integer;Ljava/lang/Long;Ljava/" - "util/ArrayList;)V"); - if (loadControlEventStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct constructor"); - return; - } - - newElement_0 = - env->NewObject(loadControlEventStructStructClass_1, loadControlEventStructStructCtor_1, newElement_0_eventID, - newElement_0_programID, newElement_0_control, newElement_0_deviceClass, newElement_0_enrollmentGroup, - newElement_0_criticality, newElement_0_startTime, newElement_0_transitions); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); - } - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} - -CHIPDemandResponseLoadControlActiveEventsAttributeCallback::CHIPDemandResponseLoadControlActiveEventsAttributeCallback( - 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"); - } -} - -CHIPDemandResponseLoadControlActiveEventsAttributeCallback::~CHIPDemandResponseLoadControlActiveEventsAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPDemandResponseLoadControlActiveEventsAttributeCallback::CallbackFn( - void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::DemandResponseLoadControl::Structs::LoadControlEventStruct::DecodableType> & 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; - jobject newElement_0_eventID; - jbyteArray newElement_0_eventIDByteArray = env->NewByteArray(static_cast(entry_0.eventID.size())); - env->SetByteArrayRegion(newElement_0_eventIDByteArray, 0, static_cast(entry_0.eventID.size()), - reinterpret_cast(entry_0.eventID.data())); - newElement_0_eventID = newElement_0_eventIDByteArray; - jobject newElement_0_programID; - if (entry_0.programID.IsNull()) - { - newElement_0_programID = nullptr; - } - else - { - jbyteArray newElement_0_programIDByteArray = env->NewByteArray(static_cast(entry_0.programID.Value().size())); - env->SetByteArrayRegion(newElement_0_programIDByteArray, 0, static_cast(entry_0.programID.Value().size()), - reinterpret_cast(entry_0.programID.Value().data())); - newElement_0_programID = newElement_0_programIDByteArray; - } - jobject newElement_0_control; - std::string newElement_0_controlClassName = "java/lang/Integer"; - std::string newElement_0_controlCtorSignature = "(I)V"; - jint jninewElement_0_control = static_cast(entry_0.control.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_controlClassName.c_str(), - newElement_0_controlCtorSignature.c_str(), - jninewElement_0_control, newElement_0_control); - jobject newElement_0_deviceClass; - std::string newElement_0_deviceClassClassName = "java/lang/Long"; - std::string newElement_0_deviceClassCtorSignature = "(J)V"; - jlong jninewElement_0_deviceClass = static_cast(entry_0.deviceClass.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_deviceClassClassName.c_str(), - newElement_0_deviceClassCtorSignature.c_str(), - jninewElement_0_deviceClass, newElement_0_deviceClass); - jobject newElement_0_enrollmentGroup; - if (!entry_0.enrollmentGroup.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_enrollmentGroup); - } - else - { - jobject newElement_0_enrollmentGroupInsideOptional; - std::string newElement_0_enrollmentGroupInsideOptionalClassName = "java/lang/Integer"; - std::string newElement_0_enrollmentGroupInsideOptionalCtorSignature = "(I)V"; - jint jninewElement_0_enrollmentGroupInsideOptional = static_cast(entry_0.enrollmentGroup.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_enrollmentGroupInsideOptionalClassName.c_str(), - newElement_0_enrollmentGroupInsideOptionalCtorSignature.c_str(), jninewElement_0_enrollmentGroupInsideOptional, - newElement_0_enrollmentGroupInsideOptional); - chip::JniReferences::GetInstance().CreateOptional(newElement_0_enrollmentGroupInsideOptional, - newElement_0_enrollmentGroup); - } - jobject newElement_0_criticality; - std::string newElement_0_criticalityClassName = "java/lang/Integer"; - std::string newElement_0_criticalityCtorSignature = "(I)V"; - jint jninewElement_0_criticality = static_cast(entry_0.criticality); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_criticalityClassName.c_str(), - newElement_0_criticalityCtorSignature.c_str(), - jninewElement_0_criticality, newElement_0_criticality); - jobject newElement_0_startTime; - if (entry_0.startTime.IsNull()) - { - newElement_0_startTime = nullptr; - } - else - { - std::string newElement_0_startTimeClassName = "java/lang/Long"; - std::string newElement_0_startTimeCtorSignature = "(J)V"; - jlong jninewElement_0_startTime = static_cast(entry_0.startTime.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_startTimeClassName.c_str(), - newElement_0_startTimeCtorSignature.c_str(), - jninewElement_0_startTime, newElement_0_startTime); - } - jobject newElement_0_transitions; - chip::JniReferences::GetInstance().CreateArrayList(newElement_0_transitions); - - auto iter_newElement_0_transitions_2 = entry_0.transitions.begin(); - while (iter_newElement_0_transitions_2.Next()) - { - auto & entry_2 = iter_newElement_0_transitions_2.GetValue(); - jobject newElement_2; - jobject newElement_2_duration; - std::string newElement_2_durationClassName = "java/lang/Integer"; - std::string newElement_2_durationCtorSignature = "(I)V"; - jint jninewElement_2_duration = static_cast(entry_2.duration); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_durationClassName.c_str(), - newElement_2_durationCtorSignature.c_str(), - jninewElement_2_duration, newElement_2_duration); - jobject newElement_2_control; - std::string newElement_2_controlClassName = "java/lang/Integer"; - std::string newElement_2_controlCtorSignature = "(I)V"; - jint jninewElement_2_control = static_cast(entry_2.control.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_controlClassName.c_str(), - newElement_2_controlCtorSignature.c_str(), - jninewElement_2_control, newElement_2_control); - jobject newElement_2_temperatureControl; - if (!entry_2.temperatureControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_temperatureControl); - } - else - { - jobject newElement_2_temperatureControlInsideOptional; - jobject newElement_2_temperatureControlInsideOptional_coolingTempOffset; - if (!entry_2.temperatureControl.Value().coolingTempOffset.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional( - nullptr, newElement_2_temperatureControlInsideOptional_coolingTempOffset); - } - else - { - jobject newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional; - if (entry_2.temperatureControl.Value().coolingTempOffset.Value().IsNull()) - { - newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional = nullptr; - } - else - { - std::string newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptionalClassName = - "java/lang/Integer"; - std::string newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptionalCtorSignature = - "(I)V"; - jint jninewElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional = - static_cast(entry_2.temperatureControl.Value().coolingTempOffset.Value().Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptionalClassName.c_str(), - newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptionalCtorSignature.c_str(), - jninewElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional, - newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional); - } - chip::JniReferences::GetInstance().CreateOptional( - newElement_2_temperatureControlInsideOptional_coolingTempOffsetInsideOptional, - newElement_2_temperatureControlInsideOptional_coolingTempOffset); - } - jobject newElement_2_temperatureControlInsideOptional_heatingtTempOffset; - if (!entry_2.temperatureControl.Value().heatingtTempOffset.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional( - nullptr, newElement_2_temperatureControlInsideOptional_heatingtTempOffset); - } - else - { - jobject newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional; - if (entry_2.temperatureControl.Value().heatingtTempOffset.Value().IsNull()) - { - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional = nullptr; - } - else - { - std::string newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptionalClassName = - "java/lang/Integer"; - std::string newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptionalCtorSignature = - "(I)V"; - jint jninewElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional = - static_cast(entry_2.temperatureControl.Value().heatingtTempOffset.Value().Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptionalClassName.c_str(), - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptionalCtorSignature.c_str(), - jninewElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional, - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional); - } - chip::JniReferences::GetInstance().CreateOptional( - newElement_2_temperatureControlInsideOptional_heatingtTempOffsetInsideOptional, - newElement_2_temperatureControlInsideOptional_heatingtTempOffset); - } - jobject newElement_2_temperatureControlInsideOptional_coolingTempSetpoint; - if (!entry_2.temperatureControl.Value().coolingTempSetpoint.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional( - nullptr, newElement_2_temperatureControlInsideOptional_coolingTempSetpoint); - } - else - { - jobject newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional; - if (entry_2.temperatureControl.Value().coolingTempSetpoint.Value().IsNull()) - { - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional = nullptr; - } - else - { - std::string newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptionalClassName = - "java/lang/Integer"; - std::string newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptionalCtorSignature = - "(I)V"; - jint jninewElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional = - static_cast(entry_2.temperatureControl.Value().coolingTempSetpoint.Value().Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptionalClassName.c_str(), - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptionalCtorSignature.c_str(), - jninewElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional, - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional); - } - chip::JniReferences::GetInstance().CreateOptional( - newElement_2_temperatureControlInsideOptional_coolingTempSetpointInsideOptional, - newElement_2_temperatureControlInsideOptional_coolingTempSetpoint); - } - jobject newElement_2_temperatureControlInsideOptional_heatingTempSetpoint; - if (!entry_2.temperatureControl.Value().heatingTempSetpoint.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional( - nullptr, newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); - } - else - { - jobject newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional; - if (entry_2.temperatureControl.Value().heatingTempSetpoint.Value().IsNull()) - { - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional = nullptr; - } - else - { - std::string newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptionalClassName = - "java/lang/Integer"; - std::string newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptionalCtorSignature = - "(I)V"; - jint jninewElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional = - static_cast(entry_2.temperatureControl.Value().heatingTempSetpoint.Value().Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptionalClassName.c_str(), - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptionalCtorSignature.c_str(), - jninewElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional, - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional); - } - chip::JniReferences::GetInstance().CreateOptional( - newElement_2_temperatureControlInsideOptional_heatingTempSetpointInsideOptional, - newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); - } - - jclass temperatureControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct", - temperatureControlStructStructClass_5); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct"); - return; - } - jmethodID temperatureControlStructStructCtor_5 = - env->GetMethodID(temperatureControlStructStructClass_5, "", - "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V"); - if (temperatureControlStructStructCtor_5 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct constructor"); - return; - } - - newElement_2_temperatureControlInsideOptional = - env->NewObject(temperatureControlStructStructClass_5, temperatureControlStructStructCtor_5, - newElement_2_temperatureControlInsideOptional_coolingTempOffset, - newElement_2_temperatureControlInsideOptional_heatingtTempOffset, - newElement_2_temperatureControlInsideOptional_coolingTempSetpoint, - newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_temperatureControlInsideOptional, - newElement_2_temperatureControl); - } - jobject newElement_2_averageLoadControl; - if (!entry_2.averageLoadControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_averageLoadControl); - } - else - { - jobject newElement_2_averageLoadControlInsideOptional; - jobject newElement_2_averageLoadControlInsideOptional_loadAdjustment; - std::string newElement_2_averageLoadControlInsideOptional_loadAdjustmentClassName = "java/lang/Integer"; - std::string newElement_2_averageLoadControlInsideOptional_loadAdjustmentCtorSignature = "(I)V"; - jint jninewElement_2_averageLoadControlInsideOptional_loadAdjustment = - static_cast(entry_2.averageLoadControl.Value().loadAdjustment); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_averageLoadControlInsideOptional_loadAdjustmentClassName.c_str(), - newElement_2_averageLoadControlInsideOptional_loadAdjustmentCtorSignature.c_str(), - jninewElement_2_averageLoadControlInsideOptional_loadAdjustment, - newElement_2_averageLoadControlInsideOptional_loadAdjustment); - - jclass averageLoadControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct", - averageLoadControlStructStructClass_5); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct"); - return; - } - jmethodID averageLoadControlStructStructCtor_5 = - env->GetMethodID(averageLoadControlStructStructClass_5, "", "(Ljava/lang/Integer;)V"); - if (averageLoadControlStructStructCtor_5 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct constructor"); - return; - } - - newElement_2_averageLoadControlInsideOptional = - env->NewObject(averageLoadControlStructStructClass_5, averageLoadControlStructStructCtor_5, - newElement_2_averageLoadControlInsideOptional_loadAdjustment); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_averageLoadControlInsideOptional, - newElement_2_averageLoadControl); - } - jobject newElement_2_dutyCycleControl; - if (!entry_2.dutyCycleControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_dutyCycleControl); - } - else - { - jobject newElement_2_dutyCycleControlInsideOptional; - jobject newElement_2_dutyCycleControlInsideOptional_dutyCycle; - std::string newElement_2_dutyCycleControlInsideOptional_dutyCycleClassName = "java/lang/Integer"; - std::string newElement_2_dutyCycleControlInsideOptional_dutyCycleCtorSignature = "(I)V"; - jint jninewElement_2_dutyCycleControlInsideOptional_dutyCycle = - static_cast(entry_2.dutyCycleControl.Value().dutyCycle); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_dutyCycleControlInsideOptional_dutyCycleClassName.c_str(), - newElement_2_dutyCycleControlInsideOptional_dutyCycleCtorSignature.c_str(), - jninewElement_2_dutyCycleControlInsideOptional_dutyCycle, - newElement_2_dutyCycleControlInsideOptional_dutyCycle); - - jclass dutyCycleControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct", - dutyCycleControlStructStructClass_5); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct"); - return; - } - jmethodID dutyCycleControlStructStructCtor_5 = - env->GetMethodID(dutyCycleControlStructStructClass_5, "", "(Ljava/lang/Integer;)V"); - if (dutyCycleControlStructStructCtor_5 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct constructor"); - return; - } - - newElement_2_dutyCycleControlInsideOptional = - env->NewObject(dutyCycleControlStructStructClass_5, dutyCycleControlStructStructCtor_5, - newElement_2_dutyCycleControlInsideOptional_dutyCycle); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_dutyCycleControlInsideOptional, - newElement_2_dutyCycleControl); - } - jobject newElement_2_powerSavingsControl; - if (!entry_2.powerSavingsControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_powerSavingsControl); - } - else - { - jobject newElement_2_powerSavingsControlInsideOptional; - jobject newElement_2_powerSavingsControlInsideOptional_powerSavings; - std::string newElement_2_powerSavingsControlInsideOptional_powerSavingsClassName = "java/lang/Integer"; - std::string newElement_2_powerSavingsControlInsideOptional_powerSavingsCtorSignature = "(I)V"; - jint jninewElement_2_powerSavingsControlInsideOptional_powerSavings = - static_cast(entry_2.powerSavingsControl.Value().powerSavings); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_powerSavingsControlInsideOptional_powerSavingsClassName.c_str(), - newElement_2_powerSavingsControlInsideOptional_powerSavingsCtorSignature.c_str(), - jninewElement_2_powerSavingsControlInsideOptional_powerSavings, - newElement_2_powerSavingsControlInsideOptional_powerSavings); - - jclass powerSavingsControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct", - powerSavingsControlStructStructClass_5); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct"); - return; - } - jmethodID powerSavingsControlStructStructCtor_5 = - env->GetMethodID(powerSavingsControlStructStructClass_5, "", "(Ljava/lang/Integer;)V"); - if (powerSavingsControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct constructor"); - return; - } - - newElement_2_powerSavingsControlInsideOptional = - env->NewObject(powerSavingsControlStructStructClass_5, powerSavingsControlStructStructCtor_5, - newElement_2_powerSavingsControlInsideOptional_powerSavings); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_powerSavingsControlInsideOptional, - newElement_2_powerSavingsControl); - } - jobject newElement_2_heatingSourceControl; - if (!entry_2.heatingSourceControl.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_heatingSourceControl); - } - else - { - jobject newElement_2_heatingSourceControlInsideOptional; - jobject newElement_2_heatingSourceControlInsideOptional_heatingSource; - std::string newElement_2_heatingSourceControlInsideOptional_heatingSourceClassName = "java/lang/Integer"; - std::string newElement_2_heatingSourceControlInsideOptional_heatingSourceCtorSignature = "(I)V"; - jint jninewElement_2_heatingSourceControlInsideOptional_heatingSource = - static_cast(entry_2.heatingSourceControl.Value().heatingSource); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_heatingSourceControlInsideOptional_heatingSourceClassName.c_str(), - newElement_2_heatingSourceControlInsideOptional_heatingSourceCtorSignature.c_str(), - jninewElement_2_heatingSourceControlInsideOptional_heatingSource, - newElement_2_heatingSourceControlInsideOptional_heatingSource); - - jclass heatingSourceControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct", - heatingSourceControlStructStructClass_5); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct"); - return; - } - jmethodID heatingSourceControlStructStructCtor_5 = - env->GetMethodID(heatingSourceControlStructStructClass_5, "", "(Ljava/lang/Integer;)V"); - if (heatingSourceControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct constructor"); - return; - } - - newElement_2_heatingSourceControlInsideOptional = - env->NewObject(heatingSourceControlStructStructClass_5, heatingSourceControlStructStructCtor_5, - newElement_2_heatingSourceControlInsideOptional_heatingSource); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_heatingSourceControlInsideOptional, - newElement_2_heatingSourceControl); - } - - jclass loadControlEventTransitionStructStructClass_3; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct", - loadControlEventTransitionStructStructClass_3); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct"); - return; - } - jmethodID loadControlEventTransitionStructStructCtor_3 = - env->GetMethodID(loadControlEventTransitionStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" - "Optional;Ljava/util/Optional;Ljava/util/Optional;)V"); - if (loadControlEventTransitionStructStructCtor_3 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct constructor"); - return; - } - - newElement_2 = env->NewObject( - loadControlEventTransitionStructStructClass_3, loadControlEventTransitionStructStructCtor_3, newElement_2_duration, - newElement_2_control, newElement_2_temperatureControl, newElement_2_averageLoadControl, - newElement_2_dutyCycleControl, newElement_2_powerSavingsControl, newElement_2_heatingSourceControl); - chip::JniReferences::GetInstance().AddToList(newElement_0_transitions, newElement_2); - } - - jclass loadControlEventStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct", - loadControlEventStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct"); - return; - } - jmethodID loadControlEventStructStructCtor_1 = - env->GetMethodID(loadControlEventStructStructClass_1, "", - "([B[BLjava/lang/Integer;Ljava/lang/Long;Ljava/util/Optional;Ljava/lang/Integer;Ljava/lang/Long;Ljava/" - "util/ArrayList;)V"); - if (loadControlEventStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct constructor"); - return; - } - - newElement_0 = - env->NewObject(loadControlEventStructStructClass_1, loadControlEventStructStructCtor_1, newElement_0_eventID, - newElement_0_programID, newElement_0_control, newElement_0_deviceClass, newElement_0_enrollmentGroup, - newElement_0_criticality, newElement_0_startTime, newElement_0_transitions); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); - } - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} - -CHIPDemandResponseLoadControlGeneratedCommandListAttributeCallback:: -CHIPDemandResponseLoadControlGeneratedCommandListAttributeCallback(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"); - } -} - -CHIPDemandResponseLoadControlGeneratedCommandListAttributeCallback::~ -CHIPDemandResponseLoadControlGeneratedCommandListAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPDemandResponseLoadControlGeneratedCommandListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); - - // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. - javaCallbackRef = cppCallback.get()->javaCallbackRef; - VerifyOrReturn(javaCallbackRef != nullptr, - ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); - - jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - - jobject arrayListObj; - chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - - auto iter_arrayListObj_0 = list.begin(); - while (iter_arrayListObj_0.Next()) - { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); - } - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} - -CHIPDemandResponseLoadControlAcceptedCommandListAttributeCallback:: -CHIPDemandResponseLoadControlAcceptedCommandListAttributeCallback(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"); - } -} - -CHIPDemandResponseLoadControlAcceptedCommandListAttributeCallback::~ -CHIPDemandResponseLoadControlAcceptedCommandListAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPDemandResponseLoadControlAcceptedCommandListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); - - // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. - javaCallbackRef = cppCallback.get()->javaCallbackRef; - VerifyOrReturn(javaCallbackRef != nullptr, - ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); - - jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - - jobject arrayListObj; - chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - - auto iter_arrayListObj_0 = list.begin(); - while (iter_arrayListObj_0.Next()) - { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); - } - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} - -CHIPDemandResponseLoadControlEventListAttributeCallback::CHIPDemandResponseLoadControlEventListAttributeCallback( - 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"); - } -} - -CHIPDemandResponseLoadControlEventListAttributeCallback::~CHIPDemandResponseLoadControlEventListAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPDemandResponseLoadControlEventListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); - - // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. - javaCallbackRef = cppCallback.get()->javaCallbackRef; - VerifyOrReturn(javaCallbackRef != nullptr, - ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); - - jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - - jobject arrayListObj; - chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - - auto iter_arrayListObj_0 = list.begin(); - while (iter_arrayListObj_0.Next()) - { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); - } - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} - -CHIPDemandResponseLoadControlAttributeListAttributeCallback::CHIPDemandResponseLoadControlAttributeListAttributeCallback( - 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"); - } -} - -CHIPDemandResponseLoadControlAttributeListAttributeCallback::~CHIPDemandResponseLoadControlAttributeListAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPDemandResponseLoadControlAttributeListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); - - // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. - javaCallbackRef = cppCallback.get()->javaCallbackRef; - VerifyOrReturn(javaCallbackRef != nullptr, - ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); - - jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - - jobject arrayListObj; - chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - - auto iter_arrayListObj_0 = list.begin(); - while (iter_arrayListObj_0.Next()) - { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); - } - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} - CHIPDoorLockLockStateAttributeCallback::CHIPDoorLockLockStateAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 2e6abe5faca104..d4688f56bee823 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -1855,7 +1855,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Enums: - class MoveModeEnum(MatterIntEnum): + class MoveMode(MatterIntEnum): kUp = 0x00 kDown = 0x01 # All received enum values that are not listed above will be mapped @@ -1864,7 +1864,7 @@ class MoveModeEnum(MatterIntEnum): # enum value. This specific should never be transmitted. kUnknownEnumValue = 2, - class StepModeEnum(MatterIntEnum): + class StepMode(MatterIntEnum): kUp = 0x00 kDown = 0x01 # All received enum values that are not listed above will be mapped @@ -1879,7 +1879,7 @@ class Feature(IntFlag): kLighting = 0x2 kFrequency = 0x4 - class OptionsBitmap(IntFlag): + class LevelControlOptions(IntFlag): kExecuteIfOff = 0x1 kCoupleColorTempToLevel = 0x2 @@ -1917,13 +1917,13 @@ class Move(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="moveMode", Tag=0, Type=LevelControl.Enums.MoveModeEnum), + ClusterObjectFieldDescriptor(Label="moveMode", Tag=0, Type=LevelControl.Enums.MoveMode), ClusterObjectFieldDescriptor(Label="rate", Tag=1, Type=typing.Union[Nullable, uint]), ClusterObjectFieldDescriptor(Label="optionsMask", Tag=2, Type=uint), ClusterObjectFieldDescriptor(Label="optionsOverride", Tag=3, Type=uint), ]) - moveMode: 'LevelControl.Enums.MoveModeEnum' = 0 + moveMode: 'LevelControl.Enums.MoveMode' = 0 rate: 'typing.Union[Nullable, uint]' = NullValue optionsMask: 'uint' = 0 optionsOverride: 'uint' = 0 @@ -1939,14 +1939,14 @@ class Step(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="stepMode", Tag=0, Type=LevelControl.Enums.StepModeEnum), + ClusterObjectFieldDescriptor(Label="stepMode", Tag=0, Type=LevelControl.Enums.StepMode), ClusterObjectFieldDescriptor(Label="stepSize", Tag=1, Type=uint), ClusterObjectFieldDescriptor(Label="transitionTime", Tag=2, Type=typing.Union[Nullable, uint]), ClusterObjectFieldDescriptor(Label="optionsMask", Tag=3, Type=uint), ClusterObjectFieldDescriptor(Label="optionsOverride", Tag=4, Type=uint), ]) - stepMode: 'LevelControl.Enums.StepModeEnum' = 0 + stepMode: 'LevelControl.Enums.StepMode' = 0 stepSize: 'uint' = 0 transitionTime: 'typing.Union[Nullable, uint]' = NullValue optionsMask: 'uint' = 0 @@ -2003,13 +2003,13 @@ class MoveWithOnOff(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="moveMode", Tag=0, Type=LevelControl.Enums.MoveModeEnum), + ClusterObjectFieldDescriptor(Label="moveMode", Tag=0, Type=LevelControl.Enums.MoveMode), ClusterObjectFieldDescriptor(Label="rate", Tag=1, Type=typing.Union[Nullable, uint]), ClusterObjectFieldDescriptor(Label="optionsMask", Tag=2, Type=uint), ClusterObjectFieldDescriptor(Label="optionsOverride", Tag=3, Type=uint), ]) - moveMode: 'LevelControl.Enums.MoveModeEnum' = 0 + moveMode: 'LevelControl.Enums.MoveMode' = 0 rate: 'typing.Union[Nullable, uint]' = NullValue optionsMask: 'uint' = 0 optionsOverride: 'uint' = 0 @@ -2025,14 +2025,14 @@ class StepWithOnOff(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="stepMode", Tag=0, Type=LevelControl.Enums.StepModeEnum), + ClusterObjectFieldDescriptor(Label="stepMode", Tag=0, Type=LevelControl.Enums.StepMode), ClusterObjectFieldDescriptor(Label="stepSize", Tag=1, Type=uint), ClusterObjectFieldDescriptor(Label="transitionTime", Tag=2, Type=typing.Union[Nullable, uint]), ClusterObjectFieldDescriptor(Label="optionsMask", Tag=3, Type=uint), ClusterObjectFieldDescriptor(Label="optionsOverride", Tag=4, Type=uint), ]) - stepMode: 'LevelControl.Enums.StepModeEnum' = 0 + stepMode: 'LevelControl.Enums.StepMode' = 0 stepSize: 'uint' = 0 transitionTime: 'typing.Union[Nullable, uint]' = NullValue optionsMask: 'uint' = 0 @@ -4129,8 +4129,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="uniqueID", Tag=0x00000012, Type=typing.Optional[str]), ClusterObjectFieldDescriptor(Label="capabilityMinima", Tag=0x00000013, Type=BasicInformation.Structs.CapabilityMinimaStruct), ClusterObjectFieldDescriptor(Label="productAppearance", Tag=0x00000014, Type=typing.Optional[BasicInformation.Structs.ProductAppearanceStruct]), - ClusterObjectFieldDescriptor(Label="specificationVersion", Tag=0x00000015, Type=uint), - ClusterObjectFieldDescriptor(Label="maxPathsPerInvoke", Tag=0x00000016, Type=uint), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -4160,8 +4158,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: uniqueID: 'typing.Optional[str]' = None capabilityMinima: 'BasicInformation.Structs.CapabilityMinimaStruct' = None productAppearance: 'typing.Optional[BasicInformation.Structs.ProductAppearanceStruct]' = None - specificationVersion: 'uint' = None - maxPathsPerInvoke: 'uint' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None eventList: 'typing.List[uint]' = None @@ -4589,38 +4585,6 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'typing.Optional[BasicInformation.Structs.ProductAppearanceStruct]' = None - @dataclass - class SpecificationVersion(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000028 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000015 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class MaxPathsPerInvoke(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000028 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000016 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): @ChipUtility.classproperty @@ -15194,16 +15158,15 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class Timer(Cluster): - id: typing.ClassVar[int] = 0x00000047 +class LaundryDryerControls(Cluster): + id: typing.ClassVar[int] = 0x0000004A @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="setTime", Tag=0x00000000, Type=uint), - ClusterObjectFieldDescriptor(Label="timeRemaining", Tag=0x00000001, Type=uint), - ClusterObjectFieldDescriptor(Label="timerState", Tag=0x00000002, Type=Timer.Enums.TimerStatusEnum), + ClusterObjectFieldDescriptor(Label="supportedDrynessLevels", Tag=0x00000000, Type=typing.Optional[typing.List[LaundryDryerControls.Enums.DrynessLevelEnum]]), + ClusterObjectFieldDescriptor(Label="selectedDrynessLevel", Tag=0x00000001, Type=typing.Union[None, Nullable, LaundryDryerControls.Enums.DrynessLevelEnum]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -15212,9 +15175,8 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - setTime: 'uint' = None - timeRemaining: 'uint' = None - timerState: 'Timer.Enums.TimerStatusEnum' = None + supportedDrynessLevels: 'typing.Optional[typing.List[LaundryDryerControls.Enums.DrynessLevelEnum]]' = None + selectedDrynessLevel: 'typing.Union[None, Nullable, LaundryDryerControls.Enums.DrynessLevelEnum]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None eventList: 'typing.List[uint]' = None @@ -15223,89 +15185,23 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Enums: - class TimerStatusEnum(MatterIntEnum): - kRunning = 0x00 - kPaused = 0x01 - kExpired = 0x02 - kReady = 0x03 + class DrynessLevelEnum(MatterIntEnum): + kLow = 0x00 + kNormal = 0x01 + kExtra = 0x02 + kMax = 0x03 # All received enum values that are not listed above will be mapped # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving and unknown # enum value. This specific should never be transmitted. kUnknownEnumValue = 4, - class Bitmaps: - class Feature(IntFlag): - kReset = 0x1 - - class Commands: - @dataclass - class SetTimer(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000047 - command_id: typing.ClassVar[int] = 0x00000000 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="newTime", Tag=0, Type=uint), - ]) - - newTime: 'uint' = 0 - - @dataclass - class ResetTimer(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000047 - command_id: typing.ClassVar[int] = 0x00000001 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ]) - - @dataclass - class AddTime(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000047 - command_id: typing.ClassVar[int] = 0x00000002 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="additionalTime", Tag=0, Type=uint), - ]) - - additionalTime: 'uint' = 0 - - @dataclass - class ReduceTime(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000047 - command_id: typing.ClassVar[int] = 0x00000003 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="timeReduction", Tag=0, Type=uint), - ]) - - timeReduction: 'uint' = 0 - class Attributes: @dataclass - class SetTime(ClusterAttributeDescriptor): + class SupportedDrynessLevels(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: - return 0x00000047 + return 0x0000004A @ChipUtility.classproperty def attribute_id(cls) -> int: @@ -15313,15 +15209,15 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[LaundryDryerControls.Enums.DrynessLevelEnum]]) - value: 'uint' = 0 + value: 'typing.Optional[typing.List[LaundryDryerControls.Enums.DrynessLevelEnum]]' = None @dataclass - class TimeRemaining(ClusterAttributeDescriptor): + class SelectedDrynessLevel(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: - return 0x00000047 + return 0x0000004A @ChipUtility.classproperty def attribute_id(cls) -> int: @@ -15329,31 +15225,15 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class TimerState(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000047 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000002 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=Timer.Enums.TimerStatusEnum) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, LaundryDryerControls.Enums.DrynessLevelEnum]) - value: 'Timer.Enums.TimerStatusEnum' = 0 + value: 'typing.Union[None, Nullable, LaundryDryerControls.Enums.DrynessLevelEnum]' = None @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: - return 0x00000047 + return 0x0000004A @ChipUtility.classproperty def attribute_id(cls) -> int: @@ -15369,7 +15249,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class AcceptedCommandList(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: - return 0x00000047 + return 0x0000004A @ChipUtility.classproperty def attribute_id(cls) -> int: @@ -15385,7 +15265,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class EventList(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: - return 0x00000047 + return 0x0000004A @ChipUtility.classproperty def attribute_id(cls) -> int: @@ -15401,7 +15281,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class AttributeList(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: - return 0x00000047 + return 0x0000004A @ChipUtility.classproperty def attribute_id(cls) -> int: @@ -15417,7 +15297,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class FeatureMap(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: - return 0x00000047 + return 0x0000004A @ChipUtility.classproperty def attribute_id(cls) -> int: @@ -15433,7 +15313,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class ClusterRevision(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: - return 0x00000047 + return 0x0000004A @ChipUtility.classproperty def attribute_id(cls) -> int: @@ -20903,17 +20783,49 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class BooleanSensorConfiguration(Cluster): - id: typing.ClassVar[int] = 0x00000080 +class DoorLock(Cluster): + id: typing.ClassVar[int] = 0x00000101 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="sensitivityLevel", Tag=0x00000000, Type=typing.Optional[BooleanSensorConfiguration.Enums.SensitivityEnum]), - ClusterObjectFieldDescriptor(Label="alarmsActive", Tag=0x00000001, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="alarmsSuppressed", Tag=0x00000002, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="alarmsEnabled", Tag=0x00000003, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="lockState", Tag=0x00000000, Type=typing.Union[Nullable, DoorLock.Enums.DlLockState]), + ClusterObjectFieldDescriptor(Label="lockType", Tag=0x00000001, Type=DoorLock.Enums.DlLockType), + ClusterObjectFieldDescriptor(Label="actuatorEnabled", Tag=0x00000002, Type=bool), + ClusterObjectFieldDescriptor(Label="doorState", Tag=0x00000003, Type=typing.Union[None, Nullable, DoorLock.Enums.DoorStateEnum]), + ClusterObjectFieldDescriptor(Label="doorOpenEvents", Tag=0x00000004, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="doorClosedEvents", Tag=0x00000005, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="openPeriod", Tag=0x00000006, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="numberOfTotalUsersSupported", Tag=0x00000011, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="numberOfPINUsersSupported", Tag=0x00000012, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="numberOfRFIDUsersSupported", Tag=0x00000013, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="numberOfWeekDaySchedulesSupportedPerUser", Tag=0x00000014, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="numberOfYearDaySchedulesSupportedPerUser", Tag=0x00000015, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="numberOfHolidaySchedulesSupported", Tag=0x00000016, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="maxPINCodeLength", Tag=0x00000017, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="minPINCodeLength", Tag=0x00000018, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="maxRFIDCodeLength", Tag=0x00000019, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="minRFIDCodeLength", Tag=0x0000001A, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="credentialRulesSupport", Tag=0x0000001B, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="numberOfCredentialsSupportedPerUser", Tag=0x0000001C, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="language", Tag=0x00000021, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="LEDSettings", Tag=0x00000022, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="autoRelockTime", Tag=0x00000023, Type=uint), + ClusterObjectFieldDescriptor(Label="soundVolume", Tag=0x00000024, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="operatingMode", Tag=0x00000025, Type=DoorLock.Enums.OperatingModeEnum), + ClusterObjectFieldDescriptor(Label="supportedOperatingModes", Tag=0x00000026, Type=uint), + ClusterObjectFieldDescriptor(Label="defaultConfigurationRegister", Tag=0x00000027, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="enableLocalProgramming", Tag=0x00000028, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="enableOneTouchLocking", Tag=0x00000029, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="enableInsideStatusLED", Tag=0x0000002A, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="enablePrivacyModeButton", Tag=0x0000002B, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="localProgrammingFeatures", Tag=0x0000002C, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="wrongCodeEntryLimit", Tag=0x00000030, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="userCodeTemporaryDisableTime", Tag=0x00000031, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="sendPINOverTheAir", Tag=0x00000032, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="requirePINforRemoteOperation", Tag=0x00000033, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="expiringUserTimeout", Tag=0x00000035, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -20922,10 +20834,42 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - sensitivityLevel: 'typing.Optional[BooleanSensorConfiguration.Enums.SensitivityEnum]' = None - alarmsActive: 'typing.Optional[uint]' = None - alarmsSuppressed: 'typing.Optional[uint]' = None - alarmsEnabled: 'typing.Optional[uint]' = None + lockState: 'typing.Union[Nullable, DoorLock.Enums.DlLockState]' = None + lockType: 'DoorLock.Enums.DlLockType' = None + actuatorEnabled: 'bool' = None + doorState: 'typing.Union[None, Nullable, DoorLock.Enums.DoorStateEnum]' = None + doorOpenEvents: 'typing.Optional[uint]' = None + doorClosedEvents: 'typing.Optional[uint]' = None + openPeriod: 'typing.Optional[uint]' = None + numberOfTotalUsersSupported: 'typing.Optional[uint]' = None + numberOfPINUsersSupported: 'typing.Optional[uint]' = None + numberOfRFIDUsersSupported: 'typing.Optional[uint]' = None + numberOfWeekDaySchedulesSupportedPerUser: 'typing.Optional[uint]' = None + numberOfYearDaySchedulesSupportedPerUser: 'typing.Optional[uint]' = None + numberOfHolidaySchedulesSupported: 'typing.Optional[uint]' = None + maxPINCodeLength: 'typing.Optional[uint]' = None + minPINCodeLength: 'typing.Optional[uint]' = None + maxRFIDCodeLength: 'typing.Optional[uint]' = None + minRFIDCodeLength: 'typing.Optional[uint]' = None + credentialRulesSupport: 'typing.Optional[uint]' = None + numberOfCredentialsSupportedPerUser: 'typing.Optional[uint]' = None + language: 'typing.Optional[str]' = None + LEDSettings: 'typing.Optional[uint]' = None + autoRelockTime: 'uint' = None + soundVolume: 'typing.Optional[uint]' = None + operatingMode: 'DoorLock.Enums.OperatingModeEnum' = None + supportedOperatingModes: 'uint' = None + defaultConfigurationRegister: 'typing.Optional[uint]' = None + enableLocalProgramming: 'typing.Optional[bool]' = None + enableOneTouchLocking: 'typing.Optional[bool]' = None + enableInsideStatusLED: 'typing.Optional[bool]' = None + enablePrivacyModeButton: 'typing.Optional[bool]' = None + localProgrammingFeatures: 'typing.Optional[uint]' = None + wrongCodeEntryLimit: 'typing.Optional[uint]' = None + userCodeTemporaryDisableTime: 'typing.Optional[uint]' = None + sendPINOverTheAir: 'typing.Optional[bool]' = None + requirePINforRemoteOperation: 'typing.Optional[bool]' = None + expiringUserTimeout: 'typing.Optional[uint]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None eventList: 'typing.List[uint]' = None @@ -20934,1442 +20878,64 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Enums: - class SensitivityEnum(MatterIntEnum): - kHigh = 0x00 - kStandard = 0x01 - kLow = 0x02 + class AlarmCodeEnum(MatterIntEnum): + kLockJammed = 0x00 + kLockFactoryReset = 0x01 + kLockRadioPowerCycled = 0x03 + kWrongCodeEntryLimit = 0x04 + kFrontEsceutcheonRemoved = 0x05 + kDoorForcedOpen = 0x06 + kDoorAjar = 0x07 + kForcedUser = 0x08 # All received enum values that are not listed above will be mapped # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving and unknown # enum value. This specific should never be transmitted. - kUnknownEnumValue = 3, - - class Bitmaps: - class AlarmModeBitmap(IntFlag): - kVisual = 0x1 - kAudible = 0x2 + kUnknownEnumValue = 2, - class Feature(IntFlag): - kVisual = 0x1 - kAudible = 0x2 - kAlarmSuppress = 0x4 - kSensitivityLevel = 0x8 + class CredentialRuleEnum(MatterIntEnum): + kSingle = 0x00 + kDual = 0x01 + kTri = 0x02 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving and unknown + # enum value. This specific should never be transmitted. + kUnknownEnumValue = 3, - class Commands: - @dataclass - class SuppressRequest(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000080 - command_id: typing.ClassVar[int] = 0x00000000 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None + class CredentialTypeEnum(MatterIntEnum): + kProgrammingPIN = 0x00 + kPin = 0x01 + kRfid = 0x02 + kFingerprint = 0x03 + kFingerVein = 0x04 + kFace = 0x05 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving and unknown + # enum value. This specific should never be transmitted. + kUnknownEnumValue = 6, - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="alarmsToSuppress", Tag=0, Type=uint), - ]) + class DataOperationTypeEnum(MatterIntEnum): + kAdd = 0x00 + kClear = 0x01 + kModify = 0x02 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving and unknown + # enum value. This specific should never be transmitted. + kUnknownEnumValue = 3, - alarmsToSuppress: 'uint' = 0 - - class Attributes: - @dataclass - class SensitivityLevel(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000080 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000000 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[BooleanSensorConfiguration.Enums.SensitivityEnum]) - - value: 'typing.Optional[BooleanSensorConfiguration.Enums.SensitivityEnum]' = None - - @dataclass - class AlarmsActive(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000080 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000001 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class AlarmsSuppressed(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000080 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000002 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class AlarmsEnabled(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000080 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000003 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class GeneratedCommandList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000080 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFF8 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class AcceptedCommandList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000080 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFF9 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class EventList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000080 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFA - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class AttributeList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000080 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFB - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class FeatureMap(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000080 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFC - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class ClusterRevision(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000080 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFD - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - class Events: - @dataclass - class AlarmsStateChanged(ClusterEvent): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000080 - - @ChipUtility.classproperty - def event_id(cls) -> int: - return 0x00000000 - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="alarmsActive", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="alarmsSuppressed", Tag=1, Type=typing.Optional[uint]), - ]) - - alarmsActive: 'uint' = 0 - alarmsSuppressed: 'typing.Optional[uint]' = None - - @dataclass - class SensorFault(ClusterEvent): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000080 - - @ChipUtility.classproperty - def event_id(cls) -> int: - return 0x00000001 - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ]) - - -@dataclass -class ValveConfigurationAndControl(Cluster): - id: typing.ClassVar[int] = 0x00000081 - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="openDuration", Tag=0x00000000, Type=typing.Union[Nullable, uint]), - ClusterObjectFieldDescriptor(Label="autoCloseTime", Tag=0x00000001, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="remainingDuration", Tag=0x00000002, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="currentState", Tag=0x00000003, Type=typing.Union[Nullable, ValveConfigurationAndControl.Enums.ValveStateEnum]), - ClusterObjectFieldDescriptor(Label="targetState", Tag=0x00000004, Type=typing.Union[Nullable, ValveConfigurationAndControl.Enums.ValveStateEnum]), - ClusterObjectFieldDescriptor(Label="startUpState", Tag=0x00000005, Type=typing.Optional[ValveConfigurationAndControl.Enums.ValveStateEnum]), - ClusterObjectFieldDescriptor(Label="currentLevel", Tag=0x00000006, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="targetLevel", Tag=0x00000007, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="openLevel", Tag=0x00000008, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="valveFault", Tag=0x00000009, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), - ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), - ]) - - openDuration: 'typing.Union[Nullable, uint]' = None - autoCloseTime: 'typing.Union[None, Nullable, uint]' = None - remainingDuration: 'typing.Union[None, Nullable, uint]' = None - currentState: 'typing.Union[Nullable, ValveConfigurationAndControl.Enums.ValveStateEnum]' = None - targetState: 'typing.Union[Nullable, ValveConfigurationAndControl.Enums.ValveStateEnum]' = None - startUpState: 'typing.Optional[ValveConfigurationAndControl.Enums.ValveStateEnum]' = None - currentLevel: 'typing.Union[None, Nullable, uint]' = None - targetLevel: 'typing.Union[None, Nullable, uint]' = None - openLevel: 'typing.Union[None, Nullable, uint]' = None - valveFault: 'typing.Optional[uint]' = None - generatedCommandList: 'typing.List[uint]' = None - acceptedCommandList: 'typing.List[uint]' = None - eventList: 'typing.List[uint]' = None - attributeList: 'typing.List[uint]' = None - featureMap: 'uint' = None - clusterRevision: 'uint' = None - - class Enums: - class ValveStateEnum(MatterIntEnum): - kOpen = 0x00 - kClosed = 0x01 - # All received enum values that are not listed above will be mapped - # to kUnknownEnumValue. This is a helper enum value that should only - # be used by code to process how it handles receiving and unknown - # enum value. This specific should never be transmitted. - kUnknownEnumValue = 2, - - class Bitmaps: - class Feature(IntFlag): - kTimeSync = 0x1 - kLevel = 0x2 - - class ValveFaultBitmap(IntFlag): - kGeneralFault = 0x1 - kBlocked = 0x2 - kLeaking = 0x4 - - class Commands: - @dataclass - class Open(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000081 - command_id: typing.ClassVar[int] = 0x00000000 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="openDuration", Tag=0, Type=typing.Optional[uint]), - ]) - - openDuration: 'typing.Optional[uint]' = None - - @dataclass - class Close(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000081 - command_id: typing.ClassVar[int] = 0x00000001 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ]) - - @dataclass - class SetLevel(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000081 - command_id: typing.ClassVar[int] = 0x00000002 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="level", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="openDuration", Tag=1, Type=typing.Optional[uint]), - ]) - - level: 'uint' = 0 - openDuration: 'typing.Optional[uint]' = None - - class Attributes: - @dataclass - class OpenDuration(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000081 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000000 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, uint]) - - value: 'typing.Union[Nullable, uint]' = NullValue - - @dataclass - class AutoCloseTime(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000081 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000001 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - - value: 'typing.Union[None, Nullable, uint]' = None - - @dataclass - class RemainingDuration(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000081 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000002 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - - value: 'typing.Union[None, Nullable, uint]' = None - - @dataclass - class CurrentState(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000081 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000003 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, ValveConfigurationAndControl.Enums.ValveStateEnum]) - - value: 'typing.Union[Nullable, ValveConfigurationAndControl.Enums.ValveStateEnum]' = NullValue - - @dataclass - class TargetState(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000081 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000004 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, ValveConfigurationAndControl.Enums.ValveStateEnum]) - - value: 'typing.Union[Nullable, ValveConfigurationAndControl.Enums.ValveStateEnum]' = NullValue - - @dataclass - class StartUpState(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000081 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000005 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[ValveConfigurationAndControl.Enums.ValveStateEnum]) - - value: 'typing.Optional[ValveConfigurationAndControl.Enums.ValveStateEnum]' = None - - @dataclass - class CurrentLevel(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000081 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000006 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - - value: 'typing.Union[None, Nullable, uint]' = None - - @dataclass - class TargetLevel(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000081 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000007 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - - value: 'typing.Union[None, Nullable, uint]' = None - - @dataclass - class OpenLevel(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000081 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000008 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - - value: 'typing.Union[None, Nullable, uint]' = None - - @dataclass - class ValveFault(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000081 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000009 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class GeneratedCommandList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000081 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFF8 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class AcceptedCommandList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000081 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFF9 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class EventList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000081 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFA - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class AttributeList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000081 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFB - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class FeatureMap(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000081 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFC - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class ClusterRevision(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000081 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFD - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - class Events: - @dataclass - class ValveStateChanged(ClusterEvent): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000081 - - @ChipUtility.classproperty - def event_id(cls) -> int: - return 0x00000000 - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="valveState", Tag=0, Type=ValveConfigurationAndControl.Enums.ValveStateEnum), - ]) - - valveState: 'ValveConfigurationAndControl.Enums.ValveStateEnum' = 0 - - @dataclass - class ValveFault(ClusterEvent): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000081 - - @ChipUtility.classproperty - def event_id(cls) -> int: - return 0x00000001 - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="valveFault", Tag=0, Type=uint), - ]) - - valveFault: 'uint' = 0 - - -@dataclass -class DemandResponseLoadControl(Cluster): - id: typing.ClassVar[int] = 0x00000096 - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="deviceClass", Tag=0x00000000, Type=uint), - ClusterObjectFieldDescriptor(Label="loadControlPrograms", Tag=0x00000001, Type=typing.List[DemandResponseLoadControl.Structs.LoadControlProgramStruct]), - ClusterObjectFieldDescriptor(Label="numberOfLoadControlPrograms", Tag=0x00000002, Type=uint), - ClusterObjectFieldDescriptor(Label="events", Tag=0x00000003, Type=typing.List[DemandResponseLoadControl.Structs.LoadControlEventStruct]), - ClusterObjectFieldDescriptor(Label="activeEvents", Tag=0x00000004, Type=typing.List[DemandResponseLoadControl.Structs.LoadControlEventStruct]), - ClusterObjectFieldDescriptor(Label="numberOfEventsPerProgram", Tag=0x00000005, Type=uint), - ClusterObjectFieldDescriptor(Label="numberOfTransistions", Tag=0x00000006, Type=uint), - ClusterObjectFieldDescriptor(Label="defaultRandomStart", Tag=0x00000007, Type=uint), - ClusterObjectFieldDescriptor(Label="defaultRandomDuration", Tag=0x00000008, Type=uint), - ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), - ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), - ]) - - deviceClass: 'uint' = None - loadControlPrograms: 'typing.List[DemandResponseLoadControl.Structs.LoadControlProgramStruct]' = None - numberOfLoadControlPrograms: 'uint' = None - events: 'typing.List[DemandResponseLoadControl.Structs.LoadControlEventStruct]' = None - activeEvents: 'typing.List[DemandResponseLoadControl.Structs.LoadControlEventStruct]' = None - numberOfEventsPerProgram: 'uint' = None - numberOfTransistions: 'uint' = None - defaultRandomStart: 'uint' = None - defaultRandomDuration: 'uint' = None - generatedCommandList: 'typing.List[uint]' = None - acceptedCommandList: 'typing.List[uint]' = None - eventList: 'typing.List[uint]' = None - attributeList: 'typing.List[uint]' = None - featureMap: 'uint' = None - clusterRevision: 'uint' = None - - class Enums: - class CriticalityLevelEnum(MatterIntEnum): - kUnknown = 0x00 - kGreen = 0x01 - kLevel1 = 0x02 - kLevel2 = 0x03 - kLevel3 = 0x04 - kLevel4 = 0x05 - kLevel5 = 0x06 - kEmergency = 0x07 - kPlannedOutage = 0x08 - kServiceDisconnect = 0x09 - # All received enum values that are not listed above will be mapped - # to kUnknownEnumValue. This is a helper enum value that should only - # be used by code to process how it handles receiving and unknown - # enum value. This specific should never be transmitted. - kUnknownEnumValue = 10, - - class HeatingSourceEnum(MatterIntEnum): - kAny = 0x00 - kElectric = 0x01 - kNonElectric = 0x02 - # All received enum values that are not listed above will be mapped - # to kUnknownEnumValue. This is a helper enum value that should only - # be used by code to process how it handles receiving and unknown - # enum value. This specific should never be transmitted. - kUnknownEnumValue = 3, - - class LoadControlEventChangeSourceEnum(MatterIntEnum): - kAutomatic = 0x00 - kUserAction = 0x01 - # All received enum values that are not listed above will be mapped - # to kUnknownEnumValue. This is a helper enum value that should only - # be used by code to process how it handles receiving and unknown - # enum value. This specific should never be transmitted. - kUnknownEnumValue = 2, - - class LoadControlEventStatusEnum(MatterIntEnum): - kUnknown = 0x00 - kReceived = 0x01 - kInProgress = 0x02 - kCompleted = 0x03 - kOptedOut = 0x04 - kOptedIn = 0x05 - kCanceled = 0x06 - kSuperseded = 0x07 - kPartialOptedOut = 0x08 - kPartialOptedIn = 0x09 - kNoParticipation = 0x0A - kUnavailable = 0x0B - kFailed = 0x0C - # All received enum values that are not listed above will be mapped - # to kUnknownEnumValue. This is a helper enum value that should only - # be used by code to process how it handles receiving and unknown - # enum value. This specific should never be transmitted. - kUnknownEnumValue = 13, - - class PowerSavingsEnum(MatterIntEnum): - kLow = 0x00 - kMedium = 0x01 - kHigh = 0x02 - # All received enum values that are not listed above will be mapped - # to kUnknownEnumValue. This is a helper enum value that should only - # be used by code to process how it handles receiving and unknown - # enum value. This specific should never be transmitted. - kUnknownEnumValue = 3, - - class Bitmaps: - class CancelControlBitmap(IntFlag): - kRandomEnd = 0x1 - - class DeviceClassBitmap(IntFlag): - kHvac = 0x1 - kStripHeater = 0x2 - kWaterHeater = 0x4 - kPoolPump = 0x8 - kSmartAppliance = 0x10 - kIrrigationPump = 0x20 - kCommercialLoad = 0x40 - kResidentialLoad = 0x80 - kExteriorLighting = 0x100 - kInteriorLighting = 0x200 - kEv = 0x400 - kGenerationSystem = 0x800 - kSmartInverter = 0x1000 - kEvse = 0x2000 - kResu = 0x4000 - kEms = 0x8000 - kSem = 0x10000 - - class EventControlBitmap(IntFlag): - kRandomStart = 0x1 - - class EventTransitionControlBitmap(IntFlag): - kRandomDuration = 0x1 - kIgnoreOptOut = 0x2 - - class Feature(IntFlag): - kEnrollmentGroups = 0x1 - kTemperatureOffset = 0x2 - kTemperatureSetpoint = 0x4 - kLoadAdjustment = 0x8 - kDutyCycle = 0x10 - kPowerSavings = 0x20 - kHeatingSource = 0x40 - - class Structs: - @dataclass - class HeatingSourceControlStruct(ClusterObject): - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="heatingSource", Tag=0, Type=DemandResponseLoadControl.Enums.HeatingSourceEnum), - ]) - - heatingSource: 'DemandResponseLoadControl.Enums.HeatingSourceEnum' = 0 - - @dataclass - class PowerSavingsControlStruct(ClusterObject): - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="powerSavings", Tag=0, Type=DemandResponseLoadControl.Enums.PowerSavingsEnum), - ]) - - powerSavings: 'DemandResponseLoadControl.Enums.PowerSavingsEnum' = 0 - - @dataclass - class DutyCycleControlStruct(ClusterObject): - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="dutyCycle", Tag=0, Type=uint), - ]) - - dutyCycle: 'uint' = 0 - - @dataclass - class AverageLoadControlStruct(ClusterObject): - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="loadAdjustment", Tag=0, Type=int), - ]) - - loadAdjustment: 'int' = 0 - - @dataclass - class TemperatureControlStruct(ClusterObject): - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="coolingTempOffset", Tag=0, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="heatingtTempOffset", Tag=1, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="coolingTempSetpoint", Tag=2, Type=typing.Union[None, Nullable, int]), - ClusterObjectFieldDescriptor(Label="heatingTempSetpoint", Tag=3, Type=typing.Union[None, Nullable, int]), - ]) - - coolingTempOffset: 'typing.Union[None, Nullable, uint]' = None - heatingtTempOffset: 'typing.Union[None, Nullable, uint]' = None - coolingTempSetpoint: 'typing.Union[None, Nullable, int]' = None - heatingTempSetpoint: 'typing.Union[None, Nullable, int]' = None - - @dataclass - class LoadControlEventTransitionStruct(ClusterObject): - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="duration", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="control", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="temperatureControl", Tag=2, Type=typing.Optional[DemandResponseLoadControl.Structs.TemperatureControlStruct]), - ClusterObjectFieldDescriptor(Label="averageLoadControl", Tag=3, Type=typing.Optional[DemandResponseLoadControl.Structs.AverageLoadControlStruct]), - ClusterObjectFieldDescriptor(Label="dutyCycleControl", Tag=4, Type=typing.Optional[DemandResponseLoadControl.Structs.DutyCycleControlStruct]), - ClusterObjectFieldDescriptor(Label="powerSavingsControl", Tag=5, Type=typing.Optional[DemandResponseLoadControl.Structs.PowerSavingsControlStruct]), - ClusterObjectFieldDescriptor(Label="heatingSourceControl", Tag=6, Type=typing.Optional[DemandResponseLoadControl.Structs.HeatingSourceControlStruct]), - ]) - - duration: 'uint' = 0 - control: 'uint' = 0 - temperatureControl: 'typing.Optional[DemandResponseLoadControl.Structs.TemperatureControlStruct]' = None - averageLoadControl: 'typing.Optional[DemandResponseLoadControl.Structs.AverageLoadControlStruct]' = None - dutyCycleControl: 'typing.Optional[DemandResponseLoadControl.Structs.DutyCycleControlStruct]' = None - powerSavingsControl: 'typing.Optional[DemandResponseLoadControl.Structs.PowerSavingsControlStruct]' = None - heatingSourceControl: 'typing.Optional[DemandResponseLoadControl.Structs.HeatingSourceControlStruct]' = None - - @dataclass - class LoadControlEventStruct(ClusterObject): - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="eventID", Tag=0, Type=bytes), - ClusterObjectFieldDescriptor(Label="programID", Tag=1, Type=typing.Union[Nullable, bytes]), - ClusterObjectFieldDescriptor(Label="control", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="deviceClass", Tag=3, Type=uint), - ClusterObjectFieldDescriptor(Label="enrollmentGroup", Tag=4, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="criticality", Tag=5, Type=DemandResponseLoadControl.Enums.CriticalityLevelEnum), - ClusterObjectFieldDescriptor(Label="startTime", Tag=6, Type=typing.Union[Nullable, uint]), - ClusterObjectFieldDescriptor(Label="transitions", Tag=7, Type=typing.List[DemandResponseLoadControl.Structs.LoadControlEventTransitionStruct]), - ]) - - eventID: 'bytes' = b"" - programID: 'typing.Union[Nullable, bytes]' = NullValue - control: 'uint' = 0 - deviceClass: 'uint' = 0 - enrollmentGroup: 'typing.Optional[uint]' = None - criticality: 'DemandResponseLoadControl.Enums.CriticalityLevelEnum' = 0 - startTime: 'typing.Union[Nullable, uint]' = NullValue - transitions: 'typing.List[DemandResponseLoadControl.Structs.LoadControlEventTransitionStruct]' = field(default_factory=lambda: []) - - @dataclass - class LoadControlProgramStruct(ClusterObject): - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="programID", Tag=0, Type=bytes), - ClusterObjectFieldDescriptor(Label="name", Tag=1, Type=str), - ClusterObjectFieldDescriptor(Label="enrollmentGroup", Tag=2, Type=typing.Union[Nullable, uint]), - ClusterObjectFieldDescriptor(Label="randomStartMinutes", Tag=3, Type=typing.Union[Nullable, uint]), - ClusterObjectFieldDescriptor(Label="randomDurationMinutes", Tag=4, Type=typing.Union[Nullable, uint]), - ]) - - programID: 'bytes' = b"" - name: 'str' = "" - enrollmentGroup: 'typing.Union[Nullable, uint]' = NullValue - randomStartMinutes: 'typing.Union[Nullable, uint]' = NullValue - randomDurationMinutes: 'typing.Union[Nullable, uint]' = NullValue - - class Commands: - @dataclass - class RegisterLoadControlProgramRequest(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000096 - command_id: typing.ClassVar[int] = 0x00000000 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="loadControlProgram", Tag=0, Type=DemandResponseLoadControl.Structs.LoadControlProgramStruct), - ]) - - loadControlProgram: 'DemandResponseLoadControl.Structs.LoadControlProgramStruct' = field(default_factory=lambda: DemandResponseLoadControl.Structs.LoadControlProgramStruct()) - - @dataclass - class UnregisterLoadControlProgramRequest(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000096 - command_id: typing.ClassVar[int] = 0x00000001 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="loadControlProgramID", Tag=0, Type=bytes), - ]) - - loadControlProgramID: 'bytes' = b"" - - @dataclass - class AddLoadControlEventRequest(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000096 - command_id: typing.ClassVar[int] = 0x00000002 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="event", Tag=0, Type=DemandResponseLoadControl.Structs.LoadControlEventStruct), - ]) - - event: 'DemandResponseLoadControl.Structs.LoadControlEventStruct' = field(default_factory=lambda: DemandResponseLoadControl.Structs.LoadControlEventStruct()) - - @dataclass - class RemoveLoadControlEventRequest(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000096 - command_id: typing.ClassVar[int] = 0x00000003 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="eventID", Tag=0, Type=bytes), - ClusterObjectFieldDescriptor(Label="cancelControl", Tag=1, Type=uint), - ]) - - eventID: 'bytes' = b"" - cancelControl: 'uint' = 0 - - @dataclass - class ClearLoadControlEventsRequest(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000096 - command_id: typing.ClassVar[int] = 0x00000004 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ]) - - class Attributes: - @dataclass - class DeviceClass(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000096 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000000 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class LoadControlPrograms(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000096 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000001 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[DemandResponseLoadControl.Structs.LoadControlProgramStruct]) - - value: 'typing.List[DemandResponseLoadControl.Structs.LoadControlProgramStruct]' = field(default_factory=lambda: []) - - @dataclass - class NumberOfLoadControlPrograms(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000096 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000002 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class Events(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000096 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000003 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[DemandResponseLoadControl.Structs.LoadControlEventStruct]) - - value: 'typing.List[DemandResponseLoadControl.Structs.LoadControlEventStruct]' = field(default_factory=lambda: []) - - @dataclass - class ActiveEvents(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000096 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000004 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[DemandResponseLoadControl.Structs.LoadControlEventStruct]) - - value: 'typing.List[DemandResponseLoadControl.Structs.LoadControlEventStruct]' = field(default_factory=lambda: []) - - @dataclass - class NumberOfEventsPerProgram(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000096 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000005 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class NumberOfTransistions(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000096 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000006 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class DefaultRandomStart(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000096 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000007 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class DefaultRandomDuration(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000096 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000008 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class GeneratedCommandList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000096 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFF8 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class AcceptedCommandList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000096 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFF9 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class EventList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000096 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFA - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class AttributeList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000096 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFB - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class FeatureMap(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000096 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFC - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class ClusterRevision(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000096 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFD - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - class Events: - @dataclass - class LoadControlEventStatusChange(ClusterEvent): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000096 - - @ChipUtility.classproperty - def event_id(cls) -> int: - return 0x00000000 - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="eventID", Tag=0, Type=bytes), - ClusterObjectFieldDescriptor(Label="transitionIndex", Tag=1, Type=typing.Union[Nullable, uint]), - ClusterObjectFieldDescriptor(Label="status", Tag=2, Type=DemandResponseLoadControl.Enums.LoadControlEventStatusEnum), - ClusterObjectFieldDescriptor(Label="criticality", Tag=3, Type=DemandResponseLoadControl.Enums.CriticalityLevelEnum), - ClusterObjectFieldDescriptor(Label="control", Tag=4, Type=uint), - ClusterObjectFieldDescriptor(Label="temperatureControl", Tag=5, Type=typing.Union[None, Nullable, DemandResponseLoadControl.Structs.TemperatureControlStruct]), - ClusterObjectFieldDescriptor(Label="averageLoadControl", Tag=6, Type=typing.Union[None, Nullable, DemandResponseLoadControl.Structs.AverageLoadControlStruct]), - ClusterObjectFieldDescriptor(Label="dutyCycleControl", Tag=7, Type=typing.Union[None, Nullable, DemandResponseLoadControl.Structs.DutyCycleControlStruct]), - ClusterObjectFieldDescriptor(Label="powerSavingsControl", Tag=8, Type=typing.Union[None, Nullable, DemandResponseLoadControl.Structs.PowerSavingsControlStruct]), - ClusterObjectFieldDescriptor(Label="heatingSourceControl", Tag=9, Type=typing.Union[None, Nullable, DemandResponseLoadControl.Structs.HeatingSourceControlStruct]), - ]) - - eventID: 'bytes' = b"" - transitionIndex: 'typing.Union[Nullable, uint]' = NullValue - status: 'DemandResponseLoadControl.Enums.LoadControlEventStatusEnum' = 0 - criticality: 'DemandResponseLoadControl.Enums.CriticalityLevelEnum' = 0 - control: 'uint' = 0 - temperatureControl: 'typing.Union[None, Nullable, DemandResponseLoadControl.Structs.TemperatureControlStruct]' = None - averageLoadControl: 'typing.Union[None, Nullable, DemandResponseLoadControl.Structs.AverageLoadControlStruct]' = None - dutyCycleControl: 'typing.Union[None, Nullable, DemandResponseLoadControl.Structs.DutyCycleControlStruct]' = None - powerSavingsControl: 'typing.Union[None, Nullable, DemandResponseLoadControl.Structs.PowerSavingsControlStruct]' = None - heatingSourceControl: 'typing.Union[None, Nullable, DemandResponseLoadControl.Structs.HeatingSourceControlStruct]' = None - - -@dataclass -class DoorLock(Cluster): - id: typing.ClassVar[int] = 0x00000101 - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="lockState", Tag=0x00000000, Type=typing.Union[Nullable, DoorLock.Enums.DlLockState]), - ClusterObjectFieldDescriptor(Label="lockType", Tag=0x00000001, Type=DoorLock.Enums.DlLockType), - ClusterObjectFieldDescriptor(Label="actuatorEnabled", Tag=0x00000002, Type=bool), - ClusterObjectFieldDescriptor(Label="doorState", Tag=0x00000003, Type=typing.Union[None, Nullable, DoorLock.Enums.DoorStateEnum]), - ClusterObjectFieldDescriptor(Label="doorOpenEvents", Tag=0x00000004, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="doorClosedEvents", Tag=0x00000005, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="openPeriod", Tag=0x00000006, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="numberOfTotalUsersSupported", Tag=0x00000011, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="numberOfPINUsersSupported", Tag=0x00000012, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="numberOfRFIDUsersSupported", Tag=0x00000013, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="numberOfWeekDaySchedulesSupportedPerUser", Tag=0x00000014, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="numberOfYearDaySchedulesSupportedPerUser", Tag=0x00000015, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="numberOfHolidaySchedulesSupported", Tag=0x00000016, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="maxPINCodeLength", Tag=0x00000017, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="minPINCodeLength", Tag=0x00000018, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="maxRFIDCodeLength", Tag=0x00000019, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="minRFIDCodeLength", Tag=0x0000001A, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="credentialRulesSupport", Tag=0x0000001B, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="numberOfCredentialsSupportedPerUser", Tag=0x0000001C, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="language", Tag=0x00000021, Type=typing.Optional[str]), - ClusterObjectFieldDescriptor(Label="LEDSettings", Tag=0x00000022, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="autoRelockTime", Tag=0x00000023, Type=uint), - ClusterObjectFieldDescriptor(Label="soundVolume", Tag=0x00000024, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="operatingMode", Tag=0x00000025, Type=DoorLock.Enums.OperatingModeEnum), - ClusterObjectFieldDescriptor(Label="supportedOperatingModes", Tag=0x00000026, Type=uint), - ClusterObjectFieldDescriptor(Label="defaultConfigurationRegister", Tag=0x00000027, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="enableLocalProgramming", Tag=0x00000028, Type=typing.Optional[bool]), - ClusterObjectFieldDescriptor(Label="enableOneTouchLocking", Tag=0x00000029, Type=typing.Optional[bool]), - ClusterObjectFieldDescriptor(Label="enableInsideStatusLED", Tag=0x0000002A, Type=typing.Optional[bool]), - ClusterObjectFieldDescriptor(Label="enablePrivacyModeButton", Tag=0x0000002B, Type=typing.Optional[bool]), - ClusterObjectFieldDescriptor(Label="localProgrammingFeatures", Tag=0x0000002C, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="wrongCodeEntryLimit", Tag=0x00000030, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="userCodeTemporaryDisableTime", Tag=0x00000031, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="sendPINOverTheAir", Tag=0x00000032, Type=typing.Optional[bool]), - ClusterObjectFieldDescriptor(Label="requirePINforRemoteOperation", Tag=0x00000033, Type=typing.Optional[bool]), - ClusterObjectFieldDescriptor(Label="expiringUserTimeout", Tag=0x00000035, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), - ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), - ]) - - lockState: 'typing.Union[Nullable, DoorLock.Enums.DlLockState]' = None - lockType: 'DoorLock.Enums.DlLockType' = None - actuatorEnabled: 'bool' = None - doorState: 'typing.Union[None, Nullable, DoorLock.Enums.DoorStateEnum]' = None - doorOpenEvents: 'typing.Optional[uint]' = None - doorClosedEvents: 'typing.Optional[uint]' = None - openPeriod: 'typing.Optional[uint]' = None - numberOfTotalUsersSupported: 'typing.Optional[uint]' = None - numberOfPINUsersSupported: 'typing.Optional[uint]' = None - numberOfRFIDUsersSupported: 'typing.Optional[uint]' = None - numberOfWeekDaySchedulesSupportedPerUser: 'typing.Optional[uint]' = None - numberOfYearDaySchedulesSupportedPerUser: 'typing.Optional[uint]' = None - numberOfHolidaySchedulesSupported: 'typing.Optional[uint]' = None - maxPINCodeLength: 'typing.Optional[uint]' = None - minPINCodeLength: 'typing.Optional[uint]' = None - maxRFIDCodeLength: 'typing.Optional[uint]' = None - minRFIDCodeLength: 'typing.Optional[uint]' = None - credentialRulesSupport: 'typing.Optional[uint]' = None - numberOfCredentialsSupportedPerUser: 'typing.Optional[uint]' = None - language: 'typing.Optional[str]' = None - LEDSettings: 'typing.Optional[uint]' = None - autoRelockTime: 'uint' = None - soundVolume: 'typing.Optional[uint]' = None - operatingMode: 'DoorLock.Enums.OperatingModeEnum' = None - supportedOperatingModes: 'uint' = None - defaultConfigurationRegister: 'typing.Optional[uint]' = None - enableLocalProgramming: 'typing.Optional[bool]' = None - enableOneTouchLocking: 'typing.Optional[bool]' = None - enableInsideStatusLED: 'typing.Optional[bool]' = None - enablePrivacyModeButton: 'typing.Optional[bool]' = None - localProgrammingFeatures: 'typing.Optional[uint]' = None - wrongCodeEntryLimit: 'typing.Optional[uint]' = None - userCodeTemporaryDisableTime: 'typing.Optional[uint]' = None - sendPINOverTheAir: 'typing.Optional[bool]' = None - requirePINforRemoteOperation: 'typing.Optional[bool]' = None - expiringUserTimeout: 'typing.Optional[uint]' = None - generatedCommandList: 'typing.List[uint]' = None - acceptedCommandList: 'typing.List[uint]' = None - eventList: 'typing.List[uint]' = None - attributeList: 'typing.List[uint]' = None - featureMap: 'uint' = None - clusterRevision: 'uint' = None - - class Enums: - class AlarmCodeEnum(MatterIntEnum): - kLockJammed = 0x00 - kLockFactoryReset = 0x01 - kLockRadioPowerCycled = 0x03 - kWrongCodeEntryLimit = 0x04 - kFrontEsceutcheonRemoved = 0x05 - kDoorForcedOpen = 0x06 - kDoorAjar = 0x07 - kForcedUser = 0x08 - # All received enum values that are not listed above will be mapped - # to kUnknownEnumValue. This is a helper enum value that should only - # be used by code to process how it handles receiving and unknown - # enum value. This specific should never be transmitted. - kUnknownEnumValue = 2, - - class CredentialRuleEnum(MatterIntEnum): - kSingle = 0x00 - kDual = 0x01 - kTri = 0x02 - # All received enum values that are not listed above will be mapped - # to kUnknownEnumValue. This is a helper enum value that should only - # be used by code to process how it handles receiving and unknown - # enum value. This specific should never be transmitted. - kUnknownEnumValue = 3, - - class CredentialTypeEnum(MatterIntEnum): - kProgrammingPIN = 0x00 - kPin = 0x01 - kRfid = 0x02 - kFingerprint = 0x03 - kFingerVein = 0x04 - kFace = 0x05 - # All received enum values that are not listed above will be mapped - # to kUnknownEnumValue. This is a helper enum value that should only - # be used by code to process how it handles receiving and unknown - # enum value. This specific should never be transmitted. - kUnknownEnumValue = 6, - - class DataOperationTypeEnum(MatterIntEnum): - kAdd = 0x00 - kClear = 0x01 - kModify = 0x02 - # All received enum values that are not listed above will be mapped - # to kUnknownEnumValue. This is a helper enum value that should only - # be used by code to process how it handles receiving and unknown - # enum value. This specific should never be transmitted. - kUnknownEnumValue = 3, - - class DlLockState(MatterIntEnum): - kNotFullyLocked = 0x00 - kLocked = 0x01 - kUnlocked = 0x02 - kUnlatched = 0x03 - # All received enum values that are not listed above will be mapped - # to kUnknownEnumValue. This is a helper enum value that should only - # be used by code to process how it handles receiving and unknown - # enum value. This specific should never be transmitted. - kUnknownEnumValue = 4, + class DlLockState(MatterIntEnum): + kNotFullyLocked = 0x00 + kLocked = 0x01 + kUnlocked = 0x02 + kUnlatched = 0x03 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving and unknown + # enum value. This specific should never be transmitted. + kUnknownEnumValue = 4, class DlLockType(MatterIntEnum): kDeadBolt = 0x00 @@ -27606,9 +26172,9 @@ class ThermostatUserInterfaceConfiguration(Cluster): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="temperatureDisplayMode", Tag=0x00000000, Type=ThermostatUserInterfaceConfiguration.Enums.TemperatureDisplayModeEnum), - ClusterObjectFieldDescriptor(Label="keypadLockout", Tag=0x00000001, Type=ThermostatUserInterfaceConfiguration.Enums.KeypadLockoutEnum), - ClusterObjectFieldDescriptor(Label="scheduleProgrammingVisibility", Tag=0x00000002, Type=typing.Optional[ThermostatUserInterfaceConfiguration.Enums.ScheduleProgrammingVisibilityEnum]), + ClusterObjectFieldDescriptor(Label="temperatureDisplayMode", Tag=0x00000000, Type=uint), + ClusterObjectFieldDescriptor(Label="keypadLockout", Tag=0x00000001, Type=uint), + ClusterObjectFieldDescriptor(Label="scheduleProgrammingVisibility", Tag=0x00000002, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -27617,9 +26183,9 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - temperatureDisplayMode: 'ThermostatUserInterfaceConfiguration.Enums.TemperatureDisplayModeEnum' = None - keypadLockout: 'ThermostatUserInterfaceConfiguration.Enums.KeypadLockoutEnum' = None - scheduleProgrammingVisibility: 'typing.Optional[ThermostatUserInterfaceConfiguration.Enums.ScheduleProgrammingVisibilityEnum]' = None + temperatureDisplayMode: 'uint' = None + keypadLockout: 'uint' = None + scheduleProgrammingVisibility: 'typing.Optional[uint]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None eventList: 'typing.List[uint]' = None @@ -27627,38 +26193,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: featureMap: 'uint' = None clusterRevision: 'uint' = None - class Enums: - class KeypadLockoutEnum(MatterIntEnum): - kNoLockout = 0x00 - kLockout1 = 0x01 - kLockout2 = 0x02 - kLockout3 = 0x03 - kLockout4 = 0x04 - kLockout5 = 0x05 - # All received enum values that are not listed above will be mapped - # to kUnknownEnumValue. This is a helper enum value that should only - # be used by code to process how it handles receiving and unknown - # enum value. This specific should never be transmitted. - kUnknownEnumValue = 6, - - class ScheduleProgrammingVisibilityEnum(MatterIntEnum): - kScheduleProgrammingPermitted = 0x00 - kScheduleProgrammingDenied = 0x01 - # All received enum values that are not listed above will be mapped - # to kUnknownEnumValue. This is a helper enum value that should only - # be used by code to process how it handles receiving and unknown - # enum value. This specific should never be transmitted. - kUnknownEnumValue = 2, - - class TemperatureDisplayModeEnum(MatterIntEnum): - kCelsius = 0x00 - kFahrenheit = 0x01 - # All received enum values that are not listed above will be mapped - # to kUnknownEnumValue. This is a helper enum value that should only - # be used by code to process how it handles receiving and unknown - # enum value. This specific should never be transmitted. - kUnknownEnumValue = 2, - class Attributes: @dataclass class TemperatureDisplayMode(ClusterAttributeDescriptor): @@ -27672,9 +26206,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=ThermostatUserInterfaceConfiguration.Enums.TemperatureDisplayModeEnum) + return ClusterObjectFieldDescriptor(Type=uint) - value: 'ThermostatUserInterfaceConfiguration.Enums.TemperatureDisplayModeEnum' = 0 + value: 'uint' = 0 @dataclass class KeypadLockout(ClusterAttributeDescriptor): @@ -27688,9 +26222,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=ThermostatUserInterfaceConfiguration.Enums.KeypadLockoutEnum) + return ClusterObjectFieldDescriptor(Type=uint) - value: 'ThermostatUserInterfaceConfiguration.Enums.KeypadLockoutEnum' = 0 + value: 'uint' = 0 @dataclass class ScheduleProgrammingVisibility(ClusterAttributeDescriptor): @@ -27704,9 +26238,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[ThermostatUserInterfaceConfiguration.Enums.ScheduleProgrammingVisibilityEnum]) + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - value: 'typing.Optional[ThermostatUserInterfaceConfiguration.Enums.ScheduleProgrammingVisibilityEnum]' = None + value: 'typing.Optional[uint]' = None @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index 93d825bbdbf865..e5a6362798dd05 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -579,12 +579,6 @@ static BOOL AttributeIsSpecifiedInBasicInformationCluster(AttributeId aAttribute case Attributes::ProductAppearance::Id: { return YES; } - case Attributes::SpecificationVersion::Id: { - return YES; - } - case Attributes::MaxPathsPerInvoke::Id: { - return YES; - } case Attributes::GeneratedCommandList::Id: { return YES; } @@ -1922,17 +1916,14 @@ static BOOL AttributeIsSpecifiedInICDManagementCluster(AttributeId aAttributeId) } } } -static BOOL AttributeIsSpecifiedInTimerCluster(AttributeId aAttributeId) +static BOOL AttributeIsSpecifiedInLaundryDryerControlsCluster(AttributeId aAttributeId) { - using namespace Clusters::Timer; + using namespace Clusters::LaundryDryerControls; switch (aAttributeId) { - case Attributes::SetTime::Id: { + case Attributes::SupportedDrynessLevels::Id: { return YES; } - case Attributes::TimeRemaining::Id: { - return YES; - } - case Attributes::TimerState::Id: { + case Attributes::SelectedDrynessLevel::Id: { return YES; } case Attributes::GeneratedCommandList::Id: { @@ -2741,156 +2732,6 @@ static BOOL AttributeIsSpecifiedInActivatedCarbonFilterMonitoringCluster(Attribu } } } -static BOOL AttributeIsSpecifiedInBooleanSensorConfigurationCluster(AttributeId aAttributeId) -{ - using namespace Clusters::BooleanSensorConfiguration; - switch (aAttributeId) { - case Attributes::SensitivityLevel::Id: { - return YES; - } - case Attributes::AlarmsActive::Id: { - return YES; - } - case Attributes::AlarmsSuppressed::Id: { - return YES; - } - case Attributes::AlarmsEnabled::Id: { - return YES; - } - case Attributes::GeneratedCommandList::Id: { - return YES; - } - case Attributes::AcceptedCommandList::Id: { - return YES; - } - case Attributes::EventList::Id: { - return YES; - } - case Attributes::AttributeList::Id: { - return YES; - } - case Attributes::FeatureMap::Id: { - return YES; - } - case Attributes::ClusterRevision::Id: { - return YES; - } - default: { - return NO; - } - } -} -static BOOL AttributeIsSpecifiedInValveConfigurationAndControlCluster(AttributeId aAttributeId) -{ - using namespace Clusters::ValveConfigurationAndControl; - switch (aAttributeId) { - case Attributes::OpenDuration::Id: { - return YES; - } - case Attributes::AutoCloseTime::Id: { - return YES; - } - case Attributes::RemainingDuration::Id: { - return YES; - } - case Attributes::CurrentState::Id: { - return YES; - } - case Attributes::TargetState::Id: { - return YES; - } - case Attributes::StartUpState::Id: { - return YES; - } - case Attributes::CurrentLevel::Id: { - return YES; - } - case Attributes::TargetLevel::Id: { - return YES; - } - case Attributes::OpenLevel::Id: { - return YES; - } - case Attributes::ValveFault::Id: { - return YES; - } - case Attributes::GeneratedCommandList::Id: { - return YES; - } - case Attributes::AcceptedCommandList::Id: { - return YES; - } - case Attributes::EventList::Id: { - return YES; - } - case Attributes::AttributeList::Id: { - return YES; - } - case Attributes::FeatureMap::Id: { - return YES; - } - case Attributes::ClusterRevision::Id: { - return YES; - } - default: { - return NO; - } - } -} -static BOOL AttributeIsSpecifiedInDemandResponseLoadControlCluster(AttributeId aAttributeId) -{ - using namespace Clusters::DemandResponseLoadControl; - switch (aAttributeId) { - case Attributes::DeviceClass::Id: { - return YES; - } - case Attributes::LoadControlPrograms::Id: { - return YES; - } - case Attributes::NumberOfLoadControlPrograms::Id: { - return YES; - } - case Attributes::Events::Id: { - return YES; - } - case Attributes::ActiveEvents::Id: { - return YES; - } - case Attributes::NumberOfEventsPerProgram::Id: { - return YES; - } - case Attributes::NumberOfTransistions::Id: { - return YES; - } - case Attributes::DefaultRandomStart::Id: { - return YES; - } - case Attributes::DefaultRandomDuration::Id: { - return YES; - } - case Attributes::GeneratedCommandList::Id: { - return YES; - } - case Attributes::AcceptedCommandList::Id: { - return YES; - } - case Attributes::EventList::Id: { - return YES; - } - case Attributes::AttributeList::Id: { - return YES; - } - case Attributes::FeatureMap::Id: { - return YES; - } - case Attributes::ClusterRevision::Id: { - return YES; - } - default: { - return NO; - } - } -} static BOOL AttributeIsSpecifiedInDoorLockCluster(AttributeId aAttributeId) { using namespace Clusters::DoorLock; @@ -5919,8 +5760,8 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::IcdManagement::Id: { return AttributeIsSpecifiedInICDManagementCluster(aAttributeId); } - case Clusters::Timer::Id: { - return AttributeIsSpecifiedInTimerCluster(aAttributeId); + case Clusters::LaundryDryerControls::Id: { + return AttributeIsSpecifiedInLaundryDryerControlsCluster(aAttributeId); } case Clusters::OvenMode::Id: { return AttributeIsSpecifiedInOvenModeCluster(aAttributeId); @@ -5979,15 +5820,6 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::ActivatedCarbonFilterMonitoring::Id: { return AttributeIsSpecifiedInActivatedCarbonFilterMonitoringCluster(aAttributeId); } - case Clusters::BooleanSensorConfiguration::Id: { - return AttributeIsSpecifiedInBooleanSensorConfigurationCluster(aAttributeId); - } - case Clusters::ValveConfigurationAndControl::Id: { - return AttributeIsSpecifiedInValveConfigurationAndControlCluster(aAttributeId); - } - case Clusters::DemandResponseLoadControl::Id: { - return AttributeIsSpecifiedInDemandResponseLoadControlCluster(aAttributeId); - } case Clusters::DoorLock::Id: { return AttributeIsSpecifiedInDoorLockCluster(aAttributeId); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 6b62937c80f566..7b5a481d4ebff6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -1585,28 +1585,6 @@ static id _Nullable DecodeAttributeValueForBasicInformationCluster(AttributeId a } return value; } - case Attributes::SpecificationVersion::Id: { - using TypeInfo = Attributes::SpecificationVersion::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::MaxPathsPerInvoke::Id: { - using TypeInfo = Attributes::MaxPathsPerInvoke::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: { break; } @@ -5234,41 +5212,49 @@ static id _Nullable DecodeAttributeValueForICDManagementCluster(AttributeId aAtt *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForTimerCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +static id _Nullable DecodeAttributeValueForLaundryDryerControlsCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::Timer; + using namespace Clusters::LaundryDryerControls; switch (aAttributeId) { - case Attributes::SetTime::Id: { - using TypeInfo = Attributes::SetTime::TypeInfo; + case Attributes::SupportedDrynessLevels::Id: { + using TypeInfo = Attributes::SupportedDrynessLevels::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::TimeRemaining::Id: { - using TypeInfo = Attributes::TimeRemaining::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 numberWithUnsignedChar:chip::to_underlying(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; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::TimerState::Id: { - using TypeInfo = Attributes::TimerState::TypeInfo; + case Attributes::SelectedDrynessLevel::Id: { + using TypeInfo = Attributes::SelectedDrynessLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; + } return value; } default: { @@ -7171,598 +7157,6 @@ static id _Nullable DecodeAttributeValueForActivatedCarbonFilterMonitoringCluste *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForBooleanSensorConfigurationCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::BooleanSensorConfiguration; - switch (aAttributeId) { - case Attributes::SensitivityLevel::Id: { - using TypeInfo = Attributes::SensitivityLevel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::AlarmsActive::Id: { - using TypeInfo = Attributes::AlarmsActive::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; - return value; - } - case Attributes::AlarmsSuppressed::Id: { - using TypeInfo = Attributes::AlarmsSuppressed::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; - return value; - } - case Attributes::AlarmsEnabled::Id: { - using TypeInfo = Attributes::AlarmsEnabled::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForValveConfigurationAndControlCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::ValveConfigurationAndControl; - switch (aAttributeId) { - case Attributes::OpenDuration::Id: { - using TypeInfo = Attributes::OpenDuration::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::AutoCloseTime::Id: { - using TypeInfo = Attributes::AutoCloseTime::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 numberWithUnsignedLongLong:cppValue.Value()]; - } - return value; - } - case Attributes::RemainingDuration::Id: { - using TypeInfo = Attributes::RemainingDuration::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::CurrentState::Id: { - using TypeInfo = Attributes::CurrentState::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:chip::to_underlying(cppValue.Value())]; - } - return value; - } - case Attributes::TargetState::Id: { - using TypeInfo = Attributes::TargetState::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:chip::to_underlying(cppValue.Value())]; - } - return value; - } - case Attributes::StartUpState::Id: { - using TypeInfo = Attributes::StartUpState::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::CurrentLevel::Id: { - using TypeInfo = Attributes::CurrentLevel::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::TargetLevel::Id: { - using TypeInfo = Attributes::TargetLevel::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::OpenLevel::Id: { - using TypeInfo = Attributes::OpenLevel::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::ValveFault::Id: { - using TypeInfo = Attributes::ValveFault::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue.Raw()]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForDemandResponseLoadControlCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::DemandResponseLoadControl; - switch (aAttributeId) { - case Attributes::DeviceClass::Id: { - using TypeInfo = Attributes::DeviceClass::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; - return value; - } - case Attributes::LoadControlPrograms::Id: { - using TypeInfo = Attributes::LoadControlPrograms::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(); - MTRDemandResponseLoadControlClusterLoadControlProgramStruct * newElement_0; - newElement_0 = [MTRDemandResponseLoadControlClusterLoadControlProgramStruct new]; - newElement_0.programID = AsData(entry_0.programID); - newElement_0.name = AsString(entry_0.name); - if (newElement_0.name == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - if (entry_0.enrollmentGroup.IsNull()) { - newElement_0.enrollmentGroup = nil; - } else { - newElement_0.enrollmentGroup = [NSNumber numberWithUnsignedChar:entry_0.enrollmentGroup.Value()]; - } - if (entry_0.randomStartMinutes.IsNull()) { - newElement_0.randomStartMinutes = nil; - } else { - newElement_0.randomStartMinutes = [NSNumber numberWithUnsignedChar:entry_0.randomStartMinutes.Value()]; - } - if (entry_0.randomDurationMinutes.IsNull()) { - newElement_0.randomDurationMinutes = nil; - } else { - newElement_0.randomDurationMinutes = [NSNumber numberWithUnsignedChar:entry_0.randomDurationMinutes.Value()]; - } - [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::NumberOfLoadControlPrograms::Id: { - using TypeInfo = Attributes::NumberOfLoadControlPrograms::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::Events::Id: { - using TypeInfo = Attributes::Events::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(); - MTRDemandResponseLoadControlClusterLoadControlEventStruct * newElement_0; - newElement_0 = [MTRDemandResponseLoadControlClusterLoadControlEventStruct new]; - newElement_0.eventID = AsData(entry_0.eventID); - if (entry_0.programID.IsNull()) { - newElement_0.programID = nil; - } else { - newElement_0.programID = AsData(entry_0.programID.Value()); - } - newElement_0.control = [NSNumber numberWithUnsignedShort:entry_0.control.Raw()]; - newElement_0.deviceClass = [NSNumber numberWithUnsignedInt:entry_0.deviceClass.Raw()]; - if (entry_0.enrollmentGroup.HasValue()) { - newElement_0.enrollmentGroup = [NSNumber numberWithUnsignedChar:entry_0.enrollmentGroup.Value()]; - } else { - newElement_0.enrollmentGroup = nil; - } - newElement_0.criticality = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.criticality)]; - if (entry_0.startTime.IsNull()) { - newElement_0.startTime = nil; - } else { - newElement_0.startTime = [NSNumber numberWithUnsignedInt:entry_0.startTime.Value()]; - } - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.transitions.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - MTRDemandResponseLoadControlClusterLoadControlEventTransitionStruct * newElement_2; - newElement_2 = [MTRDemandResponseLoadControlClusterLoadControlEventTransitionStruct new]; - newElement_2.duration = [NSNumber numberWithUnsignedShort:entry_2.duration]; - newElement_2.control = [NSNumber numberWithUnsignedShort:entry_2.control.Raw()]; - if (entry_2.temperatureControl.HasValue()) { - newElement_2.temperatureControl = [MTRDemandResponseLoadControlClusterTemperatureControlStruct new]; - if (entry_2.temperatureControl.Value().coolingTempOffset.HasValue()) { - if (entry_2.temperatureControl.Value().coolingTempOffset.Value().IsNull()) { - newElement_2.temperatureControl.coolingTempOffset = nil; - } else { - newElement_2.temperatureControl.coolingTempOffset = [NSNumber numberWithUnsignedShort:entry_2.temperatureControl.Value().coolingTempOffset.Value().Value()]; - } - } else { - newElement_2.temperatureControl.coolingTempOffset = nil; - } - if (entry_2.temperatureControl.Value().heatingtTempOffset.HasValue()) { - if (entry_2.temperatureControl.Value().heatingtTempOffset.Value().IsNull()) { - newElement_2.temperatureControl.heatingtTempOffset = nil; - } else { - newElement_2.temperatureControl.heatingtTempOffset = [NSNumber numberWithUnsignedShort:entry_2.temperatureControl.Value().heatingtTempOffset.Value().Value()]; - } - } else { - newElement_2.temperatureControl.heatingtTempOffset = nil; - } - if (entry_2.temperatureControl.Value().coolingTempSetpoint.HasValue()) { - if (entry_2.temperatureControl.Value().coolingTempSetpoint.Value().IsNull()) { - newElement_2.temperatureControl.coolingTempSetpoint = nil; - } else { - newElement_2.temperatureControl.coolingTempSetpoint = [NSNumber numberWithShort:entry_2.temperatureControl.Value().coolingTempSetpoint.Value().Value()]; - } - } else { - newElement_2.temperatureControl.coolingTempSetpoint = nil; - } - if (entry_2.temperatureControl.Value().heatingTempSetpoint.HasValue()) { - if (entry_2.temperatureControl.Value().heatingTempSetpoint.Value().IsNull()) { - newElement_2.temperatureControl.heatingTempSetpoint = nil; - } else { - newElement_2.temperatureControl.heatingTempSetpoint = [NSNumber numberWithShort:entry_2.temperatureControl.Value().heatingTempSetpoint.Value().Value()]; - } - } else { - newElement_2.temperatureControl.heatingTempSetpoint = nil; - } - } else { - newElement_2.temperatureControl = nil; - } - if (entry_2.averageLoadControl.HasValue()) { - newElement_2.averageLoadControl = [MTRDemandResponseLoadControlClusterAverageLoadControlStruct new]; - newElement_2.averageLoadControl.loadAdjustment = [NSNumber numberWithChar:entry_2.averageLoadControl.Value().loadAdjustment]; - } else { - newElement_2.averageLoadControl = nil; - } - if (entry_2.dutyCycleControl.HasValue()) { - newElement_2.dutyCycleControl = [MTRDemandResponseLoadControlClusterDutyCycleControlStruct new]; - newElement_2.dutyCycleControl.dutyCycle = [NSNumber numberWithUnsignedChar:entry_2.dutyCycleControl.Value().dutyCycle]; - } else { - newElement_2.dutyCycleControl = nil; - } - if (entry_2.powerSavingsControl.HasValue()) { - newElement_2.powerSavingsControl = [MTRDemandResponseLoadControlClusterPowerSavingsControlStruct new]; - newElement_2.powerSavingsControl.powerSavings = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_2.powerSavingsControl.Value().powerSavings)]; - } else { - newElement_2.powerSavingsControl = nil; - } - if (entry_2.heatingSourceControl.HasValue()) { - newElement_2.heatingSourceControl = [MTRDemandResponseLoadControlClusterHeatingSourceControlStruct new]; - newElement_2.heatingSourceControl.heatingSource = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_2.heatingSourceControl.Value().heatingSource)]; - } else { - newElement_2.heatingSourceControl = nil; - } - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.transitions = array_2; - } - [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::ActiveEvents::Id: { - using TypeInfo = Attributes::ActiveEvents::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(); - MTRDemandResponseLoadControlClusterLoadControlEventStruct * newElement_0; - newElement_0 = [MTRDemandResponseLoadControlClusterLoadControlEventStruct new]; - newElement_0.eventID = AsData(entry_0.eventID); - if (entry_0.programID.IsNull()) { - newElement_0.programID = nil; - } else { - newElement_0.programID = AsData(entry_0.programID.Value()); - } - newElement_0.control = [NSNumber numberWithUnsignedShort:entry_0.control.Raw()]; - newElement_0.deviceClass = [NSNumber numberWithUnsignedInt:entry_0.deviceClass.Raw()]; - if (entry_0.enrollmentGroup.HasValue()) { - newElement_0.enrollmentGroup = [NSNumber numberWithUnsignedChar:entry_0.enrollmentGroup.Value()]; - } else { - newElement_0.enrollmentGroup = nil; - } - newElement_0.criticality = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.criticality)]; - if (entry_0.startTime.IsNull()) { - newElement_0.startTime = nil; - } else { - newElement_0.startTime = [NSNumber numberWithUnsignedInt:entry_0.startTime.Value()]; - } - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.transitions.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - MTRDemandResponseLoadControlClusterLoadControlEventTransitionStruct * newElement_2; - newElement_2 = [MTRDemandResponseLoadControlClusterLoadControlEventTransitionStruct new]; - newElement_2.duration = [NSNumber numberWithUnsignedShort:entry_2.duration]; - newElement_2.control = [NSNumber numberWithUnsignedShort:entry_2.control.Raw()]; - if (entry_2.temperatureControl.HasValue()) { - newElement_2.temperatureControl = [MTRDemandResponseLoadControlClusterTemperatureControlStruct new]; - if (entry_2.temperatureControl.Value().coolingTempOffset.HasValue()) { - if (entry_2.temperatureControl.Value().coolingTempOffset.Value().IsNull()) { - newElement_2.temperatureControl.coolingTempOffset = nil; - } else { - newElement_2.temperatureControl.coolingTempOffset = [NSNumber numberWithUnsignedShort:entry_2.temperatureControl.Value().coolingTempOffset.Value().Value()]; - } - } else { - newElement_2.temperatureControl.coolingTempOffset = nil; - } - if (entry_2.temperatureControl.Value().heatingtTempOffset.HasValue()) { - if (entry_2.temperatureControl.Value().heatingtTempOffset.Value().IsNull()) { - newElement_2.temperatureControl.heatingtTempOffset = nil; - } else { - newElement_2.temperatureControl.heatingtTempOffset = [NSNumber numberWithUnsignedShort:entry_2.temperatureControl.Value().heatingtTempOffset.Value().Value()]; - } - } else { - newElement_2.temperatureControl.heatingtTempOffset = nil; - } - if (entry_2.temperatureControl.Value().coolingTempSetpoint.HasValue()) { - if (entry_2.temperatureControl.Value().coolingTempSetpoint.Value().IsNull()) { - newElement_2.temperatureControl.coolingTempSetpoint = nil; - } else { - newElement_2.temperatureControl.coolingTempSetpoint = [NSNumber numberWithShort:entry_2.temperatureControl.Value().coolingTempSetpoint.Value().Value()]; - } - } else { - newElement_2.temperatureControl.coolingTempSetpoint = nil; - } - if (entry_2.temperatureControl.Value().heatingTempSetpoint.HasValue()) { - if (entry_2.temperatureControl.Value().heatingTempSetpoint.Value().IsNull()) { - newElement_2.temperatureControl.heatingTempSetpoint = nil; - } else { - newElement_2.temperatureControl.heatingTempSetpoint = [NSNumber numberWithShort:entry_2.temperatureControl.Value().heatingTempSetpoint.Value().Value()]; - } - } else { - newElement_2.temperatureControl.heatingTempSetpoint = nil; - } - } else { - newElement_2.temperatureControl = nil; - } - if (entry_2.averageLoadControl.HasValue()) { - newElement_2.averageLoadControl = [MTRDemandResponseLoadControlClusterAverageLoadControlStruct new]; - newElement_2.averageLoadControl.loadAdjustment = [NSNumber numberWithChar:entry_2.averageLoadControl.Value().loadAdjustment]; - } else { - newElement_2.averageLoadControl = nil; - } - if (entry_2.dutyCycleControl.HasValue()) { - newElement_2.dutyCycleControl = [MTRDemandResponseLoadControlClusterDutyCycleControlStruct new]; - newElement_2.dutyCycleControl.dutyCycle = [NSNumber numberWithUnsignedChar:entry_2.dutyCycleControl.Value().dutyCycle]; - } else { - newElement_2.dutyCycleControl = nil; - } - if (entry_2.powerSavingsControl.HasValue()) { - newElement_2.powerSavingsControl = [MTRDemandResponseLoadControlClusterPowerSavingsControlStruct new]; - newElement_2.powerSavingsControl.powerSavings = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_2.powerSavingsControl.Value().powerSavings)]; - } else { - newElement_2.powerSavingsControl = nil; - } - if (entry_2.heatingSourceControl.HasValue()) { - newElement_2.heatingSourceControl = [MTRDemandResponseLoadControlClusterHeatingSourceControlStruct new]; - newElement_2.heatingSourceControl.heatingSource = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_2.heatingSourceControl.Value().heatingSource)]; - } else { - newElement_2.heatingSourceControl = nil; - } - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.transitions = array_2; - } - [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::NumberOfEventsPerProgram::Id: { - using TypeInfo = Attributes::NumberOfEventsPerProgram::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::NumberOfTransistions::Id: { - using TypeInfo = Attributes::NumberOfTransistions::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::DefaultRandomStart::Id: { - using TypeInfo = Attributes::DefaultRandomStart::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::DefaultRandomDuration::Id: { - using TypeInfo = Attributes::DefaultRandomDuration::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} static id _Nullable DecodeAttributeValueForDoorLockCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::DoorLock; @@ -9688,7 +9082,7 @@ static id _Nullable DecodeAttributeValueForThermostatUserInterfaceConfigurationC return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } case Attributes::KeypadLockout::Id: { @@ -9699,7 +9093,7 @@ static id _Nullable DecodeAttributeValueForThermostatUserInterfaceConfigurationC return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } case Attributes::ScheduleProgrammingVisibility::Id: { @@ -9710,7 +9104,7 @@ static id _Nullable DecodeAttributeValueForThermostatUserInterfaceConfigurationC return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } default: { @@ -16404,8 +15798,8 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::IcdManagement::Id: { return DecodeAttributeValueForICDManagementCluster(aPath.mAttributeId, aReader, aError); } - case Clusters::Timer::Id: { - return DecodeAttributeValueForTimerCluster(aPath.mAttributeId, aReader, aError); + case Clusters::LaundryDryerControls::Id: { + return DecodeAttributeValueForLaundryDryerControlsCluster(aPath.mAttributeId, aReader, aError); } case Clusters::OvenMode::Id: { return DecodeAttributeValueForOvenModeCluster(aPath.mAttributeId, aReader, aError); @@ -16464,15 +15858,6 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::ActivatedCarbonFilterMonitoring::Id: { return DecodeAttributeValueForActivatedCarbonFilterMonitoringCluster(aPath.mAttributeId, aReader, aError); } - case Clusters::BooleanSensorConfiguration::Id: { - return DecodeAttributeValueForBooleanSensorConfigurationCluster(aPath.mAttributeId, aReader, aError); - } - case Clusters::ValveConfigurationAndControl::Id: { - return DecodeAttributeValueForValveConfigurationAndControlCluster(aPath.mAttributeId, aReader, aError); - } - case Clusters::DemandResponseLoadControl::Id: { - return DecodeAttributeValueForDemandResponseLoadControlCluster(aPath.mAttributeId, aReader, aError); - } case Clusters::DoorLock::Id: { return DecodeAttributeValueForDoorLockCluster(aPath.mAttributeId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 580d0ad08415de..81030293dbd549 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -11752,78 +11752,6 @@ + (void)readAttributeProductAppearanceWithClusterStateCache:(MTRClusterStateCach completion:completion]; } -- (void)readAttributeSpecificationVersionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = BasicInformation::Attributes::SpecificationVersion::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeSpecificationVersionWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = BasicInformation::Attributes::SpecificationVersion::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeSpecificationVersionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = BasicInformation::Attributes::SpecificationVersion::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeMaxPathsPerInvokeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = BasicInformation::Attributes::MaxPathsPerInvoke::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeMaxPathsPerInvokeWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = BasicInformation::Attributes::MaxPathsPerInvoke::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeMaxPathsPerInvokeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = BasicInformation::Attributes::MaxPathsPerInvoke::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = BasicInformation::Attributes::GeneratedCommandList::TypeInfo; @@ -38779,112 +38707,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end -@implementation MTRBaseClusterTimer - -- (void)setTimerWithParams:(MTRTimerClusterSetTimerParams *)params completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRTimerClusterSetTimerParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = Timer::Commands::SetTimer::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} -- (void)resetTimerWithCompletion:(MTRStatusCompletion)completion -{ - [self resetTimerWithParams:nil completion:completion]; -} -- (void)resetTimerWithParams:(MTRTimerClusterResetTimerParams * _Nullable)params completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRTimerClusterResetTimerParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; +@implementation MTRBaseClusterLaundryDryerControls - using RequestType = Timer::Commands::ResetTimer::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} -- (void)addTimeWithParams:(MTRTimerClusterAddTimeParams *)params completion:(MTRStatusCompletion)completion +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue { - if (params == nil) { - params = [[MTRTimerClusterAddTimeParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (self = [super initWithEndpointID:endpointID queue:queue]) { + if (device == nil) { + return nil; + } - using RequestType = Timer::Commands::AddTime::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} -- (void)reduceTimeWithParams:(MTRTimerClusterReduceTimeParams *)params completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRTimerClusterReduceTimeParams - alloc] init]; + _device = device; } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = Timer::Commands::ReduceTime::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; + return self; } -- (void)readAttributeSetTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +- (void)readAttributeSupportedDrynessLevelsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = Timer::Attributes::SetTime::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::SupportedDrynessLevels::TypeInfo; [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -38893,11 +38732,11 @@ - (void)readAttributeSetTimeWithCompletion:(void (^)(NSNumber * _Nullable value, completion:completion]; } -- (void)subscribeAttributeSetTimeWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +- (void)subscribeAttributeSupportedDrynessLevelsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = Timer::Attributes::SetTime::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::SupportedDrynessLevels::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -38907,9 +38746,9 @@ - (void)subscribeAttributeSetTimeWithParams:(MTRSubscribeParams * _Nonnull)param subscriptionEstablished:subscriptionEstablished]; } -+ (void)readAttributeSetTimeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion ++ (void)readAttributeSupportedDrynessLevelsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = Timer::Attributes::SetTime::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::SupportedDrynessLevels::TypeInfo; [clusterStateCacheContainer _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) clusterID:TypeInfo::GetClusterId() @@ -38918,9 +38757,9 @@ + (void)readAttributeSetTimeWithClusterStateCache:(MTRClusterStateCacheContainer completion:completion]; } -- (void)readAttributeTimeRemainingWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +- (void)readAttributeSelectedDrynessLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = Timer::Attributes::TimeRemaining::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::SelectedDrynessLevel::TypeInfo; [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -38929,47 +38768,44 @@ - (void)readAttributeTimeRemainingWithCompletion:(void (^)(NSNumber * _Nullable completion:completion]; } -- (void)subscribeAttributeTimeRemainingWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +- (void)writeAttributeSelectedDrynessLevelWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion { - using TypeInfo = Timer::Attributes::TimeRemaining::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; + [self writeAttributeSelectedDrynessLevelWithValue:(NSNumber * _Nullable) value params:nil completion:completion]; } - -+ (void)readAttributeTimeRemainingWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +- (void)writeAttributeSelectedDrynessLevelWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion { - using TypeInfo = Timer::Attributes::TimeRemaining::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; -- (void)readAttributeTimerStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = Timer::Attributes::TimerState::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = LaundryDryerControls::Attributes::SelectedDrynessLevel::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = static_cast>(value.unsignedCharValue); + } + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpoint); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); } -- (void)subscribeAttributeTimerStateWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +- (void)subscribeAttributeSelectedDrynessLevelWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = Timer::Attributes::TimerState::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::SelectedDrynessLevel::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -38979,9 +38815,9 @@ - (void)subscribeAttributeTimerStateWithParams:(MTRSubscribeParams * _Nonnull)pa subscriptionEstablished:subscriptionEstablished]; } -+ (void)readAttributeTimerStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion ++ (void)readAttributeSelectedDrynessLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = Timer::Attributes::TimerState::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::SelectedDrynessLevel::TypeInfo; [clusterStateCacheContainer _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) clusterID:TypeInfo::GetClusterId() @@ -38992,7 +38828,7 @@ + (void)readAttributeTimerStateWithClusterStateCache:(MTRClusterStateCacheContai - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = Timer::Attributes::GeneratedCommandList::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::GeneratedCommandList::TypeInfo; [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -39005,7 +38841,7 @@ - (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = Timer::Attributes::GeneratedCommandList::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::GeneratedCommandList::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -39017,7 +38853,7 @@ - (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = Timer::Attributes::GeneratedCommandList::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::GeneratedCommandList::TypeInfo; [clusterStateCacheContainer _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) clusterID:TypeInfo::GetClusterId() @@ -39028,7 +38864,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC - (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = Timer::Attributes::AcceptedCommandList::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::AcceptedCommandList::TypeInfo; [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -39041,7 +38877,7 @@ - (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _N subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = Timer::Attributes::AcceptedCommandList::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::AcceptedCommandList::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -39053,7 +38889,7 @@ - (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _N + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = Timer::Attributes::AcceptedCommandList::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::AcceptedCommandList::TypeInfo; [clusterStateCacheContainer _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) clusterID:TypeInfo::GetClusterId() @@ -39064,7 +38900,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa - (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = Timer::Attributes::EventList::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::EventList::TypeInfo; [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -39077,7 +38913,7 @@ - (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)par subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = Timer::Attributes::EventList::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::EventList::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -39089,7 +38925,7 @@ - (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)par + (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = Timer::Attributes::EventList::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::EventList::TypeInfo; [clusterStateCacheContainer _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) clusterID:TypeInfo::GetClusterId() @@ -39100,7 +38936,7 @@ + (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContain - (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = Timer::Attributes::AttributeList::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::AttributeList::TypeInfo; [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -39113,7 +38949,7 @@ - (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = Timer::Attributes::AttributeList::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::AttributeList::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -39125,7 +38961,7 @@ - (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = Timer::Attributes::AttributeList::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::AttributeList::TypeInfo; [clusterStateCacheContainer _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) clusterID:TypeInfo::GetClusterId() @@ -39136,7 +38972,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = Timer::Attributes::FeatureMap::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::FeatureMap::TypeInfo; [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -39149,7 +38985,7 @@ - (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)pa subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = Timer::Attributes::FeatureMap::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::FeatureMap::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -39161,7 +38997,7 @@ - (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)pa + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = Timer::Attributes::FeatureMap::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::FeatureMap::TypeInfo; [clusterStateCacheContainer _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) clusterID:TypeInfo::GetClusterId() @@ -39172,7 +39008,7 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = Timer::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::ClusterRevision::TypeInfo; [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -39185,7 +39021,7 @@ - (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnu subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = Timer::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::ClusterRevision::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -39197,7 +39033,7 @@ - (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnu + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = Timer::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = LaundryDryerControls::Attributes::ClusterRevision::TypeInfo; [clusterStateCacheContainer _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) clusterID:TypeInfo::GetClusterId() @@ -48208,12 +48044,12 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end -@implementation MTRBaseClusterBooleanSensorConfiguration +@implementation MTRBaseClusterDoorLock -- (void)suppressRequestWithParams:(MTRBooleanSensorConfigurationClusterSuppressRequestParams *)params completion:(MTRStatusCompletion)completion +- (void)lockDoorWithParams:(MTRDoorLockClusterLockDoorParams * _Nullable)params completion:(MTRStatusCompletion)completion { if (params == nil) { - params = [[MTRBooleanSensorConfigurationClusterSuppressRequestParams + params = [[MTRDoorLockClusterLockDoorParams alloc] init]; } @@ -48222,8 +48058,11 @@ - (void)suppressRequestWithParams:(MTRBooleanSensorConfigurationClusterSuppressR }; auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(MTR_DEFAULT_TIMED_INTERACTION_TIMEOUT_MS); + } - using RequestType = BooleanSensorConfiguration::Commands::SuppressRequest::Type; + using RequestType = DoorLock::Commands::LockDoor::Type; [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) clusterID:@(RequestType::GetClusterId()) commandID:@(RequestType::GetCommandId()) @@ -48234,2110 +48073,186 @@ - (void)suppressRequestWithParams:(MTRBooleanSensorConfigurationClusterSuppressR queue:self.callbackQueue completion:responseHandler]; } - -- (void)readAttributeSensitivityLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +- (void)unlockDoorWithParams:(MTRDoorLockClusterUnlockDoorParams * _Nullable)params completion:(MTRStatusCompletion)completion { - using TypeInfo = BooleanSensorConfiguration::Attributes::SensitivityLevel::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} + if (params == nil) { + params = [[MTRDoorLockClusterUnlockDoorParams + alloc] init]; + } -- (void)writeAttributeSensitivityLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion -{ - [self writeAttributeSensitivityLevelWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(MTR_DEFAULT_TIMED_INTERACTION_TIMEOUT_MS); + } + + using RequestType = DoorLock::Commands::UnlockDoor::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } -- (void)writeAttributeSensitivityLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +- (void)unlockWithTimeoutWithParams:(MTRDoorLockClusterUnlockWithTimeoutParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - value = [value copy]; + if (params == nil) { + params = [[MTRDoorLockClusterUnlockWithTimeoutParams + alloc] init]; + } - auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - chip::Optional timedWriteTimeout; - if (params != nil) { - if (params.timedWriteTimeout != nil){ - timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); - } - } + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; - ListFreer listFreer; - using TypeInfo = BooleanSensorConfiguration::Attributes::SensitivityLevel::TypeInfo; - TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(MTR_DEFAULT_TIMED_INTERACTION_TIMEOUT_MS); + } - chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpoint); - return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); - std::move(*bridge).DispatchAction(self.device); + using RequestType = DoorLock::Commands::UnlockWithTimeout::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - -- (void)subscribeAttributeSensitivityLevelWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +- (void)setWeekDayScheduleWithParams:(MTRDoorLockClusterSetWeekDayScheduleParams *)params completion:(MTRStatusCompletion)completion { - using TypeInfo = BooleanSensorConfiguration::Attributes::SensitivityLevel::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} + if (params == nil) { + params = [[MTRDoorLockClusterSetWeekDayScheduleParams + alloc] init]; + } -+ (void)readAttributeSensitivityLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::SensitivityLevel::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; -- (void)readAttributeAlarmsActiveWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::AlarmsActive::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = DoorLock::Commands::SetWeekDaySchedule::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil queue:self.callbackQueue - completion:completion]; + completion:responseHandler]; } - -- (void)subscribeAttributeAlarmsActiveWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +- (void)getWeekDayScheduleWithParams:(MTRDoorLockClusterGetWeekDayScheduleParams *)params completion:(void (^)(MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable data, NSError * _Nullable error))completion { - using TypeInfo = BooleanSensorConfiguration::Attributes::AlarmsActive::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} + if (params == nil) { + params = [[MTRDoorLockClusterGetWeekDayScheduleParams + alloc] init]; + } -+ (void)readAttributeAlarmsActiveWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::AlarmsActive::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; -- (void)readAttributeAlarmsSuppressedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::AlarmsSuppressed::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = DoorLock::Commands::GetWeekDaySchedule::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRDoorLockClusterGetWeekDayScheduleResponseParams.class queue:self.callbackQueue - completion:completion]; + completion:responseHandler]; } - -- (void)subscribeAttributeAlarmsSuppressedWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +- (void)clearWeekDayScheduleWithParams:(MTRDoorLockClusterClearWeekDayScheduleParams *)params completion:(MTRStatusCompletion)completion { - using TypeInfo = BooleanSensorConfiguration::Attributes::AlarmsSuppressed::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} + if (params == nil) { + params = [[MTRDoorLockClusterClearWeekDayScheduleParams + alloc] init]; + } -+ (void)readAttributeAlarmsSuppressedWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::AlarmsSuppressed::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; -- (void)readAttributeAlarmsEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::AlarmsEnabled::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; -- (void)writeAttributeAlarmsEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion -{ - [self writeAttributeAlarmsEnabledWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; + using RequestType = DoorLock::Commands::ClearWeekDaySchedule::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } -- (void)writeAttributeAlarmsEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +- (void)setYearDayScheduleWithParams:(MTRDoorLockClusterSetYearDayScheduleParams *)params completion:(MTRStatusCompletion)completion { - // Make a copy of params before we go async. - params = [params copy]; - value = [value copy]; + if (params == nil) { + params = [[MTRDoorLockClusterSetYearDayScheduleParams + alloc] init]; + } - auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - chip::Optional timedWriteTimeout; - if (params != nil) { - if (params.timedWriteTimeout != nil){ - timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); - } - } + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; - ListFreer listFreer; - using TypeInfo = BooleanSensorConfiguration::Attributes::AlarmsEnabled::TypeInfo; - TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpoint); - return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); - std::move(*bridge).DispatchAction(self.device); + using RequestType = DoorLock::Commands::SetYearDaySchedule::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } - -- (void)subscribeAttributeAlarmsEnabledWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +- (void)getYearDayScheduleWithParams:(MTRDoorLockClusterGetYearDayScheduleParams *)params completion:(void (^)(MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable data, NSError * _Nullable error))completion { - using TypeInfo = BooleanSensorConfiguration::Attributes::AlarmsEnabled::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} + if (params == nil) { + params = [[MTRDoorLockClusterGetYearDayScheduleParams + alloc] init]; + } -+ (void)readAttributeAlarmsEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::AlarmsEnabled::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; -- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::GeneratedCommandList::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = DoorLock::Commands::GetYearDaySchedule::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRDoorLockClusterGetYearDayScheduleResponseParams.class queue:self.callbackQueue - completion:completion]; + completion:responseHandler]; } - -- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +- (void)clearYearDayScheduleWithParams:(MTRDoorLockClusterClearYearDayScheduleParams *)params completion:(MTRStatusCompletion)completion { - using TypeInfo = BooleanSensorConfiguration::Attributes::GeneratedCommandList::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::GeneratedCommandList::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::AcceptedCommandList::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::AcceptedCommandList::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::AcceptedCommandList::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::EventList::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::EventList::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::EventList::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::AttributeList::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::AttributeList::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::AttributeList::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::FeatureMap::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::FeatureMap::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::FeatureMap::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::ClusterRevision::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::ClusterRevision::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = BooleanSensorConfiguration::Attributes::ClusterRevision::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -@end - -@implementation MTRBaseClusterValveConfigurationAndControl - -- (void)openWithParams:(MTRValveConfigurationAndControlClusterOpenParams * _Nullable)params completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRValveConfigurationAndControlClusterOpenParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = ValveConfigurationAndControl::Commands::Open::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} -- (void)closeWithCompletion:(MTRStatusCompletion)completion -{ - [self closeWithParams:nil completion:completion]; -} -- (void)closeWithParams:(MTRValveConfigurationAndControlClusterCloseParams * _Nullable)params completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRValveConfigurationAndControlClusterCloseParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = ValveConfigurationAndControl::Commands::Close::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} -- (void)setLevelWithParams:(MTRValveConfigurationAndControlClusterSetLevelParams *)params completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRValveConfigurationAndControlClusterSetLevelParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = ValveConfigurationAndControl::Commands::SetLevel::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} - -- (void)readAttributeOpenDurationWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::OpenDuration::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)writeAttributeOpenDurationWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion -{ - [self writeAttributeOpenDurationWithValue:(NSNumber * _Nullable) value params:nil completion:completion]; -} -- (void)writeAttributeOpenDurationWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion -{ - // Make a copy of params before we go async. - params = [params copy]; - value = [value copy]; - - auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - chip::Optional timedWriteTimeout; - if (params != nil) { - if (params.timedWriteTimeout != nil){ - timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); - } - } - - ListFreer listFreer; - using TypeInfo = ValveConfigurationAndControl::Attributes::OpenDuration::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedIntValue; - } - - chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpoint); - return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); - std::move(*bridge).DispatchAction(self.device); -} - -- (void)subscribeAttributeOpenDurationWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::OpenDuration::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeOpenDurationWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::OpenDuration::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeAutoCloseTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::AutoCloseTime::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeAutoCloseTimeWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::AutoCloseTime::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeAutoCloseTimeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::AutoCloseTime::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeRemainingDurationWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::RemainingDuration::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeRemainingDurationWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::RemainingDuration::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeRemainingDurationWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::RemainingDuration::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeCurrentStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::CurrentState::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeCurrentStateWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::CurrentState::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeCurrentStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::CurrentState::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeTargetStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::TargetState::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeTargetStateWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::TargetState::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeTargetStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::TargetState::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeStartUpStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::StartUpState::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)writeAttributeStartUpStateWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion -{ - [self writeAttributeStartUpStateWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; -} -- (void)writeAttributeStartUpStateWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion -{ - // Make a copy of params before we go async. - params = [params copy]; - value = [value copy]; - - auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - chip::Optional timedWriteTimeout; - if (params != nil) { - if (params.timedWriteTimeout != nil){ - timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); - } - } - - ListFreer listFreer; - using TypeInfo = ValveConfigurationAndControl::Attributes::StartUpState::TypeInfo; - TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); - - chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpoint); - return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); - std::move(*bridge).DispatchAction(self.device); -} - -- (void)subscribeAttributeStartUpStateWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::StartUpState::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeStartUpStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::StartUpState::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeCurrentLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::CurrentLevel::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeCurrentLevelWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::CurrentLevel::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeCurrentLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::CurrentLevel::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeTargetLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::TargetLevel::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeTargetLevelWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::TargetLevel::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeTargetLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::TargetLevel::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeOpenLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::OpenLevel::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)writeAttributeOpenLevelWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion -{ - [self writeAttributeOpenLevelWithValue:(NSNumber * _Nullable) value params:nil completion:completion]; -} -- (void)writeAttributeOpenLevelWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion -{ - // Make a copy of params before we go async. - params = [params copy]; - value = [value copy]; - - auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - chip::Optional timedWriteTimeout; - if (params != nil) { - if (params.timedWriteTimeout != nil){ - timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); - } - } - - ListFreer listFreer; - using TypeInfo = ValveConfigurationAndControl::Attributes::OpenLevel::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; - } - - chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpoint); - return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); - std::move(*bridge).DispatchAction(self.device); -} - -- (void)subscribeAttributeOpenLevelWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::OpenLevel::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeOpenLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::OpenLevel::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeValveFaultWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::ValveFault::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeValveFaultWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::ValveFault::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeValveFaultWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::ValveFault::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::GeneratedCommandList::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::GeneratedCommandList::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::GeneratedCommandList::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::AcceptedCommandList::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::AcceptedCommandList::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::AcceptedCommandList::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::EventList::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::EventList::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::EventList::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::AttributeList::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::AttributeList::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::AttributeList::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::FeatureMap::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::FeatureMap::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::FeatureMap::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::ClusterRevision::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::ClusterRevision::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = ValveConfigurationAndControl::Attributes::ClusterRevision::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -@end - -@implementation MTRBaseClusterDemandResponseLoadControl - -- (void)registerLoadControlProgramRequestWithParams:(MTRDemandResponseLoadControlClusterRegisterLoadControlProgramRequestParams *)params completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRDemandResponseLoadControlClusterRegisterLoadControlProgramRequestParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = DemandResponseLoadControl::Commands::RegisterLoadControlProgramRequest::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} -- (void)unregisterLoadControlProgramRequestWithParams:(MTRDemandResponseLoadControlClusterUnregisterLoadControlProgramRequestParams *)params completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRDemandResponseLoadControlClusterUnregisterLoadControlProgramRequestParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = DemandResponseLoadControl::Commands::UnregisterLoadControlProgramRequest::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} -- (void)addLoadControlEventRequestWithParams:(MTRDemandResponseLoadControlClusterAddLoadControlEventRequestParams *)params completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRDemandResponseLoadControlClusterAddLoadControlEventRequestParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = DemandResponseLoadControl::Commands::AddLoadControlEventRequest::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} -- (void)removeLoadControlEventRequestWithParams:(MTRDemandResponseLoadControlClusterRemoveLoadControlEventRequestParams *)params completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRDemandResponseLoadControlClusterRemoveLoadControlEventRequestParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = DemandResponseLoadControl::Commands::RemoveLoadControlEventRequest::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} -- (void)clearLoadControlEventsRequestWithCompletion:(MTRStatusCompletion)completion -{ - [self clearLoadControlEventsRequestWithParams:nil completion:completion]; -} -- (void)clearLoadControlEventsRequestWithParams:(MTRDemandResponseLoadControlClusterClearLoadControlEventsRequestParams * _Nullable)params completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRDemandResponseLoadControlClusterClearLoadControlEventsRequestParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = DemandResponseLoadControl::Commands::ClearLoadControlEventsRequest::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} - -- (void)readAttributeDeviceClassWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::DeviceClass::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeDeviceClassWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = DemandResponseLoadControl::Attributes::DeviceClass::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeDeviceClassWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::DeviceClass::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeLoadControlProgramsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::LoadControlPrograms::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeLoadControlProgramsWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = DemandResponseLoadControl::Attributes::LoadControlPrograms::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeLoadControlProgramsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::LoadControlPrograms::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeNumberOfLoadControlProgramsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::NumberOfLoadControlPrograms::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeNumberOfLoadControlProgramsWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = DemandResponseLoadControl::Attributes::NumberOfLoadControlPrograms::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeNumberOfLoadControlProgramsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::NumberOfLoadControlPrograms::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeEventsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::Events::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeEventsWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = DemandResponseLoadControl::Attributes::Events::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeEventsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::Events::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeActiveEventsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::ActiveEvents::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeActiveEventsWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = DemandResponseLoadControl::Attributes::ActiveEvents::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeActiveEventsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::ActiveEvents::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeNumberOfEventsPerProgramWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::NumberOfEventsPerProgram::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeNumberOfEventsPerProgramWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = DemandResponseLoadControl::Attributes::NumberOfEventsPerProgram::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeNumberOfEventsPerProgramWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::NumberOfEventsPerProgram::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeNumberOfTransistionsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::NumberOfTransistions::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeNumberOfTransistionsWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = DemandResponseLoadControl::Attributes::NumberOfTransistions::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeNumberOfTransistionsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::NumberOfTransistions::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeDefaultRandomStartWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::DefaultRandomStart::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)writeAttributeDefaultRandomStartWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion -{ - [self writeAttributeDefaultRandomStartWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; -} -- (void)writeAttributeDefaultRandomStartWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion -{ - // Make a copy of params before we go async. - params = [params copy]; - value = [value copy]; - - auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - chip::Optional timedWriteTimeout; - if (params != nil) { - if (params.timedWriteTimeout != nil){ - timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); - } - } - - ListFreer listFreer; - using TypeInfo = DemandResponseLoadControl::Attributes::DefaultRandomStart::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - - chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpoint); - return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); - std::move(*bridge).DispatchAction(self.device); -} - -- (void)subscribeAttributeDefaultRandomStartWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = DemandResponseLoadControl::Attributes::DefaultRandomStart::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeDefaultRandomStartWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::DefaultRandomStart::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeDefaultRandomDurationWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::DefaultRandomDuration::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)writeAttributeDefaultRandomDurationWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion -{ - [self writeAttributeDefaultRandomDurationWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; -} -- (void)writeAttributeDefaultRandomDurationWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion -{ - // Make a copy of params before we go async. - params = [params copy]; - value = [value copy]; - - auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - chip::Optional timedWriteTimeout; - if (params != nil) { - if (params.timedWriteTimeout != nil){ - timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); - } - } - - ListFreer listFreer; - using TypeInfo = DemandResponseLoadControl::Attributes::DefaultRandomDuration::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - - chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpoint); - return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); - std::move(*bridge).DispatchAction(self.device); -} - -- (void)subscribeAttributeDefaultRandomDurationWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = DemandResponseLoadControl::Attributes::DefaultRandomDuration::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeDefaultRandomDurationWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::DefaultRandomDuration::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::GeneratedCommandList::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = DemandResponseLoadControl::Attributes::GeneratedCommandList::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::GeneratedCommandList::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::AcceptedCommandList::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = DemandResponseLoadControl::Attributes::AcceptedCommandList::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::AcceptedCommandList::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::EventList::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = DemandResponseLoadControl::Attributes::EventList::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::EventList::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::AttributeList::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = DemandResponseLoadControl::Attributes::AttributeList::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::AttributeList::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::FeatureMap::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = DemandResponseLoadControl::Attributes::FeatureMap::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::FeatureMap::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::ClusterRevision::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = DemandResponseLoadControl::Attributes::ClusterRevision::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DemandResponseLoadControl::Attributes::ClusterRevision::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -@end - -@implementation MTRBaseClusterDoorLock - -- (void)lockDoorWithParams:(MTRDoorLockClusterLockDoorParams * _Nullable)params completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRDoorLockClusterLockDoorParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - if (timedInvokeTimeoutMs == nil) { - timedInvokeTimeoutMs = @(MTR_DEFAULT_TIMED_INTERACTION_TIMEOUT_MS); - } - - using RequestType = DoorLock::Commands::LockDoor::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} -- (void)unlockDoorWithParams:(MTRDoorLockClusterUnlockDoorParams * _Nullable)params completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRDoorLockClusterUnlockDoorParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - if (timedInvokeTimeoutMs == nil) { - timedInvokeTimeoutMs = @(MTR_DEFAULT_TIMED_INTERACTION_TIMEOUT_MS); - } - - using RequestType = DoorLock::Commands::UnlockDoor::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} -- (void)unlockWithTimeoutWithParams:(MTRDoorLockClusterUnlockWithTimeoutParams *)params completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRDoorLockClusterUnlockWithTimeoutParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - if (timedInvokeTimeoutMs == nil) { - timedInvokeTimeoutMs = @(MTR_DEFAULT_TIMED_INTERACTION_TIMEOUT_MS); - } - - using RequestType = DoorLock::Commands::UnlockWithTimeout::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} -- (void)setWeekDayScheduleWithParams:(MTRDoorLockClusterSetWeekDayScheduleParams *)params completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRDoorLockClusterSetWeekDayScheduleParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = DoorLock::Commands::SetWeekDaySchedule::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} -- (void)getWeekDayScheduleWithParams:(MTRDoorLockClusterGetWeekDayScheduleParams *)params completion:(void (^)(MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable data, NSError * _Nullable error))completion -{ - if (params == nil) { - params = [[MTRDoorLockClusterGetWeekDayScheduleParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(response, error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = DoorLock::Commands::GetWeekDaySchedule::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:MTRDoorLockClusterGetWeekDayScheduleResponseParams.class - queue:self.callbackQueue - completion:responseHandler]; -} -- (void)clearWeekDayScheduleWithParams:(MTRDoorLockClusterClearWeekDayScheduleParams *)params completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRDoorLockClusterClearWeekDayScheduleParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = DoorLock::Commands::ClearWeekDaySchedule::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} -- (void)setYearDayScheduleWithParams:(MTRDoorLockClusterSetYearDayScheduleParams *)params completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRDoorLockClusterSetYearDayScheduleParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = DoorLock::Commands::SetYearDaySchedule::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} -- (void)getYearDayScheduleWithParams:(MTRDoorLockClusterGetYearDayScheduleParams *)params completion:(void (^)(MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable data, NSError * _Nullable error))completion -{ - if (params == nil) { - params = [[MTRDoorLockClusterGetYearDayScheduleParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(response, error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = DoorLock::Commands::GetYearDaySchedule::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:MTRDoorLockClusterGetYearDayScheduleResponseParams.class - queue:self.callbackQueue - completion:responseHandler]; -} -- (void)clearYearDayScheduleWithParams:(MTRDoorLockClusterClearYearDayScheduleParams *)params completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRDoorLockClusterClearYearDayScheduleParams - alloc] init]; - } + if (params == nil) { + params = [[MTRDoorLockClusterClearYearDayScheduleParams + alloc] init]; + } auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { completion(error); @@ -66692,7 +64607,7 @@ - (void)writeAttributeTemperatureDisplayModeWithValue:(NSNumber * _Nonnull)value ListFreer listFreer; using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -66756,7 +64671,7 @@ - (void)writeAttributeKeypadLockoutWithValue:(NSNumber * _Nonnull)value params:( ListFreer listFreer; using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -66820,7 +64735,7 @@ - (void)writeAttributeScheduleProgrammingVisibilityWithValue:(NSNumber * _Nonnul ListFreer listFreer; using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast>(value.unsignedCharValue); + cppValue = value.unsignedCharValue; chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 8e7f7470c68b23..352b76817e50b8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -2760,16 +2760,6 @@ - (void)writeAttributeLocalConfigDisabledWithValue:(NSDictionary return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeBasicInformationID) attributeID:@(MTRAttributeIDTypeClusterBasicInformationAttributeProductAppearanceID) params:params]; } -- (NSDictionary * _Nullable)readAttributeSpecificationVersionWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeBasicInformationID) attributeID:@(MTRAttributeIDTypeClusterBasicInformationAttributeSpecificationVersionID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeMaxPathsPerInvokeWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeBasicInformationID) attributeID:@(MTRAttributeIDTypeClusterBasicInformationAttributeMaxPathsPerInvokeID) params:params]; -} - - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeBasicInformationID) attributeID:@(MTRAttributeIDTypeClusterBasicInformationAttributeGeneratedCommandListID) params:params]; @@ -6582,163 +6572,69 @@ - (void)stayActiveRequestWithParams:(MTRICDManagementClusterStayActiveRequestPar @end -@implementation MTRClusterTimer +@implementation MTRClusterLaundryDryerControls -- (void)setTimerWithParams:(MTRTimerClusterSetTimerParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +- (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue { - if (params == nil) { - params = [[MTRTimerClusterSetTimerParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = Timer::Commands::SetTimer::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - expectedValues:expectedValues - expectedValueInterval:expectedValueIntervalMs - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} + if (self = [super initWithEndpointID:endpointID queue:queue]) { + if (device == nil) { + return nil; + } -- (void)resetTimerWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion -{ - [self resetTimerWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; -} -- (void)resetTimerWithParams:(MTRTimerClusterResetTimerParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRTimerClusterResetTimerParams - alloc] init]; + _device = device; } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = Timer::Commands::ResetTimer::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - expectedValues:expectedValues - expectedValueInterval:expectedValueIntervalMs - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; + return self; } -- (void)addTimeWithParams:(MTRTimerClusterAddTimeParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +- (NSDictionary * _Nullable)readAttributeSupportedDrynessLevelsWithParams:(MTRReadParams * _Nullable)params { - if (params == nil) { - params = [[MTRTimerClusterAddTimeParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = Timer::Commands::AddTime::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - expectedValues:expectedValues - expectedValueInterval:expectedValueIntervalMs - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeLaundryDryerControlsID) attributeID:@(MTRAttributeIDTypeClusterLaundryDryerControlsAttributeSupportedDrynessLevelsID) params:params]; } -- (void)reduceTimeWithParams:(MTRTimerClusterReduceTimeParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +- (NSDictionary * _Nullable)readAttributeSelectedDrynessLevelWithParams:(MTRReadParams * _Nullable)params { - if (params == nil) { - params = [[MTRTimerClusterReduceTimeParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = Timer::Commands::ReduceTime::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - expectedValues:expectedValues - expectedValueInterval:expectedValueIntervalMs - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeLaundryDryerControlsID) attributeID:@(MTRAttributeIDTypeClusterLaundryDryerControlsAttributeSelectedDrynessLevelID) params:params]; } -- (NSDictionary * _Nullable)readAttributeSetTimeWithParams:(MTRReadParams * _Nullable)params +- (void)writeAttributeSelectedDrynessLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs { - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeTimerID) attributeID:@(MTRAttributeIDTypeClusterTimerAttributeSetTimeID) params:params]; + [self writeAttributeSelectedDrynessLevelWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; } - -- (NSDictionary * _Nullable)readAttributeTimeRemainingWithParams:(MTRReadParams * _Nullable)params +- (void)writeAttributeSelectedDrynessLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params { - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeTimerID) attributeID:@(MTRAttributeIDTypeClusterTimerAttributeTimeRemainingID) params:params]; -} + NSNumber * timedWriteTimeout = params.timedWriteTimeout; -- (NSDictionary * _Nullable)readAttributeTimerStateWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeTimerID) attributeID:@(MTRAttributeIDTypeClusterTimerAttributeTimerStateID) params:params]; + [self.device writeAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeLaundryDryerControlsID) attributeID:@(MTRAttributeIDTypeClusterLaundryDryerControlsAttributeSelectedDrynessLevelID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; } - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params { - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeTimerID) attributeID:@(MTRAttributeIDTypeClusterTimerAttributeGeneratedCommandListID) params:params]; + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeLaundryDryerControlsID) attributeID:@(MTRAttributeIDTypeClusterLaundryDryerControlsAttributeGeneratedCommandListID) params:params]; } - (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params { - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeTimerID) attributeID:@(MTRAttributeIDTypeClusterTimerAttributeAcceptedCommandListID) params:params]; + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeLaundryDryerControlsID) attributeID:@(MTRAttributeIDTypeClusterLaundryDryerControlsAttributeAcceptedCommandListID) params:params]; } - (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params { - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeTimerID) attributeID:@(MTRAttributeIDTypeClusterTimerAttributeEventListID) params:params]; + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeLaundryDryerControlsID) attributeID:@(MTRAttributeIDTypeClusterLaundryDryerControlsAttributeEventListID) params:params]; } - (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params { - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeTimerID) attributeID:@(MTRAttributeIDTypeClusterTimerAttributeAttributeListID) params:params]; + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeLaundryDryerControlsID) attributeID:@(MTRAttributeIDTypeClusterLaundryDryerControlsAttributeAttributeListID) params:params]; } - (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params { - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeTimerID) attributeID:@(MTRAttributeIDTypeClusterTimerAttributeFeatureMapID) params:params]; + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeLaundryDryerControlsID) attributeID:@(MTRAttributeIDTypeClusterLaundryDryerControlsAttributeFeatureMapID) params:params]; } - (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params { - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeTimerID) attributeID:@(MTRAttributeIDTypeClusterTimerAttributeClusterRevisionID) params:params]; + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeLaundryDryerControlsID) attributeID:@(MTRAttributeIDTypeClusterLaundryDryerControlsAttributeClusterRevisionID) params:params]; } @end @@ -8705,551 +8601,6 @@ - (void)writeAttributeLastChangedTimeWithValue:(NSDictionary *)d @end -@implementation MTRClusterBooleanSensorConfiguration - -- (void)suppressRequestWithParams:(MTRBooleanSensorConfigurationClusterSuppressRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRBooleanSensorConfigurationClusterSuppressRequestParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = BooleanSensorConfiguration::Commands::SuppressRequest::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - expectedValues:expectedValues - expectedValueInterval:expectedValueIntervalMs - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} - -- (NSDictionary * _Nullable)readAttributeSensitivityLevelWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeBooleanSensorConfigurationID) attributeID:@(MTRAttributeIDTypeClusterBooleanSensorConfigurationAttributeSensitivityLevelID) params:params]; -} - -- (void)writeAttributeSensitivityLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs -{ - [self writeAttributeSensitivityLevelWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; -} -- (void)writeAttributeSensitivityLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params -{ - NSNumber * timedWriteTimeout = params.timedWriteTimeout; - - [self.device writeAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeBooleanSensorConfigurationID) attributeID:@(MTRAttributeIDTypeClusterBooleanSensorConfigurationAttributeSensitivityLevelID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; -} - -- (NSDictionary * _Nullable)readAttributeAlarmsActiveWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeBooleanSensorConfigurationID) attributeID:@(MTRAttributeIDTypeClusterBooleanSensorConfigurationAttributeAlarmsActiveID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeAlarmsSuppressedWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeBooleanSensorConfigurationID) attributeID:@(MTRAttributeIDTypeClusterBooleanSensorConfigurationAttributeAlarmsSuppressedID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeAlarmsEnabledWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeBooleanSensorConfigurationID) attributeID:@(MTRAttributeIDTypeClusterBooleanSensorConfigurationAttributeAlarmsEnabledID) params:params]; -} - -- (void)writeAttributeAlarmsEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs -{ - [self writeAttributeAlarmsEnabledWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; -} -- (void)writeAttributeAlarmsEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params -{ - NSNumber * timedWriteTimeout = params.timedWriteTimeout; - - [self.device writeAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeBooleanSensorConfigurationID) attributeID:@(MTRAttributeIDTypeClusterBooleanSensorConfigurationAttributeAlarmsEnabledID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; -} - -- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeBooleanSensorConfigurationID) attributeID:@(MTRAttributeIDTypeClusterBooleanSensorConfigurationAttributeGeneratedCommandListID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeBooleanSensorConfigurationID) attributeID:@(MTRAttributeIDTypeClusterBooleanSensorConfigurationAttributeAcceptedCommandListID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeBooleanSensorConfigurationID) attributeID:@(MTRAttributeIDTypeClusterBooleanSensorConfigurationAttributeEventListID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeBooleanSensorConfigurationID) attributeID:@(MTRAttributeIDTypeClusterBooleanSensorConfigurationAttributeAttributeListID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeBooleanSensorConfigurationID) attributeID:@(MTRAttributeIDTypeClusterBooleanSensorConfigurationAttributeFeatureMapID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeBooleanSensorConfigurationID) attributeID:@(MTRAttributeIDTypeClusterBooleanSensorConfigurationAttributeClusterRevisionID) params:params]; -} - -@end - -@implementation MTRClusterValveConfigurationAndControl - -- (void)openWithParams:(MTRValveConfigurationAndControlClusterOpenParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRValveConfigurationAndControlClusterOpenParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = ValveConfigurationAndControl::Commands::Open::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - expectedValues:expectedValues - expectedValueInterval:expectedValueIntervalMs - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} - -- (void)closeWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion -{ - [self closeWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; -} -- (void)closeWithParams:(MTRValveConfigurationAndControlClusterCloseParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRValveConfigurationAndControlClusterCloseParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = ValveConfigurationAndControl::Commands::Close::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - expectedValues:expectedValues - expectedValueInterval:expectedValueIntervalMs - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} - -- (void)setLevelWithParams:(MTRValveConfigurationAndControlClusterSetLevelParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRValveConfigurationAndControlClusterSetLevelParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = ValveConfigurationAndControl::Commands::SetLevel::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - expectedValues:expectedValues - expectedValueInterval:expectedValueIntervalMs - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} - -- (NSDictionary * _Nullable)readAttributeOpenDurationWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeValveConfigurationAndControlID) attributeID:@(MTRAttributeIDTypeClusterValveConfigurationAndControlAttributeOpenDurationID) params:params]; -} - -- (void)writeAttributeOpenDurationWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs -{ - [self writeAttributeOpenDurationWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; -} -- (void)writeAttributeOpenDurationWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params -{ - NSNumber * timedWriteTimeout = params.timedWriteTimeout; - - [self.device writeAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeValveConfigurationAndControlID) attributeID:@(MTRAttributeIDTypeClusterValveConfigurationAndControlAttributeOpenDurationID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; -} - -- (NSDictionary * _Nullable)readAttributeAutoCloseTimeWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeValveConfigurationAndControlID) attributeID:@(MTRAttributeIDTypeClusterValveConfigurationAndControlAttributeAutoCloseTimeID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeRemainingDurationWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeValveConfigurationAndControlID) attributeID:@(MTRAttributeIDTypeClusterValveConfigurationAndControlAttributeRemainingDurationID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeCurrentStateWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeValveConfigurationAndControlID) attributeID:@(MTRAttributeIDTypeClusterValveConfigurationAndControlAttributeCurrentStateID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeTargetStateWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeValveConfigurationAndControlID) attributeID:@(MTRAttributeIDTypeClusterValveConfigurationAndControlAttributeTargetStateID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeStartUpStateWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeValveConfigurationAndControlID) attributeID:@(MTRAttributeIDTypeClusterValveConfigurationAndControlAttributeStartUpStateID) params:params]; -} - -- (void)writeAttributeStartUpStateWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs -{ - [self writeAttributeStartUpStateWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; -} -- (void)writeAttributeStartUpStateWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params -{ - NSNumber * timedWriteTimeout = params.timedWriteTimeout; - - [self.device writeAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeValveConfigurationAndControlID) attributeID:@(MTRAttributeIDTypeClusterValveConfigurationAndControlAttributeStartUpStateID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; -} - -- (NSDictionary * _Nullable)readAttributeCurrentLevelWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeValveConfigurationAndControlID) attributeID:@(MTRAttributeIDTypeClusterValveConfigurationAndControlAttributeCurrentLevelID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeTargetLevelWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeValveConfigurationAndControlID) attributeID:@(MTRAttributeIDTypeClusterValveConfigurationAndControlAttributeTargetLevelID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeOpenLevelWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeValveConfigurationAndControlID) attributeID:@(MTRAttributeIDTypeClusterValveConfigurationAndControlAttributeOpenLevelID) params:params]; -} - -- (void)writeAttributeOpenLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs -{ - [self writeAttributeOpenLevelWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; -} -- (void)writeAttributeOpenLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params -{ - NSNumber * timedWriteTimeout = params.timedWriteTimeout; - - [self.device writeAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeValveConfigurationAndControlID) attributeID:@(MTRAttributeIDTypeClusterValveConfigurationAndControlAttributeOpenLevelID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; -} - -- (NSDictionary * _Nullable)readAttributeValveFaultWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeValveConfigurationAndControlID) attributeID:@(MTRAttributeIDTypeClusterValveConfigurationAndControlAttributeValveFaultID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeValveConfigurationAndControlID) attributeID:@(MTRAttributeIDTypeClusterValveConfigurationAndControlAttributeGeneratedCommandListID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeValveConfigurationAndControlID) attributeID:@(MTRAttributeIDTypeClusterValveConfigurationAndControlAttributeAcceptedCommandListID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeValveConfigurationAndControlID) attributeID:@(MTRAttributeIDTypeClusterValveConfigurationAndControlAttributeEventListID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeValveConfigurationAndControlID) attributeID:@(MTRAttributeIDTypeClusterValveConfigurationAndControlAttributeAttributeListID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeValveConfigurationAndControlID) attributeID:@(MTRAttributeIDTypeClusterValveConfigurationAndControlAttributeFeatureMapID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeValveConfigurationAndControlID) attributeID:@(MTRAttributeIDTypeClusterValveConfigurationAndControlAttributeClusterRevisionID) params:params]; -} - -@end - -@implementation MTRClusterDemandResponseLoadControl - -- (void)registerLoadControlProgramRequestWithParams:(MTRDemandResponseLoadControlClusterRegisterLoadControlProgramRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRDemandResponseLoadControlClusterRegisterLoadControlProgramRequestParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = DemandResponseLoadControl::Commands::RegisterLoadControlProgramRequest::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - expectedValues:expectedValues - expectedValueInterval:expectedValueIntervalMs - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} - -- (void)unregisterLoadControlProgramRequestWithParams:(MTRDemandResponseLoadControlClusterUnregisterLoadControlProgramRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRDemandResponseLoadControlClusterUnregisterLoadControlProgramRequestParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = DemandResponseLoadControl::Commands::UnregisterLoadControlProgramRequest::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - expectedValues:expectedValues - expectedValueInterval:expectedValueIntervalMs - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} - -- (void)addLoadControlEventRequestWithParams:(MTRDemandResponseLoadControlClusterAddLoadControlEventRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRDemandResponseLoadControlClusterAddLoadControlEventRequestParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = DemandResponseLoadControl::Commands::AddLoadControlEventRequest::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - expectedValues:expectedValues - expectedValueInterval:expectedValueIntervalMs - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} - -- (void)removeLoadControlEventRequestWithParams:(MTRDemandResponseLoadControlClusterRemoveLoadControlEventRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRDemandResponseLoadControlClusterRemoveLoadControlEventRequestParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = DemandResponseLoadControl::Commands::RemoveLoadControlEventRequest::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - expectedValues:expectedValues - expectedValueInterval:expectedValueIntervalMs - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} - -- (void)clearLoadControlEventsRequestWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion -{ - [self clearLoadControlEventsRequestWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; -} -- (void)clearLoadControlEventsRequestWithParams:(MTRDemandResponseLoadControlClusterClearLoadControlEventsRequestParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRDemandResponseLoadControlClusterClearLoadControlEventsRequestParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = DemandResponseLoadControl::Commands::ClearLoadControlEventsRequest::Type; - [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - expectedValues:expectedValues - expectedValueInterval:expectedValueIntervalMs - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} - -- (NSDictionary * _Nullable)readAttributeDeviceClassWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeDemandResponseLoadControlID) attributeID:@(MTRAttributeIDTypeClusterDemandResponseLoadControlAttributeDeviceClassID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeLoadControlProgramsWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeDemandResponseLoadControlID) attributeID:@(MTRAttributeIDTypeClusterDemandResponseLoadControlAttributeLoadControlProgramsID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeNumberOfLoadControlProgramsWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeDemandResponseLoadControlID) attributeID:@(MTRAttributeIDTypeClusterDemandResponseLoadControlAttributeNumberOfLoadControlProgramsID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeEventsWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeDemandResponseLoadControlID) attributeID:@(MTRAttributeIDTypeClusterDemandResponseLoadControlAttributeEventsID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeActiveEventsWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeDemandResponseLoadControlID) attributeID:@(MTRAttributeIDTypeClusterDemandResponseLoadControlAttributeActiveEventsID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeNumberOfEventsPerProgramWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeDemandResponseLoadControlID) attributeID:@(MTRAttributeIDTypeClusterDemandResponseLoadControlAttributeNumberOfEventsPerProgramID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeNumberOfTransistionsWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeDemandResponseLoadControlID) attributeID:@(MTRAttributeIDTypeClusterDemandResponseLoadControlAttributeNumberOfTransistionsID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeDefaultRandomStartWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeDemandResponseLoadControlID) attributeID:@(MTRAttributeIDTypeClusterDemandResponseLoadControlAttributeDefaultRandomStartID) params:params]; -} - -- (void)writeAttributeDefaultRandomStartWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs -{ - [self writeAttributeDefaultRandomStartWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; -} -- (void)writeAttributeDefaultRandomStartWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params -{ - NSNumber * timedWriteTimeout = params.timedWriteTimeout; - - [self.device writeAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeDemandResponseLoadControlID) attributeID:@(MTRAttributeIDTypeClusterDemandResponseLoadControlAttributeDefaultRandomStartID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; -} - -- (NSDictionary * _Nullable)readAttributeDefaultRandomDurationWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeDemandResponseLoadControlID) attributeID:@(MTRAttributeIDTypeClusterDemandResponseLoadControlAttributeDefaultRandomDurationID) params:params]; -} - -- (void)writeAttributeDefaultRandomDurationWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs -{ - [self writeAttributeDefaultRandomDurationWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; -} -- (void)writeAttributeDefaultRandomDurationWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params -{ - NSNumber * timedWriteTimeout = params.timedWriteTimeout; - - [self.device writeAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeDemandResponseLoadControlID) attributeID:@(MTRAttributeIDTypeClusterDemandResponseLoadControlAttributeDefaultRandomDurationID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; -} - -- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeDemandResponseLoadControlID) attributeID:@(MTRAttributeIDTypeClusterDemandResponseLoadControlAttributeGeneratedCommandListID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeDemandResponseLoadControlID) attributeID:@(MTRAttributeIDTypeClusterDemandResponseLoadControlAttributeAcceptedCommandListID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeDemandResponseLoadControlID) attributeID:@(MTRAttributeIDTypeClusterDemandResponseLoadControlAttributeEventListID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeDemandResponseLoadControlID) attributeID:@(MTRAttributeIDTypeClusterDemandResponseLoadControlAttributeAttributeListID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeDemandResponseLoadControlID) attributeID:@(MTRAttributeIDTypeClusterDemandResponseLoadControlAttributeFeatureMapID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeDemandResponseLoadControlID) attributeID:@(MTRAttributeIDTypeClusterDemandResponseLoadControlAttributeClusterRevisionID) params:params]; -} - -@end - @implementation MTRClusterDoorLock - (void)lockDoorWithParams:(MTRDoorLockClusterLockDoorParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm index 59217410fa3be4..704a04f28fa8a3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm @@ -374,9 +374,9 @@ static BOOL CommandNeedsTimedInvokeInICDManagementCluster(AttributeId aAttribute } } } -static BOOL CommandNeedsTimedInvokeInTimerCluster(AttributeId aAttributeId) +static BOOL CommandNeedsTimedInvokeInLaundryDryerControlsCluster(AttributeId aAttributeId) { - using namespace Clusters::Timer; + using namespace Clusters::LaundryDryerControls; switch (aAttributeId) { default: { return NO; @@ -554,33 +554,6 @@ static BOOL CommandNeedsTimedInvokeInActivatedCarbonFilterMonitoringCluster(Attr } } } -static BOOL CommandNeedsTimedInvokeInBooleanSensorConfigurationCluster(AttributeId aAttributeId) -{ - using namespace Clusters::BooleanSensorConfiguration; - switch (aAttributeId) { - default: { - return NO; - } - } -} -static BOOL CommandNeedsTimedInvokeInValveConfigurationAndControlCluster(AttributeId aAttributeId) -{ - using namespace Clusters::ValveConfigurationAndControl; - switch (aAttributeId) { - default: { - return NO; - } - } -} -static BOOL CommandNeedsTimedInvokeInDemandResponseLoadControlCluster(AttributeId aAttributeId) -{ - using namespace Clusters::DemandResponseLoadControl; - switch (aAttributeId) { - default: { - return NO; - } - } -} static BOOL CommandNeedsTimedInvokeInDoorLockCluster(AttributeId aAttributeId) { using namespace Clusters::DoorLock; @@ -1098,8 +1071,8 @@ BOOL MTRCommandNeedsTimedInvoke(NSNumber * _Nonnull aClusterID, NSNumber * _Nonn case Clusters::IcdManagement::Id: { return CommandNeedsTimedInvokeInICDManagementCluster(commandID); } - case Clusters::Timer::Id: { - return CommandNeedsTimedInvokeInTimerCluster(commandID); + case Clusters::LaundryDryerControls::Id: { + return CommandNeedsTimedInvokeInLaundryDryerControlsCluster(commandID); } case Clusters::OvenMode::Id: { return CommandNeedsTimedInvokeInOvenModeCluster(commandID); @@ -1158,15 +1131,6 @@ BOOL MTRCommandNeedsTimedInvoke(NSNumber * _Nonnull aClusterID, NSNumber * _Nonn case Clusters::ActivatedCarbonFilterMonitoring::Id: { return CommandNeedsTimedInvokeInActivatedCarbonFilterMonitoringCluster(commandID); } - case Clusters::BooleanSensorConfiguration::Id: { - return CommandNeedsTimedInvokeInBooleanSensorConfigurationCluster(commandID); - } - case Clusters::ValveConfigurationAndControl::Id: { - return CommandNeedsTimedInvokeInValveConfigurationAndControlCluster(commandID); - } - case Clusters::DemandResponseLoadControl::Id: { - return CommandNeedsTimedInvokeInDemandResponseLoadControlCluster(commandID); - } case Clusters::DoorLock::Id: { return CommandNeedsTimedInvokeInDoorLockCluster(commandID); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index c7c856671a917f..d5a982e07b59c6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -1644,9 +1644,9 @@ static id _Nullable DecodeEventPayloadForICDManagementCluster(EventId aEventId, *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } -static id _Nullable DecodeEventPayloadForTimerCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +static id _Nullable DecodeEventPayloadForLaundryDryerControlsCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::Timer; + using namespace Clusters::LaundryDryerControls; switch (aEventId) { default: { break; @@ -2261,259 +2261,6 @@ static id _Nullable DecodeEventPayloadForActivatedCarbonFilterMonitoringCluster( *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } -static id _Nullable DecodeEventPayloadForBooleanSensorConfigurationCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::BooleanSensorConfiguration; - switch (aEventId) { - case Events::AlarmsStateChanged::Id: { - Events::AlarmsStateChanged::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - - __auto_type * value = [MTRBooleanSensorConfigurationClusterAlarmsStateChangedEvent new]; - - do { - NSNumber * _Nonnull memberValue; - memberValue = [NSNumber numberWithUnsignedChar:cppValue.alarmsActive.Raw()]; - value.alarmsActive = memberValue; - } while (0); - do { - NSNumber * _Nullable memberValue; - if (cppValue.alarmsSuppressed.HasValue()) { - memberValue = [NSNumber numberWithUnsignedChar:cppValue.alarmsSuppressed.Value().Raw()]; - } else { - memberValue = nil; - } - value.alarmsSuppressed = memberValue; - } while (0); - - return value; - } - case Events::SensorFault::Id: { - Events::SensorFault::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - - __auto_type * value = [MTRBooleanSensorConfigurationClusterSensorFaultEvent new]; - - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; - return nil; -} -static id _Nullable DecodeEventPayloadForValveConfigurationAndControlCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::ValveConfigurationAndControl; - switch (aEventId) { - case Events::ValveStateChanged::Id: { - Events::ValveStateChanged::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - - __auto_type * value = [MTRValveConfigurationAndControlClusterValveStateChangedEvent new]; - - do { - NSNumber * _Nonnull memberValue; - memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.valveState)]; - value.valveState = memberValue; - } while (0); - - return value; - } - case Events::ValveFault::Id: { - Events::ValveFault::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - - __auto_type * value = [MTRValveConfigurationAndControlClusterValveFaultEvent new]; - - do { - NSNumber * _Nonnull memberValue; - memberValue = [NSNumber numberWithUnsignedShort:cppValue.valveFault.Raw()]; - value.valveFault = memberValue; - } while (0); - - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; - return nil; -} -static id _Nullable DecodeEventPayloadForDemandResponseLoadControlCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::DemandResponseLoadControl; - switch (aEventId) { - case Events::LoadControlEventStatusChange::Id: { - Events::LoadControlEventStatusChange::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - - __auto_type * value = [MTRDemandResponseLoadControlClusterLoadControlEventStatusChangeEvent new]; - - do { - NSData * _Nonnull memberValue; - memberValue = AsData(cppValue.eventID); - value.eventID = memberValue; - } while (0); - do { - NSNumber * _Nullable memberValue; - if (cppValue.transitionIndex.IsNull()) { - memberValue = nil; - } else { - memberValue = [NSNumber numberWithUnsignedChar:cppValue.transitionIndex.Value()]; - } - value.transitionIndex = memberValue; - } while (0); - do { - NSNumber * _Nonnull memberValue; - memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.status)]; - value.status = memberValue; - } while (0); - do { - NSNumber * _Nonnull memberValue; - memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.criticality)]; - value.criticality = memberValue; - } while (0); - do { - NSNumber * _Nonnull memberValue; - memberValue = [NSNumber numberWithUnsignedShort:cppValue.control.Raw()]; - value.control = memberValue; - } while (0); - do { - MTRDemandResponseLoadControlClusterTemperatureControlStruct * _Nullable memberValue; - if (cppValue.temperatureControl.HasValue()) { - if (cppValue.temperatureControl.Value().IsNull()) { - memberValue = nil; - } else { - memberValue = [MTRDemandResponseLoadControlClusterTemperatureControlStruct new]; - if (cppValue.temperatureControl.Value().Value().coolingTempOffset.HasValue()) { - if (cppValue.temperatureControl.Value().Value().coolingTempOffset.Value().IsNull()) { - memberValue.coolingTempOffset = nil; - } else { - memberValue.coolingTempOffset = [NSNumber numberWithUnsignedShort:cppValue.temperatureControl.Value().Value().coolingTempOffset.Value().Value()]; - } - } else { - memberValue.coolingTempOffset = nil; - } - if (cppValue.temperatureControl.Value().Value().heatingtTempOffset.HasValue()) { - if (cppValue.temperatureControl.Value().Value().heatingtTempOffset.Value().IsNull()) { - memberValue.heatingtTempOffset = nil; - } else { - memberValue.heatingtTempOffset = [NSNumber numberWithUnsignedShort:cppValue.temperatureControl.Value().Value().heatingtTempOffset.Value().Value()]; - } - } else { - memberValue.heatingtTempOffset = nil; - } - if (cppValue.temperatureControl.Value().Value().coolingTempSetpoint.HasValue()) { - if (cppValue.temperatureControl.Value().Value().coolingTempSetpoint.Value().IsNull()) { - memberValue.coolingTempSetpoint = nil; - } else { - memberValue.coolingTempSetpoint = [NSNumber numberWithShort:cppValue.temperatureControl.Value().Value().coolingTempSetpoint.Value().Value()]; - } - } else { - memberValue.coolingTempSetpoint = nil; - } - if (cppValue.temperatureControl.Value().Value().heatingTempSetpoint.HasValue()) { - if (cppValue.temperatureControl.Value().Value().heatingTempSetpoint.Value().IsNull()) { - memberValue.heatingTempSetpoint = nil; - } else { - memberValue.heatingTempSetpoint = [NSNumber numberWithShort:cppValue.temperatureControl.Value().Value().heatingTempSetpoint.Value().Value()]; - } - } else { - memberValue.heatingTempSetpoint = nil; - } - } - } else { - memberValue = nil; - } - value.temperatureControl = memberValue; - } while (0); - do { - MTRDemandResponseLoadControlClusterAverageLoadControlStruct * _Nullable memberValue; - if (cppValue.averageLoadControl.HasValue()) { - if (cppValue.averageLoadControl.Value().IsNull()) { - memberValue = nil; - } else { - memberValue = [MTRDemandResponseLoadControlClusterAverageLoadControlStruct new]; - memberValue.loadAdjustment = [NSNumber numberWithChar:cppValue.averageLoadControl.Value().Value().loadAdjustment]; - } - } else { - memberValue = nil; - } - value.averageLoadControl = memberValue; - } while (0); - do { - MTRDemandResponseLoadControlClusterDutyCycleControlStruct * _Nullable memberValue; - if (cppValue.dutyCycleControl.HasValue()) { - if (cppValue.dutyCycleControl.Value().IsNull()) { - memberValue = nil; - } else { - memberValue = [MTRDemandResponseLoadControlClusterDutyCycleControlStruct new]; - memberValue.dutyCycle = [NSNumber numberWithUnsignedChar:cppValue.dutyCycleControl.Value().Value().dutyCycle]; - } - } else { - memberValue = nil; - } - value.dutyCycleControl = memberValue; - } while (0); - do { - MTRDemandResponseLoadControlClusterPowerSavingsControlStruct * _Nullable memberValue; - if (cppValue.powerSavingsControl.HasValue()) { - if (cppValue.powerSavingsControl.Value().IsNull()) { - memberValue = nil; - } else { - memberValue = [MTRDemandResponseLoadControlClusterPowerSavingsControlStruct new]; - memberValue.powerSavings = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.powerSavingsControl.Value().Value().powerSavings)]; - } - } else { - memberValue = nil; - } - value.powerSavingsControl = memberValue; - } while (0); - do { - MTRDemandResponseLoadControlClusterHeatingSourceControlStruct * _Nullable memberValue; - if (cppValue.heatingSourceControl.HasValue()) { - if (cppValue.heatingSourceControl.Value().IsNull()) { - memberValue = nil; - } else { - memberValue = [MTRDemandResponseLoadControlClusterHeatingSourceControlStruct new]; - memberValue.heatingSource = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.heatingSourceControl.Value().Value().heatingSource)]; - } - } else { - memberValue = nil; - } - value.heatingSourceControl = memberValue; - } while (0); - - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; - return nil; -} static id _Nullable DecodeEventPayloadForDoorLockCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::DoorLock; @@ -3674,8 +3421,8 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::IcdManagement::Id: { return DecodeEventPayloadForICDManagementCluster(aPath.mEventId, aReader, aError); } - case Clusters::Timer::Id: { - return DecodeEventPayloadForTimerCluster(aPath.mEventId, aReader, aError); + case Clusters::LaundryDryerControls::Id: { + return DecodeEventPayloadForLaundryDryerControlsCluster(aPath.mEventId, aReader, aError); } case Clusters::OvenMode::Id: { return DecodeEventPayloadForOvenModeCluster(aPath.mEventId, aReader, aError); @@ -3734,15 +3481,6 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::ActivatedCarbonFilterMonitoring::Id: { return DecodeEventPayloadForActivatedCarbonFilterMonitoringCluster(aPath.mEventId, aReader, aError); } - case Clusters::BooleanSensorConfiguration::Id: { - return DecodeEventPayloadForBooleanSensorConfigurationCluster(aPath.mEventId, aReader, aError); - } - case Clusters::ValveConfigurationAndControl::Id: { - return DecodeEventPayloadForValveConfigurationAndControlCluster(aPath.mEventId, aReader, aError); - } - case Clusters::DemandResponseLoadControl::Id: { - return DecodeEventPayloadForDemandResponseLoadControlCluster(aPath.mEventId, aReader, aError); - } case Clusters::DoorLock::Id: { return DecodeEventPayloadForDoorLockCluster(aPath.mEventId, aReader, aError); } diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index a3a3fbc23f1b03..c98bdb4acee5c0 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 @@ -1192,9 +1192,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) namespace Options { -EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); @@ -1206,9 +1206,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -6635,101 +6635,63 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace IcdManagement -namespace Timer { +namespace LaundryDryerControls { namespace Attributes { -namespace SetTime { +namespace SelectedDrynessLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, + DataModel::Nullable & value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::Timer::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryDryerControls::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Timer::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); -} - -} // namespace SetTime - -namespace TimeRemaining { - -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::Timer::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + else { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::LaundryDryerControls::DrynessLevelEnum value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Timer::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::LaundryDryerControls::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } -} // namespace TimeRemaining - -namespace TimerState { - -EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::Timer::TimerStatusEnum * value) +EmberAfStatus SetNull(chip::EndpointId endpoint) { - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::Timer::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 emberAfWriteAttribute(endpoint, Clusters::LaundryDryerControls::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::Timer::TimerStatusEnum 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 emberAfWriteAttribute(endpoint, Clusters::Timer::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); + + return Set(endpoint, value.Value()); } -} // namespace TimerState +} // namespace SelectedDrynessLevel namespace FeatureMap { @@ -6738,7 +6700,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::Timer::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryDryerControls::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -6757,7 +6719,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Timer::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::LaundryDryerControls::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace FeatureMap @@ -6769,7 +6731,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::Timer::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryDryerControls::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -6788,13 +6750,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Timer::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::LaundryDryerControls::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace Timer +} // namespace LaundryDryerControls namespace OvenMode { namespace Attributes { @@ -8750,1106 +8712,79 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace MicrowaveOvenMode -namespace MicrowaveOvenControl { -namespace Attributes { - -namespace CookTime { - -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); -} - -} // namespace CookTime - -namespace PowerSetting { - -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -} // namespace PowerSetting - -namespace MinPower { - -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -} // namespace MinPower - -namespace MaxPower { - -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -} // namespace MaxPower - -namespace PowerStep { - -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -} // namespace PowerStep - -namespace FeatureMap { - -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); -} - -} // namespace FeatureMap - -namespace ClusterRevision { - -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace MicrowaveOvenControl - -namespace OperationalState { -namespace Attributes { - -namespace FeatureMap { - -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::OperationalState::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::OperationalState::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); -} - -} // namespace FeatureMap - -namespace ClusterRevision { - -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::OperationalState::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::OperationalState::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace OperationalState - -namespace RvcOperationalState { -namespace Attributes { - -namespace FeatureMap { - -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); -} - -} // namespace FeatureMap - -namespace ClusterRevision { - -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace RvcOperationalState - -namespace HepaFilterMonitoring { -namespace Attributes { - -namespace ClusterRevision { - -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::HepaFilterMonitoring::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::HepaFilterMonitoring::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace HepaFilterMonitoring - -namespace ActivatedCarbonFilterMonitoring { -namespace Attributes { - -namespace ClusterRevision { - -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = - emberAfReadAttribute(endpoint, Clusters::ActivatedCarbonFilterMonitoring::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ActivatedCarbonFilterMonitoring::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace ActivatedCarbonFilterMonitoring - -namespace BooleanSensorConfiguration { -namespace Attributes { - -namespace SensitivityLevel { - -EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::BooleanSensorConfiguration::SensitivityEnum * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::BooleanSensorConfiguration::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::BooleanSensorConfiguration::SensitivityEnum value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BooleanSensorConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); -} - -} // namespace SensitivityLevel - -namespace AlarmsActive { - -EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitMask * value) -{ - using Traits = NumericAttributeTraits>; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::BooleanSensorConfiguration::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) -{ - using Traits = NumericAttributeTraits>; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BooleanSensorConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); -} - -} // namespace AlarmsActive - -namespace AlarmsSuppressed { - -EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitMask * value) -{ - using Traits = NumericAttributeTraits>; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::BooleanSensorConfiguration::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) -{ - using Traits = NumericAttributeTraits>; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BooleanSensorConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); -} - -} // namespace AlarmsSuppressed - -namespace AlarmsEnabled { - -EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitMask * value) -{ - using Traits = NumericAttributeTraits>; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::BooleanSensorConfiguration::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) -{ - using Traits = NumericAttributeTraits>; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BooleanSensorConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); -} - -} // namespace AlarmsEnabled - -namespace FeatureMap { - -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::BooleanSensorConfiguration::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BooleanSensorConfiguration::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); -} - -} // namespace FeatureMap - -namespace ClusterRevision { - -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::BooleanSensorConfiguration::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BooleanSensorConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace BooleanSensorConfiguration - -namespace ValveConfigurationAndControl { -namespace Attributes { - -namespace OpenDuration { - -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (Traits::IsNullValue(temp)) - { - value.SetNull(); - } - else - { - value.SetNonNull() = Traits::StorageToWorking(temp); - } - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); -} - -EmberAfStatus SetNull(chip::EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_ELAPSED_S_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 OpenDuration - -namespace AutoCloseTime { - -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (Traits::IsNullValue(temp)) - { - value.SetNull(); - } - else - { - value.SetNonNull() = Traits::StorageToWorking(temp); - } - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_EPOCH_US_ATTRIBUTE_TYPE); -} - -EmberAfStatus SetNull(chip::EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_EPOCH_US_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 AutoCloseTime - -namespace RemainingDuration { - -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (Traits::IsNullValue(temp)) - { - value.SetNull(); - } - else - { - value.SetNonNull() = Traits::StorageToWorking(temp); - } - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); -} - -EmberAfStatus SetNull(chip::EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_ELAPSED_S_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 RemainingDuration - -namespace CurrentState { - -EmberAfStatus Get(chip::EndpointId endpoint, - DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (Traits::IsNullValue(temp)) - { - value.SetNull(); - } - else - { - value.SetNonNull() = Traits::StorageToWorking(temp); - } - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); -} - -EmberAfStatus SetNull(chip::EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_ENUM8_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 CurrentState - -namespace TargetState { - -EmberAfStatus Get(chip::EndpointId endpoint, - DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (Traits::IsNullValue(temp)) - { - value.SetNull(); - } - else - { - value.SetNonNull() = Traits::StorageToWorking(temp); - } - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); -} - -EmberAfStatus SetNull(chip::EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_ENUM8_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 TargetState - -namespace StartUpState { - -EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); -} - -} // namespace StartUpState - -namespace CurrentLevel { - -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (Traits::IsNullValue(temp)) - { - value.SetNull(); - } - else - { - value.SetNonNull() = Traits::StorageToWorking(temp); - } - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE); -} - -EmberAfStatus SetNull(chip::EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_PERCENT_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 CurrentLevel +namespace MicrowaveOvenControl { +namespace Attributes { -namespace TargetLevel { +namespace CookTime { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (Traits::IsNullValue(temp)) - { - value.SetNull(); - } - else + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { - value.SetNonNull() = Traits::StorageToWorking(temp); + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } + *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent value) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE); -} - -EmberAfStatus SetNull(chip::EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE); -} - -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); + return emberAfWriteAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); } -} // namespace TargetLevel +} // namespace CookTime -namespace OpenLevel { +namespace PowerSetting { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (Traits::IsNullValue(temp)) - { - value.SetNull(); - } - else + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { - value.SetNonNull() = Traits::StorageToWorking(temp); + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } + *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent value) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE); -} - -EmberAfStatus SetNull(chip::EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE); -} - -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); + return emberAfWriteAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -} // namespace OpenLevel +} // namespace PowerSetting -namespace ValveFault { +namespace MinPower { -EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitMask * value) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -9858,10 +8793,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, - chip::BitMask value) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -9869,19 +8803,19 @@ EmberAfStatus Set(chip::EndpointId endpoint, Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -} // namespace ValveFault +} // namespace MinPower -namespace FeatureMap { +namespace MaxPower { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -9890,9 +8824,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -9900,19 +8834,19 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -} // namespace FeatureMap +} // namespace MaxPower -namespace ClusterRevision { +namespace PowerStep { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -9921,9 +8855,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -9931,26 +8865,19 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace ValveConfigurationAndControl - -namespace DemandResponseLoadControl { -namespace Attributes { +} // namespace PowerStep -namespace DeviceClass { +namespace FeatureMap { -EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitMask * value) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -9959,9 +8886,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -9969,19 +8896,19 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -9990,9 +8917,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -10000,19 +8927,25 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace NumberOfLoadControlPrograms +} // namespace ClusterRevision -namespace NumberOfEventsPerProgram { +} // namespace Attributes +} // namespace MicrowaveOvenControl -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +namespace OperationalState { +namespace Attributes { + +namespace FeatureMap { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::OperationalState::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -10021,9 +8954,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -10031,19 +8964,19 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::OperationalState::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } -} // namespace NumberOfEventsPerProgram +} // namespace FeatureMap -namespace NumberOfTransistions { +namespace ClusterRevision { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::OperationalState::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -10052,9 +8985,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -10062,19 +8995,25 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::OperationalState::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace NumberOfTransistions +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace OperationalState -namespace DefaultRandomStart { +namespace RvcOperationalState { +namespace Attributes { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +namespace FeatureMap { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -10083,9 +9022,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -10093,19 +9032,19 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } -} // namespace DefaultRandomStart +} // namespace FeatureMap -namespace DefaultRandomDuration { +namespace ClusterRevision { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -10114,9 +9053,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -10124,19 +9063,25 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace DefaultRandomDuration +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace RvcOperationalState -namespace FeatureMap { +namespace HepaFilterMonitoring { +namespace Attributes { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +namespace ClusterRevision { + +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::HepaFilterMonitoring::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -10145,9 +9090,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -10155,10 +9100,16 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::HepaFilterMonitoring::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace FeatureMap +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace HepaFilterMonitoring + +namespace ActivatedCarbonFilterMonitoring { +namespace Attributes { namespace ClusterRevision { @@ -10166,8 +9117,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { using Traits = NumericAttributeTraits; Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, readable, sizeof(temp)); + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadAttribute(endpoint, Clusters::ActivatedCarbonFilterMonitoring::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -10186,13 +9138,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ActivatedCarbonFilterMonitoring::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace DemandResponseLoadControl +} // namespace ActivatedCarbonFilterMonitoring namespace DoorLock { namespace Attributes { @@ -16225,10 +15177,9 @@ namespace Attributes { namespace TemperatureDisplayMode { -EmberAfStatus Get(chip::EndpointId endpoint, - chip::app::Clusters::ThermostatUserInterfaceConfiguration::TemperatureDisplayModeEnum * value) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = @@ -16241,10 +15192,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, - chip::app::Clusters::ThermostatUserInterfaceConfiguration::TemperatureDisplayModeEnum value) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -16260,9 +15210,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, namespace KeypadLockout { -EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::ThermostatUserInterfaceConfiguration::KeypadLockoutEnum * value) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = @@ -16275,9 +15225,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::ThermostatUser *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::ThermostatUserInterfaceConfiguration::KeypadLockoutEnum value) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -16293,11 +15243,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::ThermostatUser namespace ScheduleProgrammingVisibility { -EmberAfStatus Get(chip::EndpointId endpoint, - chip::app::Clusters::ThermostatUserInterfaceConfiguration::ScheduleProgrammingVisibilityEnum * value) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - using Traits = - NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = @@ -16310,11 +15258,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, - chip::app::Clusters::ThermostatUserInterfaceConfiguration::ScheduleProgrammingVisibilityEnum value) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - using Traits = - NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; 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 309f3eaaea650a..9365346dfa5f3a 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 @@ -248,8 +248,8 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); namespace Options { EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitMask * value); // OptionsBitmap -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); + chip::BitMask * value); // LevelControlOptions +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace Options namespace OnOffTransitionTime { @@ -1287,23 +1287,17 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace IcdManagement -namespace Timer { +namespace LaundryDryerControls { namespace Attributes { -namespace SetTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // elapsed_s -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); -} // namespace SetTime - -namespace TimeRemaining { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // elapsed_s -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); -} // namespace TimeRemaining - -namespace TimerState { -EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::Timer::TimerStatusEnum * value); // TimerStatusEnum -EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::Timer::TimerStatusEnum value); -} // namespace TimerState +namespace SelectedDrynessLevel { +EmberAfStatus Get(chip::EndpointId endpoint, + DataModel::Nullable & value); // DrynessLevelEnum +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::LaundryDryerControls::DrynessLevelEnum value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable & value); +} // namespace SelectedDrynessLevel namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 @@ -1316,7 +1310,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ClusterRevision } // namespace Attributes -} // namespace Timer +} // namespace LaundryDryerControls namespace OvenMode { namespace Attributes { @@ -1791,183 +1785,6 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace ActivatedCarbonFilterMonitoring -namespace BooleanSensorConfiguration { -namespace Attributes { - -namespace SensitivityLevel { -EmberAfStatus Get(chip::EndpointId endpoint, - chip::app::Clusters::BooleanSensorConfiguration::SensitivityEnum * value); // SensitivityEnum -EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::BooleanSensorConfiguration::SensitivityEnum value); -} // namespace SensitivityLevel - -namespace AlarmsActive { -EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitMask * value); // AlarmModeBitmap -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); -} // namespace AlarmsActive - -namespace AlarmsSuppressed { -EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitMask * value); // AlarmModeBitmap -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); -} // namespace AlarmsSuppressed - -namespace AlarmsEnabled { -EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitMask * value); // AlarmModeBitmap -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); -} // namespace AlarmsEnabled - -namespace FeatureMap { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); -} // namespace FeatureMap - -namespace ClusterRevision { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace BooleanSensorConfiguration - -namespace ValveConfigurationAndControl { -namespace Attributes { - -namespace OpenDuration { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // elapsed_s -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 OpenDuration - -namespace AutoCloseTime { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // epoch_us -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); -EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); -} // namespace AutoCloseTime - -namespace RemainingDuration { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // elapsed_s -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 RemainingDuration - -namespace CurrentState { -EmberAfStatus Get(chip::EndpointId endpoint, - DataModel::Nullable & value); // ValveStateEnum -EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum value); -EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, - const chip::app::DataModel::Nullable & value); -} // namespace CurrentState - -namespace TargetState { -EmberAfStatus Get(chip::EndpointId endpoint, - DataModel::Nullable & value); // ValveStateEnum -EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum value); -EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, - const chip::app::DataModel::Nullable & value); -} // namespace TargetState - -namespace StartUpState { -EmberAfStatus Get(chip::EndpointId endpoint, - chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum * value); // ValveStateEnum -EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum value); -} // namespace StartUpState - -namespace CurrentLevel { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // percent -EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent value); -EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); -} // namespace CurrentLevel - -namespace TargetLevel { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // percent -EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent value); -EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); -} // namespace TargetLevel - -namespace OpenLevel { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // percent -EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent value); -EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); -} // namespace OpenLevel - -namespace ValveFault { -EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitMask * value); // ValveFaultBitmap -EmberAfStatus Set(chip::EndpointId endpoint, - chip::BitMask value); -} // namespace ValveFault - -namespace FeatureMap { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); -} // namespace FeatureMap - -namespace ClusterRevision { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace ValveConfigurationAndControl - -namespace DemandResponseLoadControl { -namespace Attributes { - -namespace DeviceClass { -EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitMask * value); // DeviceClassBitmap -EmberAfStatus Set(chip::EndpointId endpoint, - chip::BitMask value); -} // namespace DeviceClass - -namespace NumberOfLoadControlPrograms { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); -} // namespace NumberOfLoadControlPrograms - -namespace NumberOfEventsPerProgram { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); -} // namespace NumberOfEventsPerProgram - -namespace NumberOfTransistions { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); -} // namespace NumberOfTransistions - -namespace DefaultRandomStart { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); -} // namespace DefaultRandomStart - -namespace DefaultRandomDuration { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); -} // namespace DefaultRandomDuration - -namespace FeatureMap { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); -} // namespace FeatureMap - -namespace ClusterRevision { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace DemandResponseLoadControl - namespace DoorLock { namespace Attributes { @@ -2929,25 +2746,18 @@ namespace ThermostatUserInterfaceConfiguration { namespace Attributes { namespace TemperatureDisplayMode { -EmberAfStatus -Get(chip::EndpointId endpoint, - chip::app::Clusters::ThermostatUserInterfaceConfiguration::TemperatureDisplayModeEnum * value); // TemperatureDisplayModeEnum -EmberAfStatus Set(chip::EndpointId endpoint, - chip::app::Clusters::ThermostatUserInterfaceConfiguration::TemperatureDisplayModeEnum value); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace TemperatureDisplayMode namespace KeypadLockout { -EmberAfStatus Get(chip::EndpointId endpoint, - chip::app::Clusters::ThermostatUserInterfaceConfiguration::KeypadLockoutEnum * value); // KeypadLockoutEnum -EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::ThermostatUserInterfaceConfiguration::KeypadLockoutEnum value); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace KeypadLockout namespace ScheduleProgrammingVisibility { -EmberAfStatus Get(chip::EndpointId endpoint, - chip::app::Clusters::ThermostatUserInterfaceConfiguration::ScheduleProgrammingVisibilityEnum * - value); // ScheduleProgrammingVisibilityEnum -EmberAfStatus Set(chip::EndpointId endpoint, - chip::app::Clusters::ThermostatUserInterfaceConfiguration::ScheduleProgrammingVisibilityEnum value); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace ScheduleProgrammingVisibility namespace FeatureMap { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h index 4b287c6e70abc8..129df43ecf332c 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h @@ -118,25 +118,39 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(OnOff::StartUpOnOffEnum } } -static auto __attribute__((unused)) EnsureKnownEnumValue(LevelControl::MoveModeEnum val) +static auto __attribute__((unused)) EnsureKnownEnumValue(LevelControl::MoveMode val) { - using EnumType = LevelControl::MoveModeEnum; + using EnumType = LevelControl::MoveMode; switch (val) { +// Need to convert consumers to using the new enum classes, so we +// don't just have casts all over. +#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM case EnumType::kUp: case EnumType::kDown: +#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM + case EMBER_ZCL_MOVE_MODE_UP: + case EMBER_ZCL_MOVE_MODE_DOWN: +#endif // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM return val; default: return static_cast(2); } } -static auto __attribute__((unused)) EnsureKnownEnumValue(LevelControl::StepModeEnum val) +static auto __attribute__((unused)) EnsureKnownEnumValue(LevelControl::StepMode val) { - using EnumType = LevelControl::StepModeEnum; + using EnumType = LevelControl::StepMode; switch (val) { +// Need to convert consumers to using the new enum classes, so we +// don't just have casts all over. +#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM case EnumType::kUp: case EnumType::kDown: +#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM + case EMBER_ZCL_STEP_MODE_UP: + case EMBER_ZCL_STEP_MODE_DOWN: +#endif // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM return val; default: return static_cast(2); @@ -1186,15 +1200,15 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(GroupKeyManagement::Gro } } -static auto __attribute__((unused)) EnsureKnownEnumValue(Timer::TimerStatusEnum val) +static auto __attribute__((unused)) EnsureKnownEnumValue(LaundryDryerControls::DrynessLevelEnum val) { - using EnumType = Timer::TimerStatusEnum; + using EnumType = LaundryDryerControls::DrynessLevelEnum; switch (val) { - case EnumType::kRunning: - case EnumType::kPaused: - case EnumType::kExpired: - case EnumType::kReady: + case EnumType::kLow: + case EnumType::kNormal: + case EnumType::kExtra: + case EnumType::kMax: return val; default: return static_cast(4); @@ -1462,115 +1476,6 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(ActivatedCarbonFilterMo } } -static auto __attribute__((unused)) EnsureKnownEnumValue(BooleanSensorConfiguration::SensitivityEnum val) -{ - using EnumType = BooleanSensorConfiguration::SensitivityEnum; - switch (val) - { - case EnumType::kHigh: - case EnumType::kStandard: - case EnumType::kLow: - return val; - default: - return static_cast(3); - } -} - -static auto __attribute__((unused)) EnsureKnownEnumValue(ValveConfigurationAndControl::ValveStateEnum val) -{ - using EnumType = ValveConfigurationAndControl::ValveStateEnum; - switch (val) - { - case EnumType::kOpen: - case EnumType::kClosed: - return val; - default: - return static_cast(2); - } -} - -static auto __attribute__((unused)) EnsureKnownEnumValue(DemandResponseLoadControl::CriticalityLevelEnum val) -{ - using EnumType = DemandResponseLoadControl::CriticalityLevelEnum; - switch (val) - { - case EnumType::kUnknown: - case EnumType::kGreen: - case EnumType::kLevel1: - case EnumType::kLevel2: - case EnumType::kLevel3: - case EnumType::kLevel4: - case EnumType::kLevel5: - case EnumType::kEmergency: - case EnumType::kPlannedOutage: - case EnumType::kServiceDisconnect: - return val; - default: - return static_cast(10); - } -} -static auto __attribute__((unused)) EnsureKnownEnumValue(DemandResponseLoadControl::HeatingSourceEnum val) -{ - using EnumType = DemandResponseLoadControl::HeatingSourceEnum; - switch (val) - { - case EnumType::kAny: - case EnumType::kElectric: - case EnumType::kNonElectric: - return val; - default: - return static_cast(3); - } -} -static auto __attribute__((unused)) EnsureKnownEnumValue(DemandResponseLoadControl::LoadControlEventChangeSourceEnum val) -{ - using EnumType = DemandResponseLoadControl::LoadControlEventChangeSourceEnum; - switch (val) - { - case EnumType::kAutomatic: - case EnumType::kUserAction: - return val; - default: - return static_cast(2); - } -} -static auto __attribute__((unused)) EnsureKnownEnumValue(DemandResponseLoadControl::LoadControlEventStatusEnum val) -{ - using EnumType = DemandResponseLoadControl::LoadControlEventStatusEnum; - switch (val) - { - case EnumType::kUnknown: - case EnumType::kReceived: - case EnumType::kInProgress: - case EnumType::kCompleted: - case EnumType::kOptedOut: - case EnumType::kOptedIn: - case EnumType::kCanceled: - case EnumType::kSuperseded: - case EnumType::kPartialOptedOut: - case EnumType::kPartialOptedIn: - case EnumType::kNoParticipation: - case EnumType::kUnavailable: - case EnumType::kFailed: - return val; - default: - return static_cast(13); - } -} -static auto __attribute__((unused)) EnsureKnownEnumValue(DemandResponseLoadControl::PowerSavingsEnum val) -{ - using EnumType = DemandResponseLoadControl::PowerSavingsEnum; - switch (val) - { - case EnumType::kLow: - case EnumType::kMedium: - case EnumType::kHigh: - return val; - default: - return static_cast(3); - } -} - static auto __attribute__((unused)) EnsureKnownEnumValue(DoorLock::AlarmCodeEnum val) { using EnumType = DoorLock::AlarmCodeEnum; @@ -2114,48 +2019,6 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(FanControl::StepDirecti } } -static auto __attribute__((unused)) EnsureKnownEnumValue(ThermostatUserInterfaceConfiguration::KeypadLockoutEnum val) -{ - using EnumType = ThermostatUserInterfaceConfiguration::KeypadLockoutEnum; - switch (val) - { - case EnumType::kNoLockout: - case EnumType::kLockout1: - case EnumType::kLockout2: - case EnumType::kLockout3: - case EnumType::kLockout4: - case EnumType::kLockout5: - return val; - default: - return static_cast(6); - } -} -static auto __attribute__((unused)) -EnsureKnownEnumValue(ThermostatUserInterfaceConfiguration::ScheduleProgrammingVisibilityEnum val) -{ - using EnumType = ThermostatUserInterfaceConfiguration::ScheduleProgrammingVisibilityEnum; - switch (val) - { - case EnumType::kScheduleProgrammingPermitted: - case EnumType::kScheduleProgrammingDenied: - return val; - default: - return static_cast(2); - } -} -static auto __attribute__((unused)) EnsureKnownEnumValue(ThermostatUserInterfaceConfiguration::TemperatureDisplayModeEnum val) -{ - using EnumType = ThermostatUserInterfaceConfiguration::TemperatureDisplayModeEnum; - switch (val) - { - case EnumType::kCelsius: - case EnumType::kFahrenheit: - return val; - default: - return static_cast(2); - } -} - static auto __attribute__((unused)) EnsureKnownEnumValue(ColorControl::ColorLoopAction val) { using EnumType = ColorControl::ColorLoopAction; diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 7712c63d297961..771df8e0551c10 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -182,8 +182,11 @@ namespace OnOffSwitchConfiguration {} // namespace OnOffSwitchConfiguration namespace LevelControl { -// Enum for MoveModeEnum -enum class MoveModeEnum : uint8_t +// Need to convert consumers to using the new enum classes, so we +// don't just have casts all over. +#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM +// Enum for MoveMode +enum class MoveMode : uint8_t { kUp = 0x00, kDown = 0x01, @@ -193,9 +196,16 @@ enum class MoveModeEnum : uint8_t // enum value. This specific should never be transmitted. kUnknownEnumValue = 2, }; +#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM +using MoveMode = EmberAfMoveMode; +static MoveMode __attribute__((unused)) kMoveModekUnknownEnumValue = static_cast(2); +#endif // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -// Enum for StepModeEnum -enum class StepModeEnum : uint8_t +// Need to convert consumers to using the new enum classes, so we +// don't just have casts all over. +#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM +// Enum for StepMode +enum class StepMode : uint8_t { kUp = 0x00, kDown = 0x01, @@ -205,6 +215,10 @@ enum class StepModeEnum : uint8_t // enum value. This specific should never be transmitted. kUnknownEnumValue = 2, }; +#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM +using StepMode = EmberAfStepMode; +static StepMode __attribute__((unused)) kStepModekUnknownEnumValue = static_cast(2); +#endif // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM // Bitmap for Feature enum class Feature : uint32_t @@ -214,8 +228,8 @@ enum class Feature : uint32_t kFrequency = 0x4, }; -// Bitmap for OptionsBitmap -enum class OptionsBitmap : uint8_t +// Bitmap for LevelControlOptions +enum class LevelControlOptions : uint8_t { kExecuteIfOff = 0x1, kCoupleColorTempToLevel = 0x2, @@ -1503,28 +1517,22 @@ enum class UserActiveModeTriggerBitmap : uint32_t }; } // namespace IcdManagement -namespace Timer { +namespace LaundryDryerControls { -// Enum for TimerStatusEnum -enum class TimerStatusEnum : uint8_t +// Enum for DrynessLevelEnum +enum class DrynessLevelEnum : uint8_t { - kRunning = 0x00, - kPaused = 0x01, - kExpired = 0x02, - kReady = 0x03, + kLow = 0x00, + kNormal = 0x01, + kExtra = 0x02, + kMax = 0x03, // All received enum values that are not listed above will be mapped // to kUnknownEnumValue. This is a helper enum value that should only // be used by code to process how it handles receiving and unknown // enum value. This specific should never be transmitted. kUnknownEnumValue = 4, }; - -// Bitmap for Feature -enum class Feature : uint32_t -{ - kReset = 0x1, -}; -} // namespace Timer +} // namespace LaundryDryerControls namespace OvenMode { @@ -2077,205 +2085,6 @@ enum class Feature : uint32_t }; } // namespace ActivatedCarbonFilterMonitoring -namespace BooleanSensorConfiguration { - -// Enum for SensitivityEnum -enum class SensitivityEnum : uint8_t -{ - kHigh = 0x00, - kStandard = 0x01, - kLow = 0x02, - // All received enum values that are not listed above will be mapped - // to kUnknownEnumValue. This is a helper enum value that should only - // be used by code to process how it handles receiving and unknown - // enum value. This specific should never be transmitted. - kUnknownEnumValue = 3, -}; - -// Bitmap for AlarmModeBitmap -enum class AlarmModeBitmap : uint8_t -{ - kVisual = 0x1, - kAudible = 0x2, -}; - -// Bitmap for Feature -enum class Feature : uint32_t -{ - kVisual = 0x1, - kAudible = 0x2, - kAlarmSuppress = 0x4, - kSensitivityLevel = 0x8, -}; -} // namespace BooleanSensorConfiguration - -namespace ValveConfigurationAndControl { - -// Enum for ValveStateEnum -enum class ValveStateEnum : uint8_t -{ - kOpen = 0x00, - kClosed = 0x01, - // All received enum values that are not listed above will be mapped - // to kUnknownEnumValue. This is a helper enum value that should only - // be used by code to process how it handles receiving and unknown - // enum value. This specific should never be transmitted. - kUnknownEnumValue = 2, -}; - -// Bitmap for Feature -enum class Feature : uint32_t -{ - kTimeSync = 0x1, - kLevel = 0x2, -}; - -// Bitmap for ValveFaultBitmap -enum class ValveFaultBitmap : uint16_t -{ - kGeneralFault = 0x1, - kBlocked = 0x2, - kLeaking = 0x4, -}; -} // namespace ValveConfigurationAndControl - -namespace DemandResponseLoadControl { - -// Enum for CriticalityLevelEnum -enum class CriticalityLevelEnum : uint8_t -{ - kUnknown = 0x00, - kGreen = 0x01, - kLevel1 = 0x02, - kLevel2 = 0x03, - kLevel3 = 0x04, - kLevel4 = 0x05, - kLevel5 = 0x06, - kEmergency = 0x07, - kPlannedOutage = 0x08, - kServiceDisconnect = 0x09, - // All received enum values that are not listed above will be mapped - // to kUnknownEnumValue. This is a helper enum value that should only - // be used by code to process how it handles receiving and unknown - // enum value. This specific should never be transmitted. - kUnknownEnumValue = 10, -}; - -// Enum for HeatingSourceEnum -enum class HeatingSourceEnum : uint8_t -{ - kAny = 0x00, - kElectric = 0x01, - kNonElectric = 0x02, - // All received enum values that are not listed above will be mapped - // to kUnknownEnumValue. This is a helper enum value that should only - // be used by code to process how it handles receiving and unknown - // enum value. This specific should never be transmitted. - kUnknownEnumValue = 3, -}; - -// Enum for LoadControlEventChangeSourceEnum -enum class LoadControlEventChangeSourceEnum : uint8_t -{ - kAutomatic = 0x00, - kUserAction = 0x01, - // All received enum values that are not listed above will be mapped - // to kUnknownEnumValue. This is a helper enum value that should only - // be used by code to process how it handles receiving and unknown - // enum value. This specific should never be transmitted. - kUnknownEnumValue = 2, -}; - -// Enum for LoadControlEventStatusEnum -enum class LoadControlEventStatusEnum : uint8_t -{ - kUnknown = 0x00, - kReceived = 0x01, - kInProgress = 0x02, - kCompleted = 0x03, - kOptedOut = 0x04, - kOptedIn = 0x05, - kCanceled = 0x06, - kSuperseded = 0x07, - kPartialOptedOut = 0x08, - kPartialOptedIn = 0x09, - kNoParticipation = 0x0A, - kUnavailable = 0x0B, - kFailed = 0x0C, - // All received enum values that are not listed above will be mapped - // to kUnknownEnumValue. This is a helper enum value that should only - // be used by code to process how it handles receiving and unknown - // enum value. This specific should never be transmitted. - kUnknownEnumValue = 13, -}; - -// Enum for PowerSavingsEnum -enum class PowerSavingsEnum : uint8_t -{ - kLow = 0x00, - kMedium = 0x01, - kHigh = 0x02, - // All received enum values that are not listed above will be mapped - // to kUnknownEnumValue. This is a helper enum value that should only - // be used by code to process how it handles receiving and unknown - // enum value. This specific should never be transmitted. - kUnknownEnumValue = 3, -}; - -// Bitmap for CancelControlBitmap -enum class CancelControlBitmap : uint16_t -{ - kRandomEnd = 0x1, -}; - -// Bitmap for DeviceClassBitmap -enum class DeviceClassBitmap : uint32_t -{ - kHvac = 0x1, - kStripHeater = 0x2, - kWaterHeater = 0x4, - kPoolPump = 0x8, - kSmartAppliance = 0x10, - kIrrigationPump = 0x20, - kCommercialLoad = 0x40, - kResidentialLoad = 0x80, - kExteriorLighting = 0x100, - kInteriorLighting = 0x200, - kEv = 0x400, - kGenerationSystem = 0x800, - kSmartInverter = 0x1000, - kEvse = 0x2000, - kResu = 0x4000, - kEms = 0x8000, - kSem = 0x10000, -}; - -// Bitmap for EventControlBitmap -enum class EventControlBitmap : uint16_t -{ - kRandomStart = 0x1, -}; - -// Bitmap for EventTransitionControlBitmap -enum class EventTransitionControlBitmap : uint16_t -{ - kRandomDuration = 0x1, - kIgnoreOptOut = 0x2, -}; - -// Bitmap for Feature -enum class Feature : uint32_t -{ - kEnrollmentGroups = 0x1, - kTemperatureOffset = 0x2, - kTemperatureSetpoint = 0x4, - kLoadAdjustment = 0x8, - kDutyCycle = 0x10, - kPowerSavings = 0x20, - kHeatingSource = 0x40, -}; -} // namespace DemandResponseLoadControl - namespace DoorLock { // Enum for AlarmCodeEnum @@ -3158,48 +2967,7 @@ enum class WindBitmap : uint8_t }; } // namespace FanControl -namespace ThermostatUserInterfaceConfiguration { - -// Enum for KeypadLockoutEnum -enum class KeypadLockoutEnum : uint8_t -{ - kNoLockout = 0x00, - kLockout1 = 0x01, - kLockout2 = 0x02, - kLockout3 = 0x03, - kLockout4 = 0x04, - kLockout5 = 0x05, - // All received enum values that are not listed above will be mapped - // to kUnknownEnumValue. This is a helper enum value that should only - // be used by code to process how it handles receiving and unknown - // enum value. This specific should never be transmitted. - kUnknownEnumValue = 6, -}; - -// Enum for ScheduleProgrammingVisibilityEnum -enum class ScheduleProgrammingVisibilityEnum : uint8_t -{ - kScheduleProgrammingPermitted = 0x00, - kScheduleProgrammingDenied = 0x01, - // All received enum values that are not listed above will be mapped - // to kUnknownEnumValue. This is a helper enum value that should only - // be used by code to process how it handles receiving and unknown - // enum value. This specific should never be transmitted. - kUnknownEnumValue = 2, -}; - -// Enum for TemperatureDisplayModeEnum -enum class TemperatureDisplayModeEnum : uint8_t -{ - kCelsius = 0x00, - kFahrenheit = 0x01, - // All received enum values that are not listed above will be mapped - // to kUnknownEnumValue. This is a helper enum value that should only - // be used by code to process how it handles receiving and unknown - // enum value. This specific should never be transmitted. - kUnknownEnumValue = 2, -}; -} // namespace ThermostatUserInterfaceConfiguration +namespace ThermostatUserInterfaceConfiguration {} // namespace ThermostatUserInterfaceConfiguration namespace ColorControl { 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 1bc7d5674bb9f3..6d4bf2820beee0 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 @@ -722,14 +722,6 @@ namespace ProductAppearance { static constexpr AttributeId Id = 0x00000014; } // namespace ProductAppearance -namespace SpecificationVersion { -static constexpr AttributeId Id = 0x00000015; -} // namespace SpecificationVersion - -namespace MaxPathsPerInvoke { -static constexpr AttributeId Id = 0x00000016; -} // namespace MaxPathsPerInvoke - namespace GeneratedCommandList { static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; } // namespace GeneratedCommandList @@ -2449,20 +2441,16 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace IcdManagement -namespace Timer { +namespace LaundryDryerControls { namespace Attributes { -namespace SetTime { +namespace SupportedDrynessLevels { static constexpr AttributeId Id = 0x00000000; -} // namespace SetTime +} // namespace SupportedDrynessLevels -namespace TimeRemaining { +namespace SelectedDrynessLevel { static constexpr AttributeId Id = 0x00000001; -} // namespace TimeRemaining - -namespace TimerState { -static constexpr AttributeId Id = 0x00000002; -} // namespace TimerState +} // namespace SelectedDrynessLevel namespace GeneratedCommandList { static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; @@ -2489,7 +2477,7 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace ClusterRevision } // namespace Attributes -} // namespace Timer +} // namespace LaundryDryerControls namespace OvenMode { namespace Attributes { @@ -3421,188 +3409,6 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace ActivatedCarbonFilterMonitoring -namespace BooleanSensorConfiguration { -namespace Attributes { - -namespace SensitivityLevel { -static constexpr AttributeId Id = 0x00000000; -} // namespace SensitivityLevel - -namespace AlarmsActive { -static constexpr AttributeId Id = 0x00000001; -} // namespace AlarmsActive - -namespace AlarmsSuppressed { -static constexpr AttributeId Id = 0x00000002; -} // namespace AlarmsSuppressed - -namespace AlarmsEnabled { -static constexpr AttributeId Id = 0x00000003; -} // namespace AlarmsEnabled - -namespace GeneratedCommandList { -static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; -} // namespace GeneratedCommandList - -namespace AcceptedCommandList { -static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; -} // namespace AcceptedCommandList - -namespace EventList { -static constexpr AttributeId Id = Globals::Attributes::EventList::Id; -} // namespace EventList - -namespace AttributeList { -static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; -} // namespace AttributeList - -namespace FeatureMap { -static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; -} // namespace FeatureMap - -namespace ClusterRevision { -static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace BooleanSensorConfiguration - -namespace ValveConfigurationAndControl { -namespace Attributes { - -namespace OpenDuration { -static constexpr AttributeId Id = 0x00000000; -} // namespace OpenDuration - -namespace AutoCloseTime { -static constexpr AttributeId Id = 0x00000001; -} // namespace AutoCloseTime - -namespace RemainingDuration { -static constexpr AttributeId Id = 0x00000002; -} // namespace RemainingDuration - -namespace CurrentState { -static constexpr AttributeId Id = 0x00000003; -} // namespace CurrentState - -namespace TargetState { -static constexpr AttributeId Id = 0x00000004; -} // namespace TargetState - -namespace StartUpState { -static constexpr AttributeId Id = 0x00000005; -} // namespace StartUpState - -namespace CurrentLevel { -static constexpr AttributeId Id = 0x00000006; -} // namespace CurrentLevel - -namespace TargetLevel { -static constexpr AttributeId Id = 0x00000007; -} // namespace TargetLevel - -namespace OpenLevel { -static constexpr AttributeId Id = 0x00000008; -} // namespace OpenLevel - -namespace ValveFault { -static constexpr AttributeId Id = 0x00000009; -} // namespace ValveFault - -namespace GeneratedCommandList { -static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; -} // namespace GeneratedCommandList - -namespace AcceptedCommandList { -static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; -} // namespace AcceptedCommandList - -namespace EventList { -static constexpr AttributeId Id = Globals::Attributes::EventList::Id; -} // namespace EventList - -namespace AttributeList { -static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; -} // namespace AttributeList - -namespace FeatureMap { -static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; -} // namespace FeatureMap - -namespace ClusterRevision { -static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace ValveConfigurationAndControl - -namespace DemandResponseLoadControl { -namespace Attributes { - -namespace DeviceClass { -static constexpr AttributeId Id = 0x00000000; -} // namespace DeviceClass - -namespace LoadControlPrograms { -static constexpr AttributeId Id = 0x00000001; -} // namespace LoadControlPrograms - -namespace NumberOfLoadControlPrograms { -static constexpr AttributeId Id = 0x00000002; -} // namespace NumberOfLoadControlPrograms - -namespace Events { -static constexpr AttributeId Id = 0x00000003; -} // namespace Events - -namespace ActiveEvents { -static constexpr AttributeId Id = 0x00000004; -} // namespace ActiveEvents - -namespace NumberOfEventsPerProgram { -static constexpr AttributeId Id = 0x00000005; -} // namespace NumberOfEventsPerProgram - -namespace NumberOfTransistions { -static constexpr AttributeId Id = 0x00000006; -} // namespace NumberOfTransistions - -namespace DefaultRandomStart { -static constexpr AttributeId Id = 0x00000007; -} // namespace DefaultRandomStart - -namespace DefaultRandomDuration { -static constexpr AttributeId Id = 0x00000008; -} // namespace DefaultRandomDuration - -namespace GeneratedCommandList { -static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; -} // namespace GeneratedCommandList - -namespace AcceptedCommandList { -static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; -} // namespace AcceptedCommandList - -namespace EventList { -static constexpr AttributeId Id = Globals::Attributes::EventList::Id; -} // namespace EventList - -namespace AttributeList { -static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; -} // namespace AttributeList - -namespace FeatureMap { -static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; -} // namespace FeatureMap - -namespace ClusterRevision { -static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace DemandResponseLoadControl - namespace DoorLock { namespace Attributes { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 32355291d4c801..98343fb0762913 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -1985,310 +1985,6 @@ CHIP_ERROR DataModelLogger::LogValue( return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue( - const char * label, size_t indent, - const chip::app::Clusters::DemandResponseLoadControl::Structs::HeatingSourceControlStruct::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = LogValue("HeatingSource", indent + 1, value.heatingSource); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'HeatingSource'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} - -CHIP_ERROR DataModelLogger::LogValue( - const char * label, size_t indent, - const chip::app::Clusters::DemandResponseLoadControl::Structs::PowerSavingsControlStruct::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = LogValue("PowerSavings", indent + 1, value.powerSavings); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'PowerSavings'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} - -CHIP_ERROR DataModelLogger::LogValue( - const char * label, size_t indent, - const chip::app::Clusters::DemandResponseLoadControl::Structs::DutyCycleControlStruct::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = LogValue("DutyCycle", indent + 1, value.dutyCycle); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DutyCycle'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} - -CHIP_ERROR DataModelLogger::LogValue( - const char * label, size_t indent, - const chip::app::Clusters::DemandResponseLoadControl::Structs::AverageLoadControlStruct::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = LogValue("LoadAdjustment", indent + 1, value.loadAdjustment); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'LoadAdjustment'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} - -CHIP_ERROR DataModelLogger::LogValue( - const char * label, size_t indent, - const chip::app::Clusters::DemandResponseLoadControl::Structs::TemperatureControlStruct::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = LogValue("CoolingTempOffset", indent + 1, value.coolingTempOffset); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'CoolingTempOffset'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("HeatingtTempOffset", indent + 1, value.heatingtTempOffset); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'HeatingtTempOffset'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("CoolingTempSetpoint", indent + 1, value.coolingTempSetpoint); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'CoolingTempSetpoint'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("HeatingTempSetpoint", indent + 1, value.heatingTempSetpoint); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'HeatingTempSetpoint'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} - -CHIP_ERROR DataModelLogger::LogValue( - const char * label, size_t indent, - const chip::app::Clusters::DemandResponseLoadControl::Structs::LoadControlEventTransitionStruct::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = LogValue("Duration", indent + 1, value.duration); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Duration'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("Control", indent + 1, value.control); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Control'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("TemperatureControl", indent + 1, value.temperatureControl); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'TemperatureControl'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("AverageLoadControl", indent + 1, value.averageLoadControl); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'AverageLoadControl'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("DutyCycleControl", indent + 1, value.dutyCycleControl); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DutyCycleControl'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("PowerSavingsControl", indent + 1, value.powerSavingsControl); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'PowerSavingsControl'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("HeatingSourceControl", indent + 1, value.heatingSourceControl); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'HeatingSourceControl'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} - -CHIP_ERROR DataModelLogger::LogValue( - const char * label, size_t indent, - const chip::app::Clusters::DemandResponseLoadControl::Structs::LoadControlEventStruct::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = LogValue("EventID", indent + 1, value.eventID); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'EventID'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("ProgramID", indent + 1, value.programID); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ProgramID'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("Control", indent + 1, value.control); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Control'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("DeviceClass", indent + 1, value.deviceClass); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DeviceClass'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("EnrollmentGroup", indent + 1, value.enrollmentGroup); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'EnrollmentGroup'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("Criticality", indent + 1, value.criticality); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Criticality'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("StartTime", indent + 1, value.startTime); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'StartTime'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("Transitions", indent + 1, value.transitions); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Transitions'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} - -CHIP_ERROR DataModelLogger::LogValue( - const char * label, size_t indent, - const chip::app::Clusters::DemandResponseLoadControl::Structs::LoadControlProgramStruct::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = LogValue("ProgramID", indent + 1, value.programID); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ProgramID'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("Name", indent + 1, value.name); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Name'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("EnrollmentGroup", indent + 1, value.enrollmentGroup); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'EnrollmentGroup'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("RandomStartMinutes", indent + 1, value.randomStartMinutes); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'RandomStartMinutes'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("RandomDurationMinutes", indent + 1, value.randomDurationMinutes); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'RandomDurationMinutes'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} - CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::DoorLock::Structs::CredentialStruct::DecodableType & value) { @@ -4234,165 +3930,21 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, { DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Inactive'"); return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("State", indent + 1, value.state); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'State'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("Mask", indent + 1, value.mask); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Mask'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const OperationalState::Events::OperationalError::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = DataModelLogger::LogValue("ErrorState", indent + 1, value.errorState); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ErrorState'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const OperationalState::Events::OperationCompletion::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = DataModelLogger::LogValue("CompletionErrorCode", indent + 1, value.completionErrorCode); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CompletionErrorCode'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("TotalOperationalTime", indent + 1, value.totalOperationalTime); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TotalOperationalTime'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("PausedTime", indent + 1, value.pausedTime); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PausedTime'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const RvcOperationalState::Events::OperationalError::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = DataModelLogger::LogValue("ErrorState", indent + 1, value.errorState); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ErrorState'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const RvcOperationalState::Events::OperationCompletion::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = DataModelLogger::LogValue("CompletionErrorCode", indent + 1, value.completionErrorCode); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CompletionErrorCode'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("TotalOperationalTime", indent + 1, value.totalOperationalTime); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TotalOperationalTime'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("PausedTime", indent + 1, value.pausedTime); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PausedTime'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const BooleanSensorConfiguration::Events::AlarmsStateChanged::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = DataModelLogger::LogValue("AlarmsActive", indent + 1, value.alarmsActive); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AlarmsActive'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("AlarmsSuppressed", indent + 1, value.alarmsSuppressed); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AlarmsSuppressed'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const BooleanSensorConfiguration::Events::SensorFault::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const ValveConfigurationAndControl::Events::ValveStateChanged::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("State", indent + 1, value.state); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'State'"); + return err; + } + } { - CHIP_ERROR err = DataModelLogger::LogValue("ValveState", indent + 1, value.valveState); + CHIP_ERROR err = DataModelLogger::LogValue("Mask", indent + 1, value.mask); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ValveState'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Mask'"); return err; } } @@ -4401,14 +3953,14 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const ValveConfigurationAndControl::Events::ValveFault::DecodableType & value) + const OperationalState::Events::OperationalError::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("ValveFault", indent + 1, value.valveFault); + CHIP_ERROR err = DataModelLogger::LogValue("ErrorState", indent + 1, value.errorState); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ValveFault'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ErrorState'"); return err; } } @@ -4417,86 +3969,78 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const DemandResponseLoadControl::Events::LoadControlEventStatusChange::DecodableType & value) + const OperationalState::Events::OperationCompletion::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("EventID", indent + 1, value.eventID); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'EventID'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("TransitionIndex", indent + 1, value.transitionIndex); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TransitionIndex'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("Status", indent + 1, value.status); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Status'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("Criticality", indent + 1, value.criticality); + CHIP_ERROR err = DataModelLogger::LogValue("CompletionErrorCode", indent + 1, value.completionErrorCode); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Criticality'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CompletionErrorCode'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Control", indent + 1, value.control); + CHIP_ERROR err = DataModelLogger::LogValue("TotalOperationalTime", indent + 1, value.totalOperationalTime); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Control'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TotalOperationalTime'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("TemperatureControl", indent + 1, value.temperatureControl); + CHIP_ERROR err = DataModelLogger::LogValue("PausedTime", indent + 1, value.pausedTime); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TemperatureControl'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PausedTime'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const RvcOperationalState::Events::OperationalError::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("AverageLoadControl", indent + 1, value.averageLoadControl); + CHIP_ERROR err = DataModelLogger::LogValue("ErrorState", indent + 1, value.errorState); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AverageLoadControl'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ErrorState'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const RvcOperationalState::Events::OperationCompletion::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("DutyCycleControl", indent + 1, value.dutyCycleControl); + CHIP_ERROR err = DataModelLogger::LogValue("CompletionErrorCode", indent + 1, value.completionErrorCode); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'DutyCycleControl'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CompletionErrorCode'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("PowerSavingsControl", indent + 1, value.powerSavingsControl); + CHIP_ERROR err = DataModelLogger::LogValue("TotalOperationalTime", indent + 1, value.totalOperationalTime); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PowerSavingsControl'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TotalOperationalTime'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("HeatingSourceControl", indent + 1, value.heatingSourceControl); + CHIP_ERROR err = DataModelLogger::LogValue("PausedTime", indent + 1, value.pausedTime); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'HeatingSourceControl'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PausedTime'"); return err; } } @@ -5953,7 +5497,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("MaxFrequency", 1, value); } case LevelControl::Attributes::Options::Id: { - chip::BitMask value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Options", 1, value); } @@ -6463,16 +6007,6 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ProductAppearance", 1, value); } - case BasicInformation::Attributes::SpecificationVersion::Id: { - uint32_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("SpecificationVersion", 1, value); - } - case BasicInformation::Attributes::MaxPathsPerInvoke::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MaxPathsPerInvoke", 1, value); - } case BasicInformation::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); @@ -8604,50 +8138,45 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case Timer::Id: { + case LaundryDryerControls::Id: { switch (path.mAttributeId) { - case Timer::Attributes::SetTime::Id: { - uint32_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("SetTime", 1, value); - } - case Timer::Attributes::TimeRemaining::Id: { - uint32_t value; + case LaundryDryerControls::Attributes::SupportedDrynessLevels::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("TimeRemaining", 1, value); + return DataModelLogger::LogValue("SupportedDrynessLevels", 1, value); } - case Timer::Attributes::TimerState::Id: { - chip::app::Clusters::Timer::TimerStatusEnum value; + case LaundryDryerControls::Attributes::SelectedDrynessLevel::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("TimerState", 1, value); + return DataModelLogger::LogValue("SelectedDrynessLevel", 1, value); } - case Timer::Attributes::GeneratedCommandList::Id: { + case LaundryDryerControls::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("GeneratedCommandList", 1, value); } - case Timer::Attributes::AcceptedCommandList::Id: { + case LaundryDryerControls::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AcceptedCommandList", 1, value); } - case Timer::Attributes::EventList::Id: { + case LaundryDryerControls::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case Timer::Attributes::AttributeList::Id: { + case LaundryDryerControls::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AttributeList", 1, value); } - case Timer::Attributes::FeatureMap::Id: { + case LaundryDryerControls::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case Timer::Attributes::ClusterRevision::Id: { + case LaundryDryerControls::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -9802,235 +9331,6 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case BooleanSensorConfiguration::Id: { - switch (path.mAttributeId) - { - case BooleanSensorConfiguration::Attributes::SensitivityLevel::Id: { - chip::app::Clusters::BooleanSensorConfiguration::SensitivityEnum value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("SensitivityLevel", 1, value); - } - case BooleanSensorConfiguration::Attributes::AlarmsActive::Id: { - chip::BitMask value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AlarmsActive", 1, value); - } - case BooleanSensorConfiguration::Attributes::AlarmsSuppressed::Id: { - chip::BitMask value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AlarmsSuppressed", 1, value); - } - case BooleanSensorConfiguration::Attributes::AlarmsEnabled::Id: { - chip::BitMask value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AlarmsEnabled", 1, value); - } - case BooleanSensorConfiguration::Attributes::GeneratedCommandList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); - } - case BooleanSensorConfiguration::Attributes::AcceptedCommandList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); - } - case BooleanSensorConfiguration::Attributes::EventList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EventList", 1, value); - } - case BooleanSensorConfiguration::Attributes::AttributeList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); - } - case BooleanSensorConfiguration::Attributes::FeatureMap::Id: { - uint32_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("FeatureMap", 1, value); - } - case BooleanSensorConfiguration::Attributes::ClusterRevision::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ClusterRevision", 1, value); - } - } - break; - } - case ValveConfigurationAndControl::Id: { - switch (path.mAttributeId) - { - case ValveConfigurationAndControl::Attributes::OpenDuration::Id: { - chip::app::DataModel::Nullable value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("OpenDuration", 1, value); - } - case ValveConfigurationAndControl::Attributes::AutoCloseTime::Id: { - chip::app::DataModel::Nullable value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AutoCloseTime", 1, value); - } - case ValveConfigurationAndControl::Attributes::RemainingDuration::Id: { - chip::app::DataModel::Nullable value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("RemainingDuration", 1, value); - } - case ValveConfigurationAndControl::Attributes::CurrentState::Id: { - chip::app::DataModel::Nullable value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CurrentState", 1, value); - } - case ValveConfigurationAndControl::Attributes::TargetState::Id: { - chip::app::DataModel::Nullable value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("TargetState", 1, value); - } - case ValveConfigurationAndControl::Attributes::StartUpState::Id: { - chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("StartUpState", 1, value); - } - case ValveConfigurationAndControl::Attributes::CurrentLevel::Id: { - chip::app::DataModel::Nullable value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CurrentLevel", 1, value); - } - case ValveConfigurationAndControl::Attributes::TargetLevel::Id: { - chip::app::DataModel::Nullable value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("TargetLevel", 1, value); - } - case ValveConfigurationAndControl::Attributes::OpenLevel::Id: { - chip::app::DataModel::Nullable value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("OpenLevel", 1, value); - } - case ValveConfigurationAndControl::Attributes::ValveFault::Id: { - chip::BitMask value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ValveFault", 1, value); - } - case ValveConfigurationAndControl::Attributes::GeneratedCommandList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); - } - case ValveConfigurationAndControl::Attributes::AcceptedCommandList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); - } - case ValveConfigurationAndControl::Attributes::EventList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EventList", 1, value); - } - case ValveConfigurationAndControl::Attributes::AttributeList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); - } - case ValveConfigurationAndControl::Attributes::FeatureMap::Id: { - uint32_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("FeatureMap", 1, value); - } - case ValveConfigurationAndControl::Attributes::ClusterRevision::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ClusterRevision", 1, value); - } - } - break; - } - case DemandResponseLoadControl::Id: { - switch (path.mAttributeId) - { - case DemandResponseLoadControl::Attributes::DeviceClass::Id: { - chip::BitMask value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("DeviceClass", 1, value); - } - case DemandResponseLoadControl::Attributes::LoadControlPrograms::Id: { - chip::app::DataModel::DecodableList< - chip::app::Clusters::DemandResponseLoadControl::Structs::LoadControlProgramStruct::DecodableType> - value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("LoadControlPrograms", 1, value); - } - case DemandResponseLoadControl::Attributes::NumberOfLoadControlPrograms::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("NumberOfLoadControlPrograms", 1, value); - } - case DemandResponseLoadControl::Attributes::Events::Id: { - chip::app::DataModel::DecodableList< - chip::app::Clusters::DemandResponseLoadControl::Structs::LoadControlEventStruct::DecodableType> - value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Events", 1, value); - } - case DemandResponseLoadControl::Attributes::ActiveEvents::Id: { - chip::app::DataModel::DecodableList< - chip::app::Clusters::DemandResponseLoadControl::Structs::LoadControlEventStruct::DecodableType> - value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ActiveEvents", 1, value); - } - case DemandResponseLoadControl::Attributes::NumberOfEventsPerProgram::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("NumberOfEventsPerProgram", 1, value); - } - case DemandResponseLoadControl::Attributes::NumberOfTransistions::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("NumberOfTransistions", 1, value); - } - case DemandResponseLoadControl::Attributes::DefaultRandomStart::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("DefaultRandomStart", 1, value); - } - case DemandResponseLoadControl::Attributes::DefaultRandomDuration::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("DefaultRandomDuration", 1, value); - } - case DemandResponseLoadControl::Attributes::GeneratedCommandList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); - } - case DemandResponseLoadControl::Attributes::AcceptedCommandList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); - } - case DemandResponseLoadControl::Attributes::EventList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EventList", 1, value); - } - case DemandResponseLoadControl::Attributes::AttributeList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); - } - case DemandResponseLoadControl::Attributes::FeatureMap::Id: { - uint32_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("FeatureMap", 1, value); - } - case DemandResponseLoadControl::Attributes::ClusterRevision::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ClusterRevision", 1, value); - } - } - break; - } case DoorLock::Id: { switch (path.mAttributeId) { @@ -11011,17 +10311,17 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP switch (path.mAttributeId) { case ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::Id: { - chip::app::Clusters::ThermostatUserInterfaceConfiguration::TemperatureDisplayModeEnum value; + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("TemperatureDisplayMode", 1, value); } case ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id: { - chip::app::Clusters::ThermostatUserInterfaceConfiguration::KeypadLockoutEnum value; + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("KeypadLockout", 1, value); } case ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::Id: { - chip::app::Clusters::ThermostatUserInterfaceConfiguration::ScheduleProgrammingVisibilityEnum value; + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ScheduleProgrammingVisibility", 1, value); } @@ -15541,49 +14841,6 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip } break; } - case BooleanSensorConfiguration::Id: { - switch (header.mPath.mEventId) - { - case BooleanSensorConfiguration::Events::AlarmsStateChanged::Id: { - chip::app::Clusters::BooleanSensorConfiguration::Events::AlarmsStateChanged::DecodableType value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AlarmsStateChanged", 1, value); - } - case BooleanSensorConfiguration::Events::SensorFault::Id: { - chip::app::Clusters::BooleanSensorConfiguration::Events::SensorFault::DecodableType value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("SensorFault", 1, value); - } - } - break; - } - case ValveConfigurationAndControl::Id: { - switch (header.mPath.mEventId) - { - case ValveConfigurationAndControl::Events::ValveStateChanged::Id: { - chip::app::Clusters::ValveConfigurationAndControl::Events::ValveStateChanged::DecodableType value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ValveStateChanged", 1, value); - } - case ValveConfigurationAndControl::Events::ValveFault::Id: { - chip::app::Clusters::ValveConfigurationAndControl::Events::ValveFault::DecodableType value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ValveFault", 1, value); - } - } - break; - } - case DemandResponseLoadControl::Id: { - switch (header.mPath.mEventId) - { - case DemandResponseLoadControl::Events::LoadControlEventStatusChange::Id: { - chip::app::Clusters::DemandResponseLoadControl::Events::LoadControlEventStatusChange::DecodableType value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("LoadControlEventStatusChange", 1, value); - } - } - break; - } case DoorLock::Id: { switch (header.mPath.mEventId) {