diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index de9bd0d9f64193..7c0556faa26af0 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -122,7 +122,9 @@ jobs: src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/energy-calendar-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/measurement-and-sensing.xml \ + src/app/zap-templates/zcl/data-model/chip/meter-identification-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/microwave-oven-mode-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml \ @@ -204,6 +206,8 @@ jobs: src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/electrical-energy-measurement-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/electrical-power-measurement-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/meter-identification-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/energy-calendar-cluster.xml \ " - name: Build Apps run: | diff --git a/data_model/clusters/EnergyCalendar.xml b/data_model/clusters/EnergyCalendar.xml new file mode 100644 index 00000000000000..75db315f49fcf0 --- /dev/null +++ b/data_model/clusters/EnergyCalendar.xml @@ -0,0 +1,287 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/MeterIdentification.xml b/data_model/clusters/MeterIdentification.xml new file mode 100644 index 00000000000000..1ed47d5d3da3af --- /dev/null +++ b/data_model/clusters/MeterIdentification.xml @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/zap_clusters.md b/docs/zap_clusters.md index 7651e35b784ed1..4806931ac70e59 100644 --- a/docs/zap_clusters.md +++ b/docs/zap_clusters.md @@ -83,6 +83,7 @@ Generally regenerate using one of: | 151 | 0x97 | Messages | | 152 | 0x98 | DeviceEnergyManagement | | 153 | 0x99 | EnergyEvse | +| 154 | 0x9A | EnergyCalendar | | 155 | 0x9B | EnergyPreference | | 156 | 0x9C | PowerTopology | | 157 | 0x9D | EnergyEvseMode | @@ -131,6 +132,7 @@ Generally regenerate using one of: | 1295 | 0x50F | ContentControl | | 1296 | 0x510 | ContentAppObserver | | 2820 | 0xB04 | ElectricalMeasurement | +| 2822 | 0xB06 | MeterIdentification | | 4294048773 | 0xFFF1FC05 | UnitTesting | | 4294048774 | 0xFFF1FC06 | FaultInjection | | 4294048800 | 0xFFF1FC20 | SampleMei | diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 5400a81d0fb902..3a98130f254822 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -4467,6 +4467,91 @@ cluster EnergyEvse = 153 { timed command ClearTargets(): DefaultSuccess = 7; } +/** */ +cluster EnergyCalendar = 154 { + revision 3; + + enum PeakPeriodSeverityEnum : enum8 { + kUnused = 0; + kLow = 1; + kMedium = 2; + kHigh = 3; + } + + bitmap AuxiliaryLoadBitmap : bitmap8 { + kAuxiliarySwitch1 = 0x1; + kAuxiliarySwitch2 = 0x2; + kAuxiliarySwitch3 = 0x4; + kAuxiliarySwitch4 = 0x8; + kAuxiliarySwitch5 = 0x10; + kAuxiliarySwitch6 = 0x20; + kAuxiliarySwitch7 = 0x40; + kAuxiliarySwitch8 = 0x80; + } + + bitmap Feature : bitmap32 { + kPricingTier = 0x1; + kFriendlyCredit = 0x2; + kAuxiliaryLoad = 0x4; + kPeakPeriod = 0x8; + } + + bitmap TransitionDayOfWeekBitmap : bitmap8 { + kSunday = 0x1; + kMonday = 0x2; + kTuesday = 0x4; + kWednesday = 0x8; + kThursday = 0x10; + kFriday = 0x20; + kSaturday = 0x40; + } + + struct TransitionStruct { + int16u transitionTime = 0; + optional int32u priceTier = 1; + optional boolean friendlyCredit = 2; + optional AuxiliaryLoadBitmap auxiliaryLoad = 3; + } + + struct DayStruct { + optional date date = 0; + optional TransitionDayOfWeekBitmap daysOfWeek = 1; + TransitionStruct transitions[] = 2; + optional int32u calendarID = 3; + } + + struct CalendarPeriodStruct { + nullable epoch_s startDate = 0; + DayStruct days[] = 1; + } + + struct PeakPeriodStruct { + PeakPeriodSeverityEnum severity = 0; + int16u peakPeriod = 1; + nullable epoch_s startTime = 2; + nullable epoch_s endTime = 3; + } + + readonly attribute nullable int32u calendarID = 0; + readonly attribute nullable char_string<12> name = 1; + readonly attribute nullable int32u providerID = 2; + readonly attribute nullable int32u eventID = 3; + readonly attribute nullable epoch_s startDate = 4; + readonly attribute nullable CalendarPeriodStruct calendarPeriods[] = 5; + readonly attribute nullable DayStruct specialDays[] = 6; + readonly attribute nullable DayStruct currentDay = 7; + readonly attribute nullable DayStruct nextDay = 8; + readonly attribute nullable TransitionStruct currentTransition = 9; + readonly attribute optional nullable PeakPeriodStruct currentPeakPeriod = 10; + readonly attribute optional nullable PeakPeriodStruct nextPeakPeriod = 11; + 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; +} + /** This cluster provides an interface to specify preferences for how devices should consume energy. */ provisional cluster EnergyPreference = 155 { revision 1; @@ -6686,6 +6771,39 @@ deprecated cluster ElectricalMeasurement = 2820 { command GetMeasurementProfileCommand(GetMeasurementProfileCommandRequest): DefaultSuccess = 1; } +/** */ +cluster MeterIdentification = 2822 { + revision 1; + + enum MeterTypeEnum : enum8 { + kUtility = 0; + kPrivate = 1; + kGeneric = 2; + } + + enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; + } + + bitmap Feature : bitmap32 { + kPowerThreshold = 0x1; + } + + readonly attribute nullable MeterTypeEnum meterType = 0; + readonly attribute nullable char_string<16> utilityName = 1; + readonly attribute nullable char_string<16> pointOfDelivery = 2; + readonly attribute optional nullable power_mw powerThreshold = 3; + readonly attribute optional nullable PowerThresholdSourceEnum powerThresholdSource = 4; + 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; +} + /** The Test Cluster is meant to validate the generated code */ internal cluster UnitTesting = 4294048773 { revision 1; // NOTE: Default/not specifically set @@ -8407,6 +8525,11 @@ endpoint 1 { handle command ClearTargets; } + server cluster EnergyCalendar { + callback attribute featureMap; + ram attribute clusterRevision default = 1; + } + server cluster EnergyPreference { callback attribute energyBalances; ram attribute currentEnergyBalance; @@ -8974,6 +9097,11 @@ endpoint 1 { ram attribute clusterRevision default = 3; } + server cluster MeterIdentification { + callback attribute featureMap; + ram attribute clusterRevision default = 1; + } + server cluster UnitTesting { emits event TestEvent; emits event TestFabricScopedEvent; diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index f0afbd78296bd2..930b03c1fc0394 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -14232,6 +14232,240 @@ } ] }, + { + "name": "Energy Calendar", + "code": 154, + "mfgCode": null, + "define": "ENERGY_CALENDAR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "CalendarID", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Name", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ProviderID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventID", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartDate", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "epoch_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CalendarPeriods", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SpecialDays", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentDay", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "DayStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NextDay", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "DayStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentTransition", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "TransitionStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentPeakPeriod", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "PeakPeriodStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NextPeakPeriod", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "PeakPeriodStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Energy Preference", "code": 155, @@ -21739,6 +21973,128 @@ } ] }, + { + "name": "Meter Identification", + "code": 2822, + "mfgCode": null, + "define": "METER_IDENTIFICATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "MeterType", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "MeterTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UtilityName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PointOfDelivery", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PowerThreshold", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PowerThresholdSource", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "PowerThresholdSourceEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Unit Testing", "code": 4294048773, diff --git a/examples/all-clusters-app/all-clusters-common/include/energy-calendar-instance.h b/examples/all-clusters-app/all-clusters-common/include/energy-calendar-instance.h new file mode 100644 index 00000000000000..fdcdfae10c4f02 --- /dev/null +++ b/examples/all-clusters-app/all-clusters-common/include/energy-calendar-instance.h @@ -0,0 +1,94 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace EnergyCalendar { + +/** @brief + * CalendarProvider is interface of the Calendar Provider + */ +class CalendarProviderInstance : public CalendarProvider +{ +public: + CalendarProviderInstance() : CalendarProvider(1) {} + CalendarProviderInstance(EndpointId ep) : CalendarProvider(ep) {} + ~CalendarProviderInstance(); + + void Init(void); + + void SetDefault(void); + + CHIP_ERROR LoadJson(Json::Value & root); + + /* owerride */ + CHIP_ERROR GetDays(EndpointId ep, DataModel::Nullable & CurrentDay, + DataModel::Nullable & NextDay) override; + +private: + uint32_t mDate; + uint32_t mTime; + + // Attributes contaners allocated memory + DataModel::Nullable mName; + DataModel::List mCalendarPeriods; + DataModel::List mSpecialDays; + Structs::DayStruct::Type mCurrentDay; + Structs::DayStruct::Type mNextDay; + + DataModel::Nullable GetDay(uint32_t date); + bool CheckSpecialDays(); + bool CheckDay(const Structs::DayStruct::Type & day); + bool CheckPeriods(); + + void JsonToCalendarPeriodStruct(Json::Value & root, Structs::CalendarPeriodStruct::Type & value); + void JsonToDayStruct(Json::Value & root, Structs::DayStruct::Type & value); + void JsonToPeakPeriodStruct(Json::Value & root, Structs::PeakPeriodStruct::Type & value); + + void JsonToCalendarPeriodStructList(Json::Value & root, DataModel::List & value); + void JsonToDayStructList(Json::Value & root, DataModel::List & value); + void JsonToTransitionStructList(Json::Value & root, DataModel::List & value); + + void FreeMemoryDayStruct(Structs::DayStruct::Type & value); + void FreeMemoryDayStructList(DataModel::List & value); + void FreeMemoryCalendarPeriodStruct(Structs::CalendarPeriodStruct::Type & value); + void FreeMemoryCalendarPeriodStructList(DataModel::List & value); +}; + +CalendarProviderInstance * GetProvider(); + +} // namespace EnergyCalendar +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/all-clusters-app/all-clusters-common/src/energy-calendar-instance.cpp b/examples/all-clusters-app/all-clusters-common/src/energy-calendar-instance.cpp new file mode 100644 index 00000000000000..0202f29744cd7e --- /dev/null +++ b/examples/all-clusters-app/all-clusters-common/src/energy-calendar-instance.cpp @@ -0,0 +1,572 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include + +#include "energy-calendar-instance.h" + +using namespace chip; +using namespace chip::app; +using namespace chip::app::DataModel; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::EnergyCalendar; +using namespace chip::app::Clusters::EnergyCalendar::Attributes; + +constexpr uint32_t kOneDay = 24 * 60 * 60; + +static TransitionDayOfWeekBitmap GetWeekDate(uint32_t date) +{ + tm calendarTime{}; + time_t dt = date; + localtime_r(&dt, &calendarTime); + return (TransitionDayOfWeekBitmap) (calendarTime.tm_wday); +} + +static uint32_t GetCurrentDateTime(void) +{ + System::Clock::Timestamp time = System::SystemClock().GetMonotonicTimestamp(); + using cast = std::chrono::duration; + uint64_t msec = std::chrono::duration_cast(time).count(); + + return static_cast(msec / 1000); +} + +chip::app::Clusters::EnergyCalendar::CalendarProviderInstance::~CalendarProviderInstance() +{ + FreeMemoryCalendarPeriodStructList(mCalendarPeriods); + FreeMemoryDayStructList(mSpecialDays); + FreeMemoryDayStruct(mCurrentDay); + FreeMemoryDayStruct(mNextDay); + if (!mName.IsNull()) + { + chip::Platform::MemoryFree((void *) mName.Value().data()); + mName.SetNull(); + } +} + +void CalendarProviderInstance::Init(void) +{ + SetDefault(); +} + +void CalendarProviderInstance::SetDefault(void) +{ + uint32_t date = GetCurrentDateTime(); + uint32_t time = date % kOneDay; + date -= time; + + Structs::DayStruct::Type day = { .date = {}, + .transitions = { +// { .transitionTime = 0, .PriceTier = 10}, +// { .transitionTime = 1000, .PriceTier = 20} + }, + .calendarID = chip::Optional(123) }; + + Structs::TransitionStruct::Type * buffer = + (Structs::TransitionStruct::Type *) chip::Platform::MemoryCalloc(2, sizeof(Structs::TransitionStruct::Type)); + + day.transitions = Span(buffer, 2); + buffer[0].transitionTime = 0; + buffer[0].priceTier.SetValue(10); + buffer[1].transitionTime = 1000; + buffer[1].priceTier.SetValue(20); + + Structs::PeakPeriodStruct::Type peak = { + .severity = PeakPeriodSeverityEnum::kHigh, .peakPeriod = 100, .startTime = 2000, .endTime = 2200 + }; + + // DataModel::List calendarPeriods = {}; + // DataModel::List specialDays = {}; + + char * str = (char *) chip::Platform::MemoryAlloc(5); + memcpy(str, "Test", 5); + CharSpan nameString(str, 5); + mName = MakeNullable(static_cast(nameString)); + + SetCommonAttributes(1, mName, 123, 1); + SetCalendarPeriod(date, mCalendarPeriods); + SetSpecialDays(mSpecialDays); + SetCurrentAndNextDays(DataModel::MakeNullable(day), DataModel::MakeNullable(day)); + SetPeakPeriods(DataModel::MakeNullable(peak), DataModel::MakeNullable(peak)); +} + +CHIP_ERROR CalendarProviderInstance::LoadJson(Json::Value & root) +{ + DataModel::Nullable calendarID; + DataModel::Nullable providerID; + DataModel::Nullable eventID; + DataModel::Nullable startDate; + Structs::PeakPeriodStruct::Type currentPeak; + Structs::PeakPeriodStruct::Type nextPeak; + + Json::Value value = root.get("CalendarID", Json::Value()); + if (!value.empty() && value.isInt()) + { + calendarID.SetNonNull(value.asInt()); + } + + value = root.get("Name", Json::Value()); + if (!mName.IsNull()) + { + chip::Platform::MemoryFree((void *) mName.Value().data()); + mName.SetNull(); + } + if (!value.empty() && value.isString()) + { + size_t len = value.asString().size() + 1; + char * str = (char *) chip::Platform::MemoryAlloc(len); + memcpy(str, value.asCString(), len); + CharSpan nameString(str, len); + mName = MakeNullable(static_cast(nameString)); + } + + value = root.get("ProviderID", Json::Value()); + if (!value.empty() && value.isInt()) + { + providerID.SetNonNull(value.asInt()); + } + + value = root.get("EventID", Json::Value()); + if (!value.empty() && value.isInt()) + { + eventID.SetNonNull(value.asInt()); + } + + SetCommonAttributes(calendarID, mName, providerID, eventID); + + value = root.get("StartDate", Json::Value()); + if (!value.empty() && value.isInt()) + { + startDate.SetNonNull(value.asInt()); + } + + value = root.get("CalendarPeriods", Json::Value()); + FreeMemoryCalendarPeriodStructList(mCalendarPeriods); + if (!value.empty() && value.isArray()) + { + JsonToCalendarPeriodStructList(value, mCalendarPeriods); + } + SetCalendarPeriod(startDate, mCalendarPeriods); + + value = root.get("SpecialDays", Json::Value()); + FreeMemoryDayStructList(mSpecialDays); + if (!value.empty() && value.isArray()) + { + JsonToDayStructList(value, mSpecialDays); + } + SetSpecialDays(mSpecialDays); + + value = root.get("CurrentDay", Json::Value()); + FreeMemoryDayStruct(mCurrentDay); + if (!value.empty()) + { + JsonToDayStruct(value, mCurrentDay); + } + + value = root.get("NextDay", Json::Value()); + FreeMemoryDayStruct(mNextDay); + if (!value.empty()) + { + JsonToDayStruct(value, mNextDay); + } + + SetCurrentAndNextDays(mCurrentDay, mNextDay); + + value = root.get("CurrentPeak", Json::Value()); + if (!value.empty()) + { + JsonToPeakPeriodStruct(value, currentPeak); + } + + value = root.get("NextPeak", Json::Value()); + if (!value.empty()) + { + JsonToPeakPeriodStruct(value, nextPeak); + } + + SetPeakPeriods(currentPeak, nextPeak); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR CalendarProviderInstance::GetDays(EndpointId ep, DataModel::Nullable & CurrentDay, + DataModel::Nullable & NextDay) +{ + CurrentDay = mCurrentDay; + NextDay = mNextDay; + + return CHIP_NO_ERROR; +} + +DataModel::Nullable CalendarProviderInstance::GetDay(uint32_t date) +{ + for (auto & day : mSpecialDays) + { + if (day.date.HasValue() && day.date.Value() == date) + { + return day; + } + } + + TransitionDayOfWeekBitmap week_day = GetWeekDate(date); + + for (auto & period : mCalendarPeriods) + { + if (!period.startDate.IsNull() && period.startDate.Value() < date) + continue; + for (auto & day : period.days) + { + if ((day.daysOfWeek.HasValue() && (day.daysOfWeek.Value().GetField(week_day))) || + (day.date.HasValue() && (day.date.Value() == date))) + { + return day; + } + } + } + + return DataModel::Nullable(); +} + +#if 0 +CHIP_ERROR EnergyCalendarContent::UpdateDateRelativeAttributes() +{ + uint32_t date = get_current_utc(); + //uint32_t time = date % kOneDay; + //date -= time; + + if ((currentDate <= date) && (date < currentDate + kOneDay)) + { + return CHIP_NO_ERROR; + } + + currentDate = date; + CurrentDay = nullptr; + NextDay = nullptr; + CurrentTransition = nullptr; + //CurrentPeakPeriod = nullptr; + //NextPeakPeriod = nullptr; + + CurrentDay = EnergyCalendarContent::GetDay(date); + if (!CurrentDay.IsNull()) + { + auto &day = CurrentDay.Value(); + currentDate = day.Date; + auto transition_iterator = day.Transitions.begin(); + uint32_t next_tr_time = kOneDay; + + while (transition_iterator.Next()) + { + auto & transition = transition_iterator.GetValue(); + auto tr_time = transition.TransitionTime; + if (tr_time <= time && (CurrentTransition == nullptr || CurrentTransition.TransitionTime < tr_time)) + { + CurrentTransition = transition; + } + if ((time > tr_time) && (time < next_tr_time)) + { + next_tr_time = time; + } + } + + //CurrentPeakPeriod.Value() = DayToPeak(day); + } + + NextDay = EnergyCalendarContent::GetDay(date + kOneDay); + //if (!NextDay.IsNull()) + //{ + // NexytPeakPeriod.Value() = DayToPeak(NextDay.Value()); + //} + + return CHIP_NO_ERROR; +} + +#endif + +bool CalendarProviderInstance::CheckPeriods() +{ + uint32_t date = 0; + for (auto & period : mCalendarPeriods) + { + if (!period.startDate.IsNull()) + { + if (period.startDate.Value() < date) + { + return false; + } + date = period.startDate.Value(); + } + + for (auto & day : period.days) + { + if (!CheckDay(day)) + { + return false; + } + } + } + + return true; +} + +bool CalendarProviderInstance::CheckSpecialDays() +{ + uint32_t date = 0; + for (auto & day : mSpecialDays) + { + if (!day.daysOfWeek.HasValue() || !day.calendarID.HasValue() || !CheckDay(day) || day.date.HasValue() || + day.date.Value() > date) + { + return false; + } + date = day.date.Value(); + } + + return true; +} + +bool CalendarProviderInstance::CheckDay(const Structs::DayStruct::Type & day) +{ + if ((day.daysOfWeek.HasValue() && day.date.HasValue()) || (!day.daysOfWeek.HasValue() && !day.date.HasValue())) + { + return false; + } + + if (day.transitions.size() == 0) + { + return false; + } + + uint32_t time = 0; + for (auto & transition : day.transitions) + { + auto tr_time = transition.transitionTime; + if (tr_time < time) + { + return false; + } + time = tr_time; + } + + return true; +} + +void CalendarProviderInstance::JsonToCalendarPeriodStruct(Json::Value & root, Structs::CalendarPeriodStruct::Type & value) +{ + Json::Value t = root.get("startDate", Json::Value()); + if (!t.empty() && t.isInt()) + { + value.startDate.SetNonNull(t.asInt()); + } + + t = root.get("days", Json::Value()); + if (!t.empty() && t.isArray()) + { + DataModel::List * days = (DataModel::List *) &value.days; + JsonToDayStructList(t, *days); + } +} + +void CalendarProviderInstance::JsonToDayStruct(Json::Value & root, Structs::DayStruct::Type & value) +{ + Json::Value t = root.get("date", Json::Value()); + if (!t.empty() && t.isInt()) + { + value.date.SetValue(t.asInt()); + } + + t = root.get("daysOfWeek", Json::Value()); + if (!t.empty() && t.isInt()) + { + value.daysOfWeek.SetValue(chip::BitMask((uint8_t) t.asInt())); + } + + t = root.get("transitions", Json::Value()); + if (!t.empty() && t.isArray()) + { + DataModel::List * transitions = + (DataModel::List *) &value.transitions; + JsonToTransitionStructList(t, *transitions); + } + + t = root.get("calendarID", Json::Value()); + if (!t.empty() && t.isInt()) + { + value.calendarID.SetValue(t.asInt()); + } +} + +void CalendarProviderInstance::JsonToPeakPeriodStruct(Json::Value & root, Structs::PeakPeriodStruct::Type & value) +{ + Json::Value t = root.get("severity", Json::Value()); + if (!t.empty() && t.isInt()) + { + value.severity = static_cast(t.asInt()); + } + + t = root.get("peakPeriod", Json::Value()); + if (!t.empty() && t.isInt()) + { + value.peakPeriod = static_cast(t.asInt()); + } + + t = root.get("startTime", Json::Value()); + if (!t.empty() && t.isInt()) + { + value.startTime.SetNonNull(t.asInt()); + } + + t = root.get("endTime", Json::Value()); + if (!t.empty() && t.isInt()) + { + value.endTime.SetNonNull(t.asInt()); + } +} + +void CalendarProviderInstance::JsonToCalendarPeriodStructList(Json::Value & root, + DataModel::List & value) +{ + Structs::CalendarPeriodStruct::Type * buffer = (Structs::CalendarPeriodStruct::Type *) chip::Platform::MemoryCalloc( + root.size(), sizeof(Structs::CalendarPeriodStruct::Type)); + + value = Span(buffer, root.size()); + + for (Json::ArrayIndex i = 0; i < root.size(); ++i) + { + Json::Value v = root[i]; + JsonToCalendarPeriodStruct(root[i], value[i]); + } +} + +void CalendarProviderInstance::JsonToDayStructList(Json::Value & root, DataModel::List & value) +{ + Structs::DayStruct::Type * buffer = + (Structs::DayStruct::Type *) chip::Platform::MemoryCalloc(root.size(), sizeof(Structs::DayStruct::Type)); + + value = Span(buffer, root.size()); + + for (Json::ArrayIndex i = 0; i < root.size(); ++i) + { + Json::Value v = root[i]; + JsonToDayStruct(root[i], value[i]); + } +} + +void CalendarProviderInstance::JsonToTransitionStructList(Json::Value & root, + DataModel::List & value) +{ + Structs::TransitionStruct::Type * buffer = + (Structs::TransitionStruct::Type *) chip::Platform::MemoryCalloc(root.size(), sizeof(Structs::TransitionStruct::Type)); + + value = Span(buffer, root.size()); + + for (Json::ArrayIndex i = 0; i < root.size(); ++i) + { + Json::Value v = root[i]; + + Json::Value t = v.get("transitionTime", Json::Value()); + if (!t.empty() && t.isInt()) + { + value[i].transitionTime = static_cast(t.asInt()); + } + + t = v.get("priceTier", Json::Value()); + if (!t.empty() && t.isInt()) + { + value[i].priceTier.SetValue(t.asInt()); + } + + t = v.get("friendlyCredit", Json::Value()); + if (!t.empty() && t.isBool()) + { + value[i].friendlyCredit.SetValue(t.asBool()); + } + + t = v.get("auxiliaryLoad", Json::Value()); + if (!t.empty() && t.isInt()) + { + value[i].auxiliaryLoad.SetValue(chip::BitMask((uint8_t) t.asInt())); + } + } +} + +void CalendarProviderInstance::FreeMemoryDayStruct(Structs::DayStruct::Type & value) +{ + DataModel::List tmp; + std::swap(tmp, value.transitions); + chip::Platform::MemoryFree((void *) tmp.data()); +} + +void CalendarProviderInstance::FreeMemoryDayStructList(DataModel::List & value) +{ + for (auto & item : value) + { + FreeMemoryDayStruct(item); + } + chip::Platform::MemoryFree(value.data()); + value = Span(); +} + +void CalendarProviderInstance::FreeMemoryCalendarPeriodStruct(Structs::CalendarPeriodStruct::Type & value) +{ + for (auto & item : value.days) + { + Structs::DayStruct::Type * day = (Structs::DayStruct::Type *) &item; + FreeMemoryDayStruct(*day); + } + + DataModel::List tmp; + std::swap(tmp, value.days); + chip::Platform::MemoryFree((void *) tmp.data()); +} + +void CalendarProviderInstance::FreeMemoryCalendarPeriodStructList(DataModel::List & value) +{ + for (auto & item : value) + { + FreeMemoryCalendarPeriodStruct(item); + } + chip::Platform::MemoryFree(value.data()); + value = Span(); +} + +static std::unique_ptr gMIDelegate; +static std::unique_ptr gMIInstance; + +void emberAfEnergyCalendarClusterInitCallback(chip::EndpointId endpointId) +{ + VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. + VerifyOrDie(!gMIInstance); + + gMIDelegate = std::make_unique(endpointId); + if (gMIDelegate) + { + gMIDelegate->Init(); + + gMIInstance = std::make_unique(BitMask( + Feature::kPricingTier, Feature::kFriendlyCredit, Feature::kAuxiliaryLoad, Feature::kPeakPeriod)); + + gMIInstance->AddCalendarProvider(&(*gMIDelegate)); + } +} + +CalendarProviderInstance * chip::app::Clusters::EnergyCalendar::GetProvider() +{ + return &(*gMIDelegate); +} diff --git a/examples/all-clusters-app/all-clusters-common/src/meter-identification-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/meter-identification-stub.cpp new file mode 100644 index 00000000000000..b75172951946a4 --- /dev/null +++ b/examples/all-clusters-app/all-clusters-common/src/meter-identification-stub.cpp @@ -0,0 +1,49 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using namespace chip; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::MeterIdentification; +using Feature = chip::app::Clusters::MeterIdentification::Feature; + +static std::unique_ptr gMIDelegate; +static std::unique_ptr gMIInstance; + +void emberAfMeterIdentificationClusterInitCallback(chip::EndpointId endpointId) +{ + VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. + VerifyOrDie(!gMIInstance); + + gMIDelegate = std::make_unique(); + if (gMIDelegate) + { + gMIDelegate->Init(); + + gMIInstance = std::make_unique(endpointId, *gMIDelegate, + BitMask(Feature::kPowerThreshold)); + + gMIInstance->Init(); + } +} + +MeterIdentificationDelegate * chip::app::Clusters::MeterIdentification::GetDelegate() +{ + return &(*gMIDelegate); +} diff --git a/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp b/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp index 8effe6426cc49d..bc70767a252094 100644 --- a/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp +++ b/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp @@ -28,6 +28,8 @@ #include #include +#include "energy-calendar-instance.h" +#include #include #include #include @@ -190,6 +192,14 @@ void AllClustersAppCommandHandler::HandleCommand(intptr_t context) std::string operation = self->mJsonValue["Operation"].asString(); self->OnOperationalStateChange(device, operation, self->mJsonValue["Param"]); } + else if (name == "EnergyCalendar") + { + self->OnEnergyCalendarHandler(self->mJsonValue); + } + else if (name == "MeterIdentification") + { + self->OnMeterIdentificationHandler(self->mJsonValue); + } else { ChipLogError(NotSpecified, "Unhandled command: Should never happens"); @@ -495,6 +505,18 @@ void AllClustersAppCommandHandler::OnOperationalStateChange(std::string device, } } +void AllClustersAppCommandHandler::OnEnergyCalendarHandler(Json::Value param) +{ + EnergyCalendar::CalendarProviderInstance * provider = EnergyCalendar::GetProvider(); + provider->LoadJson(param); +} + +void AllClustersAppCommandHandler::OnMeterIdentificationHandler(Json::Value param) +{ + MeterIdentification::MeterIdentificationDelegate * delegate = MeterIdentification::GetDelegate(); + delegate->LoadJson(param); +} + void AllClustersAppCommandHandler::OnAirQualityChange(uint32_t aNewValue) { AirQuality::Instance * airQualityInstance = AirQuality::GetInstance(); diff --git a/examples/all-clusters-app/linux/AllClustersCommandDelegate.h b/examples/all-clusters-app/linux/AllClustersCommandDelegate.h index f097c539b54fb6..042b53bd4d7b61 100644 --- a/examples/all-clusters-app/linux/AllClustersCommandDelegate.h +++ b/examples/all-clusters-app/linux/AllClustersCommandDelegate.h @@ -105,6 +105,16 @@ class AllClustersAppCommandHandler * Should be called when it is necessary to change the operational state as a manual operation. */ void OnOperationalStateChange(std::string device, std::string operation, Json::Value param); + + /** + * Should be called when it is necessary to change one or some attributes. + */ + void OnEnergyCalendarHandler(Json::Value param); + + /** + * Should be called when it is necessary to change one or some attributes. + */ + void OnMeterIdentificationHandler(Json::Value param); }; class AllClustersCommandDelegate : public NamedPipeCommandDelegate diff --git a/examples/all-clusters-app/linux/BUILD.gn b/examples/all-clusters-app/linux/BUILD.gn index 3d52ef748de90d..ce71836a757aa5 100644 --- a/examples/all-clusters-app/linux/BUILD.gn +++ b/examples/all-clusters-app/linux/BUILD.gn @@ -39,12 +39,14 @@ source_set("chip-all-clusters-common") { "${chip_root}/examples/all-clusters-app/all-clusters-common/src/dishwasher-mode.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/electrical-energy-measurement-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/electrical-power-measurement-stub.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/energy-calendar-instance.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/energy-preference-delegate.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/laundry-dryer-controls-delegate-impl.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/laundry-washer-controls-delegate-impl.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/laundry-washer-mode.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/meter-identification-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/microwave-oven-mode.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/operational-state-delegate-impl.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/oven-modes.cpp", @@ -63,6 +65,7 @@ source_set("chip-all-clusters-common") { "${chip_root}/examples/energy-management-app/energy-management-common/src/ElectricalPowerMeasurementDelegate.cpp", "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp", "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/MeterIdentificationDelegate.cpp", "${chip_root}/examples/energy-management-app/energy-management-common/src/device-energy-management-mode.cpp", "${chip_root}/examples/energy-management-app/energy-management-common/src/energy-evse-mode.cpp", "AllClustersCommandDelegate.cpp", diff --git a/examples/energy-management-app/energy-management-common/include/MeterIdentificationDelegate.h b/examples/energy-management-app/energy-management-common/include/MeterIdentificationDelegate.h new file mode 100644 index 00000000000000..a9a03e90ba8700 --- /dev/null +++ b/examples/energy-management-app/energy-management-common/include/MeterIdentificationDelegate.h @@ -0,0 +1,91 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include +#include +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace MeterIdentification { + +class MeterIdentificationDelegate : public MeterIdentification::Delegate +{ +public: + ~MeterIdentificationDelegate() = default; + + void Init(); + + CHIP_ERROR LoadJson(Json::Value & root); + + // Attribute Accessors + + DataModel::Nullable GetMeterType() override { return mMeterType; }; + CharSpan GetUtilityName() override { return mUtilityName; }; + CharSpan GetPointOfDelivery() override { return mPointOfDelivery; }; + DataModel::Nullable GetPowerThreshold() override { return mPowerThreshold; }; + DataModel::Nullable GetPowerThresholdSource() override { return mPowerThresholdSource; }; + + // Internal Application API to set attribute values + CHIP_ERROR SetMeterType(DataModel::Nullable); + CHIP_ERROR SetUtilityName(CharSpan value); + CHIP_ERROR SetPointOfDelivery(CharSpan value); + CHIP_ERROR SetPowerThreshold(DataModel::Nullable); + CHIP_ERROR SetPowerThresholdSource(DataModel::Nullable); + +private: + // Attribute storage + DataModel::Nullable mMeterType; + CharSpan mUtilityName; + CharSpan mPointOfDelivery; + DataModel::Nullable mPowerThreshold; + DataModel::Nullable mPowerThresholdSource; +}; + +class MeterIdentificationInstance : public Instance +{ +public: + MeterIdentificationInstance(EndpointId aEndpointId, MeterIdentificationDelegate & aDelegate, Feature aFeature) : + MeterIdentification::Instance(aEndpointId, aDelegate, aFeature) + { + mDelegate = &aDelegate; + } + + // Delete copy constructor and assignment operator. + MeterIdentificationInstance(const MeterIdentificationInstance &) = delete; + MeterIdentificationInstance(const MeterIdentificationInstance &&) = delete; + MeterIdentificationInstance & operator=(const MeterIdentificationInstance &) = delete; + + CHIP_ERROR Init(); + void Shutdown(); + + MeterIdentificationDelegate * GetDelegate() { return mDelegate; }; + +private: + MeterIdentificationDelegate * mDelegate; +}; + +MeterIdentificationDelegate * GetDelegate(); + +} // namespace MeterIdentification +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/energy-management-app/energy-management-common/src/MeterIdentificationDelegate.cpp b/examples/energy-management-app/energy-management-common/src/MeterIdentificationDelegate.cpp new file mode 100644 index 00000000000000..986130bd99ee34 --- /dev/null +++ b/examples/energy-management-app/energy-management-common/src/MeterIdentificationDelegate.cpp @@ -0,0 +1,214 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::DataModel; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::MeterIdentification; +using namespace chip::app::Clusters::MeterIdentification::Attributes; + +using chip::app::Clusters::MeterIdentification::MeterTypeEnum; +using chip::app::Clusters::MeterIdentification::PowerThresholdSourceEnum; + +CHIP_ERROR MeterIdentificationInstance::Init() +{ + return Instance::Init(); +} + +void MeterIdentificationInstance::Shutdown() +{ + Instance::Shutdown(); +} + +// --------------- Internal Attribute Set APIs + +void MeterIdentificationDelegate::Init() +{ + ChipLogProgress(Zcl, "MeterIdentificationDelegate::Init"); + + SetMeterType(MeterTypeEnum::kPrivate); + SetUtilityName(CharSpan::fromCharString("Test Utility Name")); + SetPointOfDelivery(CharSpan::fromCharString("Test PointOfDelivery")); + SetPowerThreshold(100); + SetPowerThresholdSource(PowerThresholdSourceEnum::kEquipment); +} + +CHIP_ERROR MeterIdentificationDelegate::LoadJson(Json::Value & root) +{ + Json::Value value = root.get("MeterType", Json::Value()); + if (!value.empty()) + { + if(value.isInt()) + { + SetMeterType(static_cast(value.asInt())); + } + else + { + SetMeterType(std::nullopt); + } + } + + value = root.get("UtilityName", Json::Value()); + if (!value.empty()) + { + if(value.isString()) + { + SetUtilityName(CharSpan::fromCharString(value.asCString())); + } + else + { + SetUtilityName(CharSpan()); + } + } + + value = root.get("PointOfDelivery", Json::Value()); + if (!value.empty()) + { + if(value.isString()) + { + SetPointOfDelivery(CharSpan::fromCharString(value.asCString())); + } + else + { + SetPointOfDelivery(CharSpan()); + } + } + + value = root.get("PowerThreshold", Json::Value()); + if (!value.empty()) + { + if(value.isInt()) + { + SetPowerThreshold(value.asInt()); + } + else + { + SetPowerThreshold(std::nullopt); + } + } + + value = root.get("PowerThresholdSource", Json::Value()); + if (!value.empty()) + { + if(value.isInt()) + { + SetPowerThresholdSource(static_cast(value.asInt())); + } + else + { + SetPowerThresholdSource(std::nullopt); + } + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR MeterIdentificationDelegate::SetMeterType(DataModel::Nullable newValue) +{ + // DataModel::Nullable oldValue = mMeterType; + + mMeterType = newValue; + // if (oldValue != newValue) + //{ + MatterReportingAttributeChangeCallback(mEndpointId, MeterIdentification::Id, MeterType::Id); + // } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR MeterIdentificationDelegate::SetUtilityName(CharSpan newValue) +{ + // CharSpan oldValue = mUtilityName; + + chip::Platform::MemoryFree((void*)mUtilityName.data()); + if (!newValue.empty()) + { + size_t len = newValue.size(); + char *str = (char*)chip::Platform::MemoryAlloc(len); + memcpy(str, newValue.data(), len); + mUtilityName = CharSpan(str, len); + } + else + { + mUtilityName = CharSpan(); + } + + // if (!oldValue.data_equal(newValue)) + //{ + // MatterReportingAttributeChangeCallback(mEndpointId, MeterIdentification::Id, UtilityName::Id); + // } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR MeterIdentificationDelegate::SetPointOfDelivery(CharSpan newValue) +{ + // CharSpan oldValue = mPointOfDelivery; + + chip::Platform::MemoryFree((void*)mPointOfDelivery.data()); + if (!newValue.empty()) + { + size_t len = newValue.size(); + char *str = (char*)chip::Platform::MemoryAlloc(len); + memcpy(str, newValue.data(), len); + mPointOfDelivery = CharSpan(str, len); + } + else + { + mPointOfDelivery = CharSpan(); + } + + // if (!oldValue.data_equal(newValue)) + //{ + // MatterReportingAttributeChangeCallback(mEndpointId, MeterIdentification::Id, PointOfDelivery::Id); + // } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR MeterIdentificationDelegate::SetPowerThreshold(DataModel::Nullable newValue) +{ + // DataModel::Nullable oldValue = mPowerThreshold; + + mPowerThreshold = newValue; + // if (oldValue != newValue) + //{ + // MatterReportingAttributeChangeCallback(mEndpointId, MeterIdentification::Id, PowerThreshold::Id); + // } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR MeterIdentificationDelegate::SetPowerThresholdSource(DataModel::Nullable newValue) +{ + // DataModel::Nullable oldValue = mPowerThresholdSource; + + mPowerThresholdSource = newValue; + // if (oldValue != newValue) + //{ + // MatterReportingAttributeChangeCallback(mEndpointId, MeterIdentification::Id, PowerThresholdSource::Id); + // } + + return CHIP_NO_ERROR; +} diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/large_all_clusters_app/cpp-app/cluster-init-callback.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/large_all_clusters_app/cpp-app/cluster-init-callback.cpp index 8144c53c404e9f..78b2327f80e5cd 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/large_all_clusters_app/cpp-app/cluster-init-callback.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/large_all_clusters_app/cpp-app/cluster-init-callback.cpp @@ -64,6 +64,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case app::Clusters::DoorLock::Id: emberAfDoorLockClusterInitCallback(endpoint); break; + case app::Clusters::EnergyCalendar::Id: + emberAfEnergyCalendarClusterInitCallback(endpoint); + break; case app::Clusters::ElectricalMeasurement::Id: emberAfElectricalMeasurementClusterInitCallback(endpoint); break; @@ -121,6 +124,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case app::Clusters::MediaPlayback::Id: emberAfMediaPlaybackClusterInitCallback(endpoint); break; + case app::Clusters::MeterIdentification::Id: + emberAfMeterIdentificationClusterInitCallback(endpoint); + break; case app::Clusters::ModeSelect::Id: emberAfModeSelectClusterInitCallback(endpoint); break; diff --git a/scripts/rules.matterlint b/scripts/rules.matterlint index 335e37436be00c..0495da8aac2837 100644 --- a/scripts/rules.matterlint +++ b/scripts/rules.matterlint @@ -29,7 +29,9 @@ load "../src/app/zap-templates/zcl/data-model/chip/device-energy-management-mode load "../src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/energy-calendar-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/measurement-and-sensing.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/meter-identification-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/microwave-oven-mode-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml"; diff --git a/src/app/clusters/energy-calendar-server/energy-calendar-server.cpp b/src/app/clusters/energy-calendar-server/energy-calendar-server.cpp new file mode 100644 index 00000000000000..04afab9f4618cc --- /dev/null +++ b/src/app/clusters/energy-calendar-server/energy-calendar-server.cpp @@ -0,0 +1,367 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "energy-calendar-server.h" + +#include +#include +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::DataModel; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::EnergyCalendar; +using namespace chip::app::Clusters::EnergyCalendar::Attributes; + +namespace chip { +namespace app { +namespace Clusters { +namespace EnergyCalendar { + +constexpr uint32_t kSecInOneDay = 60 * 60 * 24; + +#if 0 +static TransitionDayOfWeekBitmap GetWeekDate(uint32_t date) +{ + tm calendarTime{}; + time_t tm = date; + localtime_r(&tm, &calendarTime); + return (TransitionDayOfWeekBitmap)(calendarTime.tm_wday); +} +#endif + +static uint32_t GetCurrentTime(void) +{ + System::Clock::Timestamp time = System::SystemClock().GetMonotonicTimestamp(); + using cast = std::chrono::duration; + uint64_t msec = std::chrono::duration_cast(time).count(); + + uint32_t sec = static_cast((msec / 1000) % kSecInOneDay); + return sec; +} + +void LockThreadTask(void) +{ + chip::DeviceLayer::ThreadStackMgr().LockThreadStack(); +} + +void UnlockThreadTask(void) +{ + chip::DeviceLayer::ThreadStackMgr().UnlockThreadStack(); +} + +CHIP_ERROR CalendarProvider::SetCommonAttributes(DataModel::Nullable CalendarID, DataModel::Nullable Name, + DataModel::Nullable ProviderID, DataModel::Nullable EventID) +{ + bool change; + + change = _calendarID != CalendarID; + if (change) + { + _calendarID.SetNonNull(*CalendarID); + // MatterReportingAttributeChangeCallback(_endpoint, EnergyCalendar::Id, CalendarID::Id); + } + + change = true; // Name != _name; + if (change) + { + _name.SetNonNull(*Name); + // MatterReportingAttributeChangeCallback(_endpoint, EnergyCalendar::Id, Name::Id); + } + + change = ProviderID != _providerID; + if (change) + { + _providerID.SetNonNull(*ProviderID); + // MatterReportingAttributeChangeCallback(_endpoint, EnergyCalendar::Id, ProviderID::Id); + } + + change = EventID != _eventID; + if (change) + { + _eventID.SetNonNull(*EventID); + // MatterReportingAttributeChangeCallback(_endpoint, EnergyCalendar::Id, EventID::Id); + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR CalendarProvider::SetCalendarPeriod(DataModel::Nullable StartDate, + DataModel::List CalendarPeriods) +{ + bool change; + + LockThreadTask(); + + change = StartDate != _startDate; + if (change) + { + _startDate.SetNonNull(*StartDate); + // MatterReportingAttributeChangeCallback(_endpoint, EnergyCalendar::Id, StartDate::Id); + } + + _calendarPeriods = CalendarPeriods; + // MatterReportingAttributeChangeCallback(_endpoint, EnergyCalendar::Id, CalendarPeriods::Id); + + UnlockThreadTask(); + return CHIP_NO_ERROR; +} + +CHIP_ERROR CalendarProvider::SetSpecialDays(DataModel::List SpecialDays) +{ + LockThreadTask(); + + _specialDays = SpecialDays; + // MatterReportingAttributeChangeCallback(_endpoint, EnergyCalendar::Id, SpecialDays::Id); + + UnlockThreadTask(); + return CHIP_NO_ERROR; +} + +CHIP_ERROR CalendarProvider::SetCurrentAndNextDays(DataModel::Nullable CurrentDay, + DataModel::Nullable NextDay) +{ + bool change; + + LockThreadTask(); + + change = true; // *CurrentDay != *_currentDay; + if (change) + { + _currentDay.SetNonNull(*CurrentDay); + // MatterReportingAttributeChangeCallback(_endpoint, EnergyCalendar::Id, CurrentDay::Id); + } + + change = true; // *NextDay != *_nextDay; + if (change) + { + _nextDay.SetNonNull(*NextDay); + // MatterReportingAttributeChangeCallback(_endpoint, EnergyCalendar::Id, NextDay::Id); + } + + UnlockThreadTask(); + return CHIP_NO_ERROR; +} + +CHIP_ERROR CalendarProvider::SetPeakPeriods(DataModel::Nullable CurrentPeakPeriod, + DataModel::Nullable NextPeakPeriod) +{ + bool change; + LockThreadTask(); + + change = true; // CurrentPeakPeriod != _currentPeakPeriod; + if (change) + { + _currentPeakPeriod.SetNonNull(*CurrentPeakPeriod); + // MatterReportingAttributeChangeCallback(_endpoint, EnergyCalendar::Id, CurrentPeakPeriod::Id); + } + + change = true; // NextPeakPeriod != _nextPeakPeriod; + if (change) + { + _nextPeakPeriod.SetNonNull(*NextPeakPeriod); + // MatterReportingAttributeChangeCallback(_endpoint, EnergyCalendar::Id, NextPeakPeriod::Id); + } + + UnlockThreadTask(); + return CHIP_NO_ERROR; +} + +CHIP_ERROR CalendarProvider::UpdateDays(void) +{ + CHIP_ERROR status; + DataModel::Nullable currentDay; + DataModel::Nullable nextDay; + + status = GetDays(_endpoint, currentDay, nextDay); + if (status == CHIP_NO_ERROR) + { + status = SetCurrentAndNextDays(currentDay, nextDay); + } + + return status; +} + +EnergyCalendarServer::EnergyCalendarServer() : AttributeAccessInterface(NullOptional, EnergyCalendar::Id), feature(0) +{ + uint32_t time = GetCurrentTime(); + + chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds16(kSecInOneDay - time), MidnightTimerCallback, this); +} + +EnergyCalendarServer::EnergyCalendarServer(Feature aFeature) : + AttributeAccessInterface(NullOptional, EnergyCalendar::Id), feature(aFeature) +{ + uint32_t time = GetCurrentTime(); + + chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds16(kSecInOneDay - time), MidnightTimerCallback, this); +} + +bool EnergyCalendarServer::HasFeature(Feature aFeature) const +{ + return feature.Has(aFeature); +} + +CHIP_ERROR EnergyCalendarServer::AddCalendarProvider(CalendarProvider * provider) +{ + for (auto i = 0; i < kNumSupportedEndpoints; ++i) + { + if (calendars[i] == nullptr) + { + calendars[i] = provider; + return CHIP_NO_ERROR; + } + } + return CHIP_ERROR_NO_MEMORY; +} + +CalendarProvider * EnergyCalendarServer::GetProvider(EndpointId ep) +{ + for (auto i = 0; i < kNumSupportedEndpoints; ++i) + { + if (calendars[i] != nullptr && calendars[i]->endpoint() == ep) + { + return calendars[i]; + } + } + return nullptr; +} + +DataModel::Nullable EnergyCalendarServer::GetTransition(EndpointId ep) +{ + CalendarProvider * provider = GetProvider(ep); + if (provider == nullptr || provider->GetCurrentDay().IsNull()) + { + return DataModel::Nullable(); + } + + Structs::DayStruct::Type & currentDay = provider->GetCurrentDay().Value(); + + uint32_t time = GetCurrentTime(); + + auto transition = currentDay.transitions.begin(); + uint32_t next_tr_time = kSecInOneDay; + + const Structs::TransitionStruct::Type * current = nullptr; + + while (transition != currentDay.transitions.end()) + { + auto tr_time = transition->transitionTime; + if (tr_time <= time && (current == nullptr || current->transitionTime < tr_time)) + { + current = transition; + } + if ((time > tr_time) && (time < next_tr_time)) + { + next_tr_time = time; + } + } + return DataModel::Nullable(*current); +} + +// AttributeAccessInterface +CHIP_ERROR EnergyCalendarServer::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +{ + CalendarProvider * provider = GetProvider(aPath.mEndpointId); + switch (aPath.mAttributeId) + { + case CalendarID::Id: + return aEncoder.Encode(provider->GetCalendarID()); + case Name::Id: + return aEncoder.Encode(provider->GetName()); + /* case ProviderID::Id: + return aEncoder.Encode(provider->GetProviderID()); + case EventID::Id: + return aEncoder.Encode(provider->GetEventID()); + case StartDate::Id: + return aEncoder.Encode(provider->GetStartDate()); + case CalendarPeriods::Id: + return aEncoder.Encode(provider->GetCalendarPeriods()); + case SpecialDays::Id: + return aEncoder.Encode(provider->GetSpecialDays()); + */ /* Date relative attributes */ + /* case CurrentDay::Id: + return aEncoder.Encode(provider->GetCurrentDay()); + case NextDay::Id: + return aEncoder.Encode(provider->GetNextDay()); + case CurrentTransition::Id: + return aEncoder.Encode(GetTransition(aPath.mEndpointId)); + case CurrentPeakPeriod::Id: + return aEncoder.Encode(provider->GetCurrentPeakPeriod()); + case NextPeakPeriod::Id: + return aEncoder.Encode(provider->GetNextPeakPeriod()); + */ + /* FeatureMap - is held locally */ + case FeatureMap::Id: + return aEncoder.Encode(feature); + } + + /* Allow all other unhandled attributes to fall through to Ember */ + return CHIP_NO_ERROR; +} + +CHIP_ERROR EnergyCalendarServer::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) +{ + switch (aPath.mAttributeId) + { + default: + // Unknown attribute; return error. None of the other attributes for + // this cluster are writable, so should not be ending up in this code to + // start with. + return CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute); + } +} + +// void EnergyCalendarServer::InvokeCommand(HandlerContext & handlerContext) +//{ +// //using namespace Commands; +// +// //switch (handlerContext.mRequestPath.mCommandId) +// //{ +// //} +// return; +// } + +void EnergyCalendarServer::MidnightTimerCallback(chip::System::Layer *, void * callbackContext) +{ + EnergyCalendarServer * instance = (EnergyCalendarServer *) callbackContext; + + for (int i = 0; i < kNumSupportedEndpoints; ++i) + { + if (instance->calendars[i] != nullptr) + { + instance->calendars[i]->UpdateDays(); + } + } + + uint32_t time = GetCurrentTime(); + chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds16(kSecInOneDay - time), MidnightTimerCallback, + callbackContext); +} + +} // namespace EnergyCalendar +} // namespace Clusters +} // namespace app +} // namespace chip + +// ----------------------------------------------------------------------------- +// Plugin initialization + +void MatterEnergyCalendarPluginServerInitCallback() {} diff --git a/src/app/clusters/energy-calendar-server/energy-calendar-server.h b/src/app/clusters/energy-calendar-server/energy-calendar-server.h new file mode 100644 index 00000000000000..7c9ab868dd05f7 --- /dev/null +++ b/src/app/clusters/energy-calendar-server/energy-calendar-server.h @@ -0,0 +1,142 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace EnergyCalendar { + +// Spec-defined constants +constexpr uint32_t kMaximumNameLenght = 12; +constexpr uint32_t kMinimumCalendarPeriodsLength = 1; +constexpr uint32_t kMaximumCalendarPeriodsLength = 4; +constexpr uint32_t kMaximumSpecialDaysLength = 50; + +constexpr int kNumSupportedEndpoints = 1; + +/** @brief + * CalendarProvider is interface of the Calendar Provider + */ +class CalendarProvider +{ +public: + CalendarProvider(EndpointId ep) : _endpoint(ep) {} + virtual ~CalendarProvider() = default; + + EndpointId endpoint() const { return _endpoint; }; + + CHIP_ERROR SetCommonAttributes(DataModel::Nullable CalendarID, DataModel::Nullable Name, + DataModel::Nullable ProviderID, DataModel::Nullable EventID); + + CHIP_ERROR SetCalendarPeriod(DataModel::Nullable StartDate, + DataModel::List CalendarPeriods); + + CHIP_ERROR SetSpecialDays(DataModel::List SpecialDays); + + CHIP_ERROR SetCurrentAndNextDays(DataModel::Nullable CurrentDay, + DataModel::Nullable NextDay); + + CHIP_ERROR SetPeakPeriods(DataModel::Nullable CurrentPeakPeriod, + DataModel::Nullable NextPeakPeriod); + + CHIP_ERROR UpdateDays(void); + + virtual CHIP_ERROR GetDays(EndpointId ep, DataModel::Nullable & CurrentDay, + DataModel::Nullable & NextDay) = 0; + + DataModel::Nullable GetCalendarID(void) { return _calendarID; } + DataModel::Nullable GetName(void) { return _name; } + DataModel::Nullable GetProviderID(void) { return _providerID; } + DataModel::Nullable GetEventID(void) { return _eventID; } + DataModel::Nullable GetStartDate(void) { return _startDate; } + DataModel::List GetCalendarPeriods(void) { return _calendarPeriods; } + DataModel::List GetSpecialDays(void) { return _specialDays; } + DataModel::Nullable GetCurrentDay(void) { return _currentDay; } + DataModel::Nullable GetNextDay(void) { return _nextDay; } + // DataModel::Nullable GetCurrentTransition(_void); + DataModel::Nullable GetCurrentPeakPeriod(void) { return _currentPeakPeriod; } + DataModel::Nullable GetNextPeakPeriod(void) { return _nextPeakPeriod; } + +private: + EndpointId _endpoint; + + DataModel::Nullable _calendarID; + DataModel::Nullable _name; + DataModel::Nullable _providerID; + DataModel::Nullable _eventID; + DataModel::Nullable _startDate; + DataModel::List _calendarPeriods; + DataModel::List _specialDays; + DataModel::Nullable _currentDay; + DataModel::Nullable _nextDay; + // Structs::TransitionStruct::Type _currentTransition; + DataModel::Nullable _currentPeakPeriod; + DataModel::Nullable _nextPeakPeriod; +}; + +/** @brief + * EnergyCalendarServer implements both Attributes and Commands + */ +class EnergyCalendarServer : public AttributeAccessInterface +{ +public: + EnergyCalendarServer(); + EnergyCalendarServer(Feature aFeature); + + bool HasFeature(Feature aFeature) const; + + CHIP_ERROR AddCalendarProvider(CalendarProvider * provider); + + //(...) + // Attributes + CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; + + // Commands + // void InvokeCommand(HandlerContext & ctx) override; + +private: + BitMask feature; + CalendarProvider * calendars[kNumSupportedEndpoints] = { 0 }; + + void UpdateCurrentAttrs(void); + CalendarProvider * GetProvider(EndpointId ep); + DataModel::Nullable GetTransition(EndpointId ep); + + static void MidnightTimerCallback(chip::System::Layer *, void * callbackContext); +}; + +} // namespace EnergyCalendar +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/meter-identification-server/meter-identification-server.cpp b/src/app/clusters/meter-identification-server/meter-identification-server.cpp new file mode 100644 index 00000000000000..cb5e11951f1ffe --- /dev/null +++ b/src/app/clusters/meter-identification-server/meter-identification-server.cpp @@ -0,0 +1,118 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "meter-identification-server.h" + +#include + +#include +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::DataModel; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::MeterIdentification; +using namespace chip::app::Clusters::MeterIdentification::Attributes; + +using chip::Protocols::InteractionModel::Status; + +namespace chip { +namespace app { +namespace Clusters { +namespace MeterIdentification { + +CHIP_ERROR Instance::Init() +{ + VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); + return CHIP_NO_ERROR; +} + +void Instance::Shutdown() +{ + unregisterAttributeAccessOverride(this); +} + +bool Instance::HasFeature(Feature aFeature) const +{ + return mFeature.Has(aFeature); +} + +// static CHIP_ERROR EncodeStringOnSuccess(CHIP_ERROR status, AttributeValueEncoder & encoder, const char * buf, size_t maxBufSize) +//{ +// ReturnErrorOnFailure(status); +// return encoder.Encode(chip::CharSpan(buf, strnlen(buf, maxBufSize))); +// } + +// AttributeAccessInterface +CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +{ + ChipLogProgress(Zcl, "Meter Ind read attr %d", aPath.mAttributeId); + switch (aPath.mAttributeId) + { + case FeatureMap::Id: + ReturnErrorOnFailure(aEncoder.Encode(mFeature)); + break; + case MeterType::Id: + ReturnErrorOnFailure(aEncoder.Encode(mDelegate.GetMeterType())); + break; + + case UtilityName::Id: + ReturnErrorOnFailure(aEncoder.Encode(mDelegate.GetUtilityName())); + break; + + case PointOfDelivery::Id: + ReturnErrorOnFailure(aEncoder.Encode(mDelegate.GetPointOfDelivery())); + break; + + case PowerThreshold::Id: + ReturnErrorOnFailure(aEncoder.Encode(mDelegate.GetPowerThreshold())); + break; + + case PowerThresholdSource::Id: + ReturnErrorOnFailure(aEncoder.Encode(mDelegate.GetPowerThresholdSource())); + break; + } + return CHIP_NO_ERROR; +} + +CHIP_ERROR Instance::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) +{ + /* + + switch (aPath.mAttributeId) + { + + default: + break; + } + */ + return CHIP_NO_ERROR; +} + +} // namespace MeterIdentification +} // namespace Clusters +} // namespace app +} // namespace chip + +// ----------------------------------------------------------------------------- +// Plugin initialization + +void MatterMeterIdentificationPluginServerInitCallback() {} diff --git a/src/app/clusters/meter-identification-server/meter-identification-server.h b/src/app/clusters/meter-identification-server/meter-identification-server.h new file mode 100644 index 00000000000000..08adef122aae2c --- /dev/null +++ b/src/app/clusters/meter-identification-server/meter-identification-server.h @@ -0,0 +1,84 @@ +/** + * + * Copyright (c) 2024 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include + +#include +#include +#include +#include +#include + +using chip::app::Clusters::MeterIdentification::MeterTypeEnum; +using chip::app::Clusters::MeterIdentification::PowerThresholdSourceEnum; +using Feature = chip::app::Clusters::MeterIdentification::Feature; + +namespace chip { +namespace app { +namespace Clusters { +namespace MeterIdentification { + +struct Delegate +{ +public: + virtual ~Delegate() = default; + + void SetEndpointId(EndpointId aEndpoint) { mEndpointId = aEndpoint; } + + virtual DataModel::Nullable GetMeterType() = 0; + virtual CharSpan GetUtilityName() = 0; + virtual CharSpan GetPointOfDelivery() = 0; + virtual DataModel::Nullable GetPowerThreshold() = 0; + virtual DataModel::Nullable GetPowerThresholdSource() = 0; + +protected: + EndpointId mEndpointId = 0; +}; + +class Instance : public AttributeAccessInterface +{ +public: + Instance(EndpointId aEndpointId, Delegate & aDelegate, BitMask aFeature) : + AttributeAccessInterface(MakeOptional(aEndpointId), Id), mDelegate(aDelegate), mFeature(aFeature) + { + /* set the base class delegates endpointId */ + mDelegate.SetEndpointId(aEndpointId); + } + ~Instance() { Shutdown(); } + + CHIP_ERROR Init(); + void Shutdown(); + + bool HasFeature(Feature aFeature) const; + +private: + Delegate & mDelegate; + BitMask mFeature; + + // AttributeAccessInterface + CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; +}; + +} // namespace MeterIdentification +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/zap-templates/zcl/data-model/all.xml b/src/app/zap-templates/zcl/data-model/all.xml index 23709faca1ace5..df83054511e0af 100644 --- a/src/app/zap-templates/zcl/data-model/all.xml +++ b/src/app/zap-templates/zcl/data-model/all.xml @@ -112,6 +112,8 @@ + + diff --git a/src/app/zap-templates/zcl/data-model/chip/energy-calendar-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/energy-calendar-cluster.xml new file mode 100644 index 00000000000000..404b91048d0dd3 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/energy-calendar-cluster.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Energy Management + Energy Calendar + 0x009A + ENERGY_CALENDAR_CLUSTER + + true + + + + + + + + + + + + + + + true + + CalendarID + Name + ProviderID + EventID + StartDate + CalendarPeriods + SpecialDays + CurrentDay + NextDay + CurrentTransition + CurrentPeakPeriod + NextPeakPeriod + + diff --git a/src/app/zap-templates/zcl/data-model/chip/meter-identification-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/meter-identification-cluster.xml new file mode 100644 index 00000000000000..ec84fa77a5c0ee --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/meter-identification-cluster.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + Energy Management + Meter Identification + 0x0B06 + METER_IDENTIFICATION_CLUSTER + + true + + + + + + true + + MeterType + UtilityName + PointOfDelivery + PowerThreshold + PowerThresholdSource + + diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index b253dd55e72831..94c076d606becb 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -44,6 +44,8 @@ "dishwasher-alarm-cluster.xml", "dishwasher-mode-cluster.xml", "drlc-cluster.xml", + "energy-calendar-cluster.xml", + "meter-identification-cluster.xml", "microwave-oven-mode-cluster.xml", "microwave-oven-control-cluster.xml", "door-lock-cluster.xml", @@ -637,6 +639,13 @@ "NeutralCurrent", "FeatureMap" ], + "Energy Calendar": [ + "CurrentDay", + "NextDay", + "CurrentTransition", + "CurrentPeakPeriod", + "NextPeakPeriod" + ], "Power Topology": ["FeatureMap"], "Valve Configuration and Control": ["RemainingDuration"], "Boolean State Configuration": ["CurrentSensitivityLevel"], diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 6b361e507a3cf3..fc44c7b519cc0a 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -42,6 +42,8 @@ "diagnostic-logs-cluster.xml", "dishwasher-alarm-cluster.xml", "dishwasher-mode-cluster.xml", + "energy-calendar-cluster.xml", + "meter-identification-cluster.xml", "microwave-oven-mode-cluster.xml", "door-lock-cluster.xml", "drlc-cluster.xml", @@ -635,6 +637,13 @@ "NeutralCurrent", "FeatureMap" ], + "Energy Calendar": [ + "CurrentDay", + "NextDay", + "CurrentTransition", + "CurrentPeakPeriod", + "NextPeakPeriod" + ], "Power Topology": ["FeatureMap"], "Valve Configuration and Control": ["RemainingDuration"], "Boolean State Configuration": ["CurrentSensitivityLevel"], diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index 4c7757224b1a7d..985459b333306d 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -34,6 +34,8 @@ "DIAGNOSTIC_LOGS_CLUSTER": [], "DISHWASHER_ALARM_CLUSTER": [], "DISHWASHER_MODE_CLUSTER": [], + "ENERGY_CALENDAR_CLUSTER": [], + "METER_IDENTIFICATION_CLUSTER": [], "MICROWAVE_OVEN_MODE_CLUSTER": [], "DOOR_LOCK_CLUSTER": [], "ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER": [], @@ -179,6 +181,8 @@ "DIAGNOSTIC_LOGS_CLUSTER": ["diagnostic-logs-server"], "DISHWASHER_ALARM_CLUSTER": ["dishwasher-alarm-server"], "DISHWASHER_MODE_CLUSTER": ["mode-base-server"], + "ENERGY_CALENDAR_CLUSTER": ["energy-calendar-server"], + "METER_IDENTIFICATION_CLUSTER": ["meter-identification-server"], "MICROWAVE_OVEN_MODE_CLUSTER": ["mode-base-server"], "DOOR_LOCK_CLUSTER": ["door-lock-server"], "ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER": [ diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index a8567d591b1f7a..f74b2da8a5b9b4 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -4999,6 +4999,91 @@ cluster EnergyEvse = 153 { timed command ClearTargets(): DefaultSuccess = 7; } +/** */ +cluster EnergyCalendar = 154 { + revision 3; + + enum PeakPeriodSeverityEnum : enum8 { + kUnused = 0; + kLow = 1; + kMedium = 2; + kHigh = 3; + } + + bitmap AuxiliaryLoadBitmap : bitmap8 { + kAuxiliarySwitch1 = 0x1; + kAuxiliarySwitch2 = 0x2; + kAuxiliarySwitch3 = 0x4; + kAuxiliarySwitch4 = 0x8; + kAuxiliarySwitch5 = 0x10; + kAuxiliarySwitch6 = 0x20; + kAuxiliarySwitch7 = 0x40; + kAuxiliarySwitch8 = 0x80; + } + + bitmap Feature : bitmap32 { + kPricingTier = 0x1; + kFriendlyCredit = 0x2; + kAuxiliaryLoad = 0x4; + kPeakPeriod = 0x8; + } + + bitmap TransitionDayOfWeekBitmap : bitmap8 { + kSunday = 0x1; + kMonday = 0x2; + kTuesday = 0x4; + kWednesday = 0x8; + kThursday = 0x10; + kFriday = 0x20; + kSaturday = 0x40; + } + + struct TransitionStruct { + int16u transitionTime = 0; + optional int32u priceTier = 1; + optional boolean friendlyCredit = 2; + optional AuxiliaryLoadBitmap auxiliaryLoad = 3; + } + + struct DayStruct { + optional date date = 0; + optional TransitionDayOfWeekBitmap daysOfWeek = 1; + TransitionStruct transitions[] = 2; + optional int32u calendarID = 3; + } + + struct CalendarPeriodStruct { + nullable epoch_s startDate = 0; + DayStruct days[] = 1; + } + + struct PeakPeriodStruct { + PeakPeriodSeverityEnum severity = 0; + int16u peakPeriod = 1; + nullable epoch_s startTime = 2; + nullable epoch_s endTime = 3; + } + + readonly attribute nullable int32u calendarID = 0; + readonly attribute nullable char_string<12> name = 1; + readonly attribute nullable int32u providerID = 2; + readonly attribute nullable int32u eventID = 3; + readonly attribute nullable epoch_s startDate = 4; + readonly attribute nullable CalendarPeriodStruct calendarPeriods[] = 5; + readonly attribute nullable DayStruct specialDays[] = 6; + readonly attribute nullable DayStruct currentDay = 7; + readonly attribute nullable DayStruct nextDay = 8; + readonly attribute nullable TransitionStruct currentTransition = 9; + readonly attribute optional nullable PeakPeriodStruct currentPeakPeriod = 10; + readonly attribute optional nullable PeakPeriodStruct nextPeakPeriod = 11; + 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; +} + /** This cluster provides an interface to specify preferences for how devices should consume energy. */ provisional cluster EnergyPreference = 155 { revision 1; @@ -9275,6 +9360,39 @@ deprecated cluster ElectricalMeasurement = 2820 { command GetMeasurementProfileCommand(GetMeasurementProfileCommandRequest): DefaultSuccess = 1; } +/** */ +cluster MeterIdentification = 2822 { + revision 1; + + enum MeterTypeEnum : enum8 { + kUtility = 0; + kPrivate = 1; + kGeneric = 2; + } + + enum PowerThresholdSourceEnum : enum8 { + kContract = 0; + kRegulator = 1; + kEquipment = 2; + } + + bitmap Feature : bitmap32 { + kPowerThreshold = 0x1; + } + + readonly attribute nullable MeterTypeEnum meterType = 0; + readonly attribute nullable char_string<16> utilityName = 1; + readonly attribute nullable char_string<16> pointOfDelivery = 2; + readonly attribute optional nullable power_mw powerThreshold = 3; + readonly attribute optional nullable PowerThresholdSourceEnum powerThresholdSource = 4; + 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; +} + /** The Test Cluster is meant to validate the generated code */ internal cluster UnitTesting = 4294048773 { revision 1; // NOTE: Default/not specifically set diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 4b762e1ef39f37..0e5759d7ee7851 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -32689,14 +32689,21 @@ public void onSuccess(byte[] tlv) { } } - public static class EnergyPreferenceCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 155L; - - private static final long ENERGY_BALANCES_ATTRIBUTE_ID = 0L; - private static final long CURRENT_ENERGY_BALANCE_ATTRIBUTE_ID = 1L; - private static final long ENERGY_PRIORITIES_ATTRIBUTE_ID = 2L; - private static final long LOW_POWER_MODE_SENSITIVITIES_ATTRIBUTE_ID = 3L; - private static final long CURRENT_LOW_POWER_MODE_SENSITIVITY_ATTRIBUTE_ID = 4L; + public static class EnergyCalendarCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 154L; + + private static final long CALENDAR_I_D_ATTRIBUTE_ID = 0L; + private static final long NAME_ATTRIBUTE_ID = 1L; + private static final long PROVIDER_I_D_ATTRIBUTE_ID = 2L; + private static final long EVENT_I_D_ATTRIBUTE_ID = 3L; + private static final long START_DATE_ATTRIBUTE_ID = 4L; + private static final long CALENDAR_PERIODS_ATTRIBUTE_ID = 5L; + private static final long SPECIAL_DAYS_ATTRIBUTE_ID = 6L; + private static final long CURRENT_DAY_ATTRIBUTE_ID = 7L; + private static final long NEXT_DAY_ATTRIBUTE_ID = 8L; + private static final long CURRENT_TRANSITION_ATTRIBUTE_ID = 9L; + private static final long CURRENT_PEAK_PERIOD_ATTRIBUTE_ID = 10L; + private static final long NEXT_PEAK_PERIOD_ATTRIBUTE_ID = 11L; private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; @@ -32704,7 +32711,7 @@ public static class EnergyPreferenceCluster extends BaseChipCluster { private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; - public EnergyPreferenceCluster(long devicePtr, int endpointId) { + public EnergyCalendarCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId, CLUSTER_ID); } @@ -32714,16 +32721,52 @@ public long initWithDevice(long devicePtr, int endpointId) { return 0L; } - public interface EnergyBalancesAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); + public interface CalendarIDAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Long value); } - public interface EnergyPrioritiesAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); + public interface NameAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable String value); } - public interface LowPowerModeSensitivitiesAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); + public interface ProviderIDAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Long value); + } + + public interface EventIDAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Long value); + } + + public interface StartDateAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Long value); + } + + public interface CalendarPeriodsAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable List value); + } + + public interface SpecialDaysAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable List value); + } + + public interface CurrentDayAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable ChipStructs.EnergyCalendarClusterDayStruct value); + } + + public interface NextDayAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable ChipStructs.EnergyCalendarClusterDayStruct value); + } + + public interface CurrentTransitionAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable ChipStructs.EnergyCalendarClusterTransitionStruct value); + } + + public interface CurrentPeakPeriodAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable ChipStructs.EnergyCalendarClusterPeakPeriodStruct value); + } + + public interface NextPeakPeriodAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable ChipStructs.EnergyCalendarClusterPeakPeriodStruct value); } public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { @@ -32742,152 +32785,316 @@ public interface AttributeListAttributeCallback extends BaseAttributeCallback { void onSuccess(List value); } - public void readEnergyBalancesAttribute( - EnergyBalancesAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ENERGY_BALANCES_ATTRIBUTE_ID); + public void readCalendarIDAttribute( + CalendarIDAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CALENDAR_I_D_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ENERGY_BALANCES_ATTRIBUTE_ID, true); + }, CALENDAR_I_D_ATTRIBUTE_ID, true); } - public void subscribeEnergyBalancesAttribute( - EnergyBalancesAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ENERGY_BALANCES_ATTRIBUTE_ID); + public void subscribeCalendarIDAttribute( + CalendarIDAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CALENDAR_I_D_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ENERGY_BALANCES_ATTRIBUTE_ID, minInterval, maxInterval); + }, CALENDAR_I_D_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readCurrentEnergyBalanceAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_ENERGY_BALANCE_ATTRIBUTE_ID); + public void readNameAttribute( + NameAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NAME_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, CURRENT_ENERGY_BALANCE_ATTRIBUTE_ID, true); + }, NAME_ATTRIBUTE_ID, true); } - public void writeCurrentEnergyBalanceAttribute(DefaultClusterCallback callback, Integer value) { - writeCurrentEnergyBalanceAttribute(callback, value, 0); + public void subscribeNameAttribute( + NameAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NAME_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NAME_ATTRIBUTE_ID, minInterval, maxInterval); } - public void writeCurrentEnergyBalanceAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), CURRENT_ENERGY_BALANCE_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + public void readProviderIDAttribute( + ProviderIDAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PROVIDER_I_D_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, PROVIDER_I_D_ATTRIBUTE_ID, true); } - public void subscribeCurrentEnergyBalanceAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_ENERGY_BALANCE_ATTRIBUTE_ID); + public void subscribeProviderIDAttribute( + ProviderIDAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PROVIDER_I_D_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, CURRENT_ENERGY_BALANCE_ATTRIBUTE_ID, minInterval, maxInterval); + }, PROVIDER_I_D_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readEnergyPrioritiesAttribute( - EnergyPrioritiesAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ENERGY_PRIORITIES_ATTRIBUTE_ID); + public void readEventIDAttribute( + EventIDAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_I_D_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ENERGY_PRIORITIES_ATTRIBUTE_ID, true); + }, EVENT_I_D_ATTRIBUTE_ID, true); } - public void subscribeEnergyPrioritiesAttribute( - EnergyPrioritiesAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ENERGY_PRIORITIES_ATTRIBUTE_ID); + public void subscribeEventIDAttribute( + EventIDAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_I_D_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ENERGY_PRIORITIES_ATTRIBUTE_ID, minInterval, maxInterval); + }, EVENT_I_D_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readLowPowerModeSensitivitiesAttribute( - LowPowerModeSensitivitiesAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LOW_POWER_MODE_SENSITIVITIES_ATTRIBUTE_ID); + public void readStartDateAttribute( + StartDateAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, START_DATE_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, LOW_POWER_MODE_SENSITIVITIES_ATTRIBUTE_ID, true); + }, START_DATE_ATTRIBUTE_ID, true); } - public void subscribeLowPowerModeSensitivitiesAttribute( - LowPowerModeSensitivitiesAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LOW_POWER_MODE_SENSITIVITIES_ATTRIBUTE_ID); + public void subscribeStartDateAttribute( + StartDateAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, START_DATE_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, LOW_POWER_MODE_SENSITIVITIES_ATTRIBUTE_ID, minInterval, maxInterval); + }, START_DATE_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readCurrentLowPowerModeSensitivityAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_LOW_POWER_MODE_SENSITIVITY_ATTRIBUTE_ID); + public void readCalendarPeriodsAttribute( + CalendarPeriodsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CALENDAR_PERIODS_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, CURRENT_LOW_POWER_MODE_SENSITIVITY_ATTRIBUTE_ID, true); + }, CALENDAR_PERIODS_ATTRIBUTE_ID, true); } - public void writeCurrentLowPowerModeSensitivityAttribute(DefaultClusterCallback callback, Integer value) { - writeCurrentLowPowerModeSensitivityAttribute(callback, value, 0); + public void subscribeCalendarPeriodsAttribute( + CalendarPeriodsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CALENDAR_PERIODS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CALENDAR_PERIODS_ATTRIBUTE_ID, minInterval, maxInterval); } - public void writeCurrentLowPowerModeSensitivityAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), CURRENT_LOW_POWER_MODE_SENSITIVITY_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + public void readSpecialDaysAttribute( + SpecialDaysAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SPECIAL_DAYS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SPECIAL_DAYS_ATTRIBUTE_ID, true); } - public void subscribeCurrentLowPowerModeSensitivityAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_LOW_POWER_MODE_SENSITIVITY_ATTRIBUTE_ID); + public void subscribeSpecialDaysAttribute( + SpecialDaysAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SPECIAL_DAYS_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, CURRENT_LOW_POWER_MODE_SENSITIVITY_ATTRIBUTE_ID, minInterval, maxInterval); + }, SPECIAL_DAYS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readCurrentDayAttribute( + CurrentDayAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_DAY_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.EnergyCalendarClusterDayStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_DAY_ATTRIBUTE_ID, true); + } + + public void subscribeCurrentDayAttribute( + CurrentDayAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_DAY_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.EnergyCalendarClusterDayStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_DAY_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readNextDayAttribute( + NextDayAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NEXT_DAY_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.EnergyCalendarClusterDayStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NEXT_DAY_ATTRIBUTE_ID, true); + } + + public void subscribeNextDayAttribute( + NextDayAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NEXT_DAY_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.EnergyCalendarClusterDayStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NEXT_DAY_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readCurrentTransitionAttribute( + CurrentTransitionAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_TRANSITION_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.EnergyCalendarClusterTransitionStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_TRANSITION_ATTRIBUTE_ID, true); + } + + public void subscribeCurrentTransitionAttribute( + CurrentTransitionAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_TRANSITION_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.EnergyCalendarClusterTransitionStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_TRANSITION_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readCurrentPeakPeriodAttribute( + CurrentPeakPeriodAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_PEAK_PERIOD_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.EnergyCalendarClusterPeakPeriodStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_PEAK_PERIOD_ATTRIBUTE_ID, true); + } + + public void subscribeCurrentPeakPeriodAttribute( + CurrentPeakPeriodAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_PEAK_PERIOD_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.EnergyCalendarClusterPeakPeriodStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_PEAK_PERIOD_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readNextPeakPeriodAttribute( + NextPeakPeriodAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NEXT_PEAK_PERIOD_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.EnergyCalendarClusterPeakPeriodStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NEXT_PEAK_PERIOD_ATTRIBUTE_ID, true); + } + + public void subscribeNextPeakPeriodAttribute( + NextPeakPeriodAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NEXT_PEAK_PERIOD_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.EnergyCalendarClusterPeakPeriodStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NEXT_PEAK_PERIOD_ATTRIBUTE_ID, minInterval, maxInterval); } public void readGeneratedCommandListAttribute( @@ -33047,11 +33254,14 @@ public void onSuccess(byte[] tlv) { } } - public static class PowerTopologyCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 156L; + public static class EnergyPreferenceCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 155L; - private static final long AVAILABLE_ENDPOINTS_ATTRIBUTE_ID = 0L; - private static final long ACTIVE_ENDPOINTS_ATTRIBUTE_ID = 1L; + private static final long ENERGY_BALANCES_ATTRIBUTE_ID = 0L; + private static final long CURRENT_ENERGY_BALANCE_ATTRIBUTE_ID = 1L; + private static final long ENERGY_PRIORITIES_ATTRIBUTE_ID = 2L; + private static final long LOW_POWER_MODE_SENSITIVITIES_ATTRIBUTE_ID = 3L; + private static final long CURRENT_LOW_POWER_MODE_SENSITIVITY_ATTRIBUTE_ID = 4L; private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; @@ -33059,7 +33269,7 @@ public static class PowerTopologyCluster extends BaseChipCluster { private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; - public PowerTopologyCluster(long devicePtr, int endpointId) { + public EnergyPreferenceCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId, CLUSTER_ID); } @@ -33069,14 +33279,18 @@ public long initWithDevice(long devicePtr, int endpointId) { return 0L; } - public interface AvailableEndpointsAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); + public interface EnergyBalancesAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); } - public interface ActiveEndpointsAttributeCallback extends BaseAttributeCallback { + public interface EnergyPrioritiesAttributeCallback extends BaseAttributeCallback { void onSuccess(List value); } + public interface LowPowerModeSensitivitiesAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { void onSuccess(List value); } @@ -33093,35 +33307,70 @@ public interface AttributeListAttributeCallback extends BaseAttributeCallback { void onSuccess(List value); } - public void readAvailableEndpointsAttribute( - AvailableEndpointsAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVAILABLE_ENDPOINTS_ATTRIBUTE_ID); + public void readEnergyBalancesAttribute( + EnergyBalancesAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ENERGY_BALANCES_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AVAILABLE_ENDPOINTS_ATTRIBUTE_ID, true); + }, ENERGY_BALANCES_ATTRIBUTE_ID, true); } - public void subscribeAvailableEndpointsAttribute( - AvailableEndpointsAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVAILABLE_ENDPOINTS_ATTRIBUTE_ID); + public void subscribeEnergyBalancesAttribute( + EnergyBalancesAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ENERGY_BALANCES_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AVAILABLE_ENDPOINTS_ATTRIBUTE_ID, minInterval, maxInterval); + }, ENERGY_BALANCES_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readActiveEndpointsAttribute( - ActiveEndpointsAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_ENDPOINTS_ATTRIBUTE_ID); + public void readCurrentEnergyBalanceAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_ENERGY_BALANCE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_ENERGY_BALANCE_ATTRIBUTE_ID, true); + } + + public void writeCurrentEnergyBalanceAttribute(DefaultClusterCallback callback, Integer value) { + writeCurrentEnergyBalanceAttribute(callback, value, 0); + } + + public void writeCurrentEnergyBalanceAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), CURRENT_ENERGY_BALANCE_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeCurrentEnergyBalanceAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_ENERGY_BALANCE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_ENERGY_BALANCE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readEnergyPrioritiesAttribute( + EnergyPrioritiesAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ENERGY_PRIORITIES_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -33129,12 +33378,12 @@ public void onSuccess(byte[] tlv) { List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_ENDPOINTS_ATTRIBUTE_ID, true); + }, ENERGY_PRIORITIES_ATTRIBUTE_ID, true); } - public void subscribeActiveEndpointsAttribute( - ActiveEndpointsAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_ENDPOINTS_ATTRIBUTE_ID); + public void subscribeEnergyPrioritiesAttribute( + EnergyPrioritiesAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ENERGY_PRIORITIES_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -33142,7 +33391,68 @@ public void onSuccess(byte[] tlv) { List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_ENDPOINTS_ATTRIBUTE_ID, minInterval, maxInterval); + }, ENERGY_PRIORITIES_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readLowPowerModeSensitivitiesAttribute( + LowPowerModeSensitivitiesAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LOW_POWER_MODE_SENSITIVITIES_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, LOW_POWER_MODE_SENSITIVITIES_ATTRIBUTE_ID, true); + } + + public void subscribeLowPowerModeSensitivitiesAttribute( + LowPowerModeSensitivitiesAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LOW_POWER_MODE_SENSITIVITIES_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, LOW_POWER_MODE_SENSITIVITIES_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readCurrentLowPowerModeSensitivityAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_LOW_POWER_MODE_SENSITIVITY_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_LOW_POWER_MODE_SENSITIVITY_ATTRIBUTE_ID, true); + } + + public void writeCurrentLowPowerModeSensitivityAttribute(DefaultClusterCallback callback, Integer value) { + writeCurrentLowPowerModeSensitivityAttribute(callback, value, 0); + } + + public void writeCurrentLowPowerModeSensitivityAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), CURRENT_LOW_POWER_MODE_SENSITIVITY_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeCurrentLowPowerModeSensitivityAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_LOW_POWER_MODE_SENSITIVITY_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_LOW_POWER_MODE_SENSITIVITY_ATTRIBUTE_ID, minInterval, maxInterval); } public void readGeneratedCommandListAttribute( @@ -33302,13 +33612,11 @@ public void onSuccess(byte[] tlv) { } } - public static class EnergyEvseModeCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 157L; + public static class PowerTopologyCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 156L; - private static final long SUPPORTED_MODES_ATTRIBUTE_ID = 0L; - private static final long CURRENT_MODE_ATTRIBUTE_ID = 1L; - private static final long START_UP_MODE_ATTRIBUTE_ID = 2L; - private static final long ON_MODE_ATTRIBUTE_ID = 3L; + private static final long AVAILABLE_ENDPOINTS_ATTRIBUTE_ID = 0L; + private static final long ACTIVE_ENDPOINTS_ATTRIBUTE_ID = 1L; private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; @@ -33316,7 +33624,7 @@ public static class EnergyEvseModeCluster extends BaseChipCluster { private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; - public EnergyEvseModeCluster(long devicePtr, int endpointId) { + public PowerTopologyCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId, CLUSTER_ID); } @@ -33326,57 +33634,12 @@ public long initWithDevice(long devicePtr, int endpointId) { return 0L; } - public void changeToMode(ChangeToModeResponseCallback callback, Integer newMode) { - changeToMode(callback, newMode, 0); - } - - public void changeToMode(ChangeToModeResponseCallback callback, Integer newMode, int timedInvokeTimeoutMs) { - final long commandId = 0L; - - ArrayList elements = new ArrayList<>(); - final long newModeFieldID = 0L; - BaseTLVType newModetlvValue = new UIntType(newMode); - elements.add(new StructElement(newModeFieldID, newModetlvValue)); - - StructType commandArgs = new StructType(elements); - invoke(new InvokeCallbackImpl(callback) { - @Override - public void onResponse(StructType invokeStructValue) { - final long statusFieldID = 0L; - Integer status = null; - final long statusTextFieldID = 1L; - Optional statusText = Optional.empty(); - for (StructElement element: invokeStructValue.value()) { - if (element.contextTagNum() == statusFieldID) { - if (element.value(BaseTLVType.class).type() == TLVType.UInt) { - UIntType castingValue = element.value(UIntType.class); - status = castingValue.value(Integer.class); - } - } else if (element.contextTagNum() == statusTextFieldID) { - if (element.value(BaseTLVType.class).type() == TLVType.String) { - StringType castingValue = element.value(StringType.class); - statusText = Optional.of(castingValue.value(String.class)); - } - } - } - callback.onSuccess(status, statusText); - }}, commandId, commandArgs, timedInvokeTimeoutMs); - } - - public interface ChangeToModeResponseCallback extends BaseClusterCallback { - void onSuccess(Integer status, Optional statusText); - } - - public interface SupportedModesAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); - } - - public interface StartUpModeAttributeCallback extends BaseAttributeCallback { - void onSuccess(@Nullable Integer value); + public interface AvailableEndpointsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); } - public interface OnModeAttributeCallback extends BaseAttributeCallback { - void onSuccess(@Nullable Integer value); + public interface ActiveEndpointsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); } public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { @@ -33395,165 +33658,95 @@ public interface AttributeListAttributeCallback extends BaseAttributeCallback { void onSuccess(List value); } - public void readSupportedModesAttribute( - SupportedModesAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_MODES_ATTRIBUTE_ID); + public void readAvailableEndpointsAttribute( + AvailableEndpointsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVAILABLE_ENDPOINTS_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, SUPPORTED_MODES_ATTRIBUTE_ID, true); + }, AVAILABLE_ENDPOINTS_ATTRIBUTE_ID, true); } - public void subscribeSupportedModesAttribute( - SupportedModesAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_MODES_ATTRIBUTE_ID); + public void subscribeAvailableEndpointsAttribute( + AvailableEndpointsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVAILABLE_ENDPOINTS_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, SUPPORTED_MODES_ATTRIBUTE_ID, minInterval, maxInterval); + }, AVAILABLE_ENDPOINTS_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readCurrentModeAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_MODE_ATTRIBUTE_ID); + public void readActiveEndpointsAttribute( + ActiveEndpointsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_ENDPOINTS_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, CURRENT_MODE_ATTRIBUTE_ID, true); + }, ACTIVE_ENDPOINTS_ATTRIBUTE_ID, true); } - public void subscribeCurrentModeAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_MODE_ATTRIBUTE_ID); + public void subscribeActiveEndpointsAttribute( + ActiveEndpointsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_ENDPOINTS_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, CURRENT_MODE_ATTRIBUTE_ID, minInterval, maxInterval); + }, ACTIVE_ENDPOINTS_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readStartUpModeAttribute( - StartUpModeAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, START_UP_MODE_ATTRIBUTE_ID); + public void readGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, START_UP_MODE_ATTRIBUTE_ID, true); - } - - public void writeStartUpModeAttribute(DefaultClusterCallback callback, Integer value) { - writeStartUpModeAttribute(callback, value, 0); - } - - public void writeStartUpModeAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = value != null ? new UIntType(value) : new NullType(); - writeAttribute(new WriteAttributesCallbackImpl(callback), START_UP_MODE_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, true); } - public void subscribeStartUpModeAttribute( - StartUpModeAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, START_UP_MODE_ATTRIBUTE_ID); + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, START_UP_MODE_ATTRIBUTE_ID, minInterval, maxInterval); + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readOnModeAttribute( - OnModeAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ON_MODE_ATTRIBUTE_ID); + public void readAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ON_MODE_ATTRIBUTE_ID, true); - } - - public void writeOnModeAttribute(DefaultClusterCallback callback, Integer value) { - writeOnModeAttribute(callback, value, 0); - } - - public void writeOnModeAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = value != null ? new UIntType(value) : new NullType(); - writeAttribute(new WriteAttributesCallbackImpl(callback), ON_MODE_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); - } - - public void subscribeOnModeAttribute( - OnModeAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ON_MODE_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ON_MODE_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readGeneratedCommandListAttribute( - GeneratedCommandListAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, true); - } - - public void subscribeGeneratedCommandListAttribute( - GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAcceptedCommandListAttribute( - AcceptedCommandListAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, true); + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, true); } public void subscribeAcceptedCommandListAttribute( @@ -33674,8 +33867,8 @@ public void onSuccess(byte[] tlv) { } } - public static class DeviceEnergyManagementModeCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 159L; + public static class EnergyEvseModeCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 157L; private static final long SUPPORTED_MODES_ATTRIBUTE_ID = 0L; private static final long CURRENT_MODE_ATTRIBUTE_ID = 1L; @@ -33688,7 +33881,7 @@ public static class DeviceEnergyManagementModeCluster extends BaseChipCluster { private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; - public DeviceEnergyManagementModeCluster(long devicePtr, int endpointId) { + public EnergyEvseModeCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId, CLUSTER_ID); } @@ -33740,7 +33933,7 @@ public interface ChangeToModeResponseCallback extends BaseClusterCallback { } public interface SupportedModesAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); + void onSuccess(List value); } public interface StartUpModeAttributeCallback extends BaseAttributeCallback { @@ -33774,7 +33967,7 @@ public void readSupportedModesAttribute( readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } }, SUPPORTED_MODES_ATTRIBUTE_ID, true); @@ -33787,7 +33980,7 @@ public void subscribeSupportedModesAttribute( subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } }, SUPPORTED_MODES_ATTRIBUTE_ID, minInterval, maxInterval); @@ -34046,54 +34239,13 @@ public void onSuccess(byte[] tlv) { } } - public static class DoorLockCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 257L; + public static class DeviceEnergyManagementModeCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 159L; - private static final long LOCK_STATE_ATTRIBUTE_ID = 0L; - private static final long LOCK_TYPE_ATTRIBUTE_ID = 1L; - private static final long ACTUATOR_ENABLED_ATTRIBUTE_ID = 2L; - private static final long DOOR_STATE_ATTRIBUTE_ID = 3L; - private static final long DOOR_OPEN_EVENTS_ATTRIBUTE_ID = 4L; - private static final long DOOR_CLOSED_EVENTS_ATTRIBUTE_ID = 5L; - private static final long OPEN_PERIOD_ATTRIBUTE_ID = 6L; - private static final long NUMBER_OF_TOTAL_USERS_SUPPORTED_ATTRIBUTE_ID = 17L; - private static final long NUMBER_OF_P_I_N_USERS_SUPPORTED_ATTRIBUTE_ID = 18L; - private static final long NUMBER_OF_R_F_I_D_USERS_SUPPORTED_ATTRIBUTE_ID = 19L; - private static final long NUMBER_OF_WEEK_DAY_SCHEDULES_SUPPORTED_PER_USER_ATTRIBUTE_ID = 20L; - private static final long NUMBER_OF_YEAR_DAY_SCHEDULES_SUPPORTED_PER_USER_ATTRIBUTE_ID = 21L; - private static final long NUMBER_OF_HOLIDAY_SCHEDULES_SUPPORTED_ATTRIBUTE_ID = 22L; - private static final long MAX_P_I_N_CODE_LENGTH_ATTRIBUTE_ID = 23L; - private static final long MIN_P_I_N_CODE_LENGTH_ATTRIBUTE_ID = 24L; - private static final long MAX_R_F_I_D_CODE_LENGTH_ATTRIBUTE_ID = 25L; - private static final long MIN_R_F_I_D_CODE_LENGTH_ATTRIBUTE_ID = 26L; - private static final long CREDENTIAL_RULES_SUPPORT_ATTRIBUTE_ID = 27L; - private static final long NUMBER_OF_CREDENTIALS_SUPPORTED_PER_USER_ATTRIBUTE_ID = 28L; - private static final long LANGUAGE_ATTRIBUTE_ID = 33L; - private static final long L_E_D_SETTINGS_ATTRIBUTE_ID = 34L; - private static final long AUTO_RELOCK_TIME_ATTRIBUTE_ID = 35L; - private static final long SOUND_VOLUME_ATTRIBUTE_ID = 36L; - private static final long OPERATING_MODE_ATTRIBUTE_ID = 37L; - private static final long SUPPORTED_OPERATING_MODES_ATTRIBUTE_ID = 38L; - private static final long DEFAULT_CONFIGURATION_REGISTER_ATTRIBUTE_ID = 39L; - private static final long ENABLE_LOCAL_PROGRAMMING_ATTRIBUTE_ID = 40L; - private static final long ENABLE_ONE_TOUCH_LOCKING_ATTRIBUTE_ID = 41L; - private static final long ENABLE_INSIDE_STATUS_L_E_D_ATTRIBUTE_ID = 42L; - private static final long ENABLE_PRIVACY_MODE_BUTTON_ATTRIBUTE_ID = 43L; - private static final long LOCAL_PROGRAMMING_FEATURES_ATTRIBUTE_ID = 44L; - private static final long WRONG_CODE_ENTRY_LIMIT_ATTRIBUTE_ID = 48L; - private static final long USER_CODE_TEMPORARY_DISABLE_TIME_ATTRIBUTE_ID = 49L; - private static final long SEND_P_I_N_OVER_THE_AIR_ATTRIBUTE_ID = 50L; - private static final long REQUIRE_P_I_NFOR_REMOTE_OPERATION_ATTRIBUTE_ID = 51L; - private static final long EXPIRING_USER_TIMEOUT_ATTRIBUTE_ID = 53L; - private static final long ALIRO_READER_VERIFICATION_KEY_ATTRIBUTE_ID = 128L; - private static final long ALIRO_READER_GROUP_IDENTIFIER_ATTRIBUTE_ID = 129L; - private static final long ALIRO_READER_GROUP_SUB_IDENTIFIER_ATTRIBUTE_ID = 130L; - private static final long ALIRO_EXPEDITED_TRANSACTION_SUPPORTED_PROTOCOL_VERSIONS_ATTRIBUTE_ID = 131L; - private static final long ALIRO_GROUP_RESOLVING_KEY_ATTRIBUTE_ID = 132L; - private static final long ALIRO_SUPPORTED_B_L_E_U_W_B_PROTOCOL_VERSIONS_ATTRIBUTE_ID = 133L; - private static final long ALIRO_B_L_E_ADVERTISING_VERSION_ATTRIBUTE_ID = 134L; - private static final long NUMBER_OF_ALIRO_CREDENTIAL_ISSUER_KEYS_SUPPORTED_ATTRIBUTE_ID = 135L; - private static final long NUMBER_OF_ALIRO_ENDPOINT_KEYS_SUPPORTED_ATTRIBUTE_ID = 136L; + private static final long SUPPORTED_MODES_ATTRIBUTE_ID = 0L; + private static final long CURRENT_MODE_ATTRIBUTE_ID = 1L; + private static final long START_UP_MODE_ATTRIBUTE_ID = 2L; + private static final long ON_MODE_ATTRIBUTE_ID = 3L; private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; @@ -34101,7 +34253,7 @@ public static class DoorLockCluster extends BaseChipCluster { private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; - public DoorLockCluster(long devicePtr, int endpointId) { + public DeviceEnergyManagementModeCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId, CLUSTER_ID); } @@ -34111,80 +34263,493 @@ public long initWithDevice(long devicePtr, int endpointId) { return 0L; } + public void changeToMode(ChangeToModeResponseCallback callback, Integer newMode) { + changeToMode(callback, newMode, 0); + } - public void lockDoor(DefaultClusterCallback callback, Optional PINCode, int timedInvokeTimeoutMs) { + public void changeToMode(ChangeToModeResponseCallback callback, Integer newMode, int timedInvokeTimeoutMs) { final long commandId = 0L; ArrayList elements = new ArrayList<>(); - final long PINCodeFieldID = 0L; - BaseTLVType PINCodetlvValue = PINCode.map((nonOptionalPINCode) -> new ByteArrayType(nonOptionalPINCode)).orElse(new EmptyType()); - elements.add(new StructElement(PINCodeFieldID, PINCodetlvValue)); + final long newModeFieldID = 0L; + BaseTLVType newModetlvValue = new UIntType(newMode); + elements.add(new StructElement(newModeFieldID, newModetlvValue)); StructType commandArgs = new StructType(elements); invoke(new InvokeCallbackImpl(callback) { @Override public void onResponse(StructType invokeStructValue) { - callback.onSuccess(); + final long statusFieldID = 0L; + Integer status = null; + final long statusTextFieldID = 1L; + Optional statusText = Optional.empty(); + for (StructElement element: invokeStructValue.value()) { + if (element.contextTagNum() == statusFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + status = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == statusTextFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + statusText = Optional.of(castingValue.value(String.class)); + } + } + } + callback.onSuccess(status, statusText); }}, commandId, commandArgs, timedInvokeTimeoutMs); } + public interface ChangeToModeResponseCallback extends BaseClusterCallback { + void onSuccess(Integer status, Optional statusText); + } - public void unlockDoor(DefaultClusterCallback callback, Optional PINCode, int timedInvokeTimeoutMs) { - final long commandId = 1L; + public interface SupportedModesAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } - ArrayList elements = new ArrayList<>(); - final long PINCodeFieldID = 0L; - BaseTLVType PINCodetlvValue = PINCode.map((nonOptionalPINCode) -> new ByteArrayType(nonOptionalPINCode)).orElse(new EmptyType()); - elements.add(new StructElement(PINCodeFieldID, PINCodetlvValue)); + public interface StartUpModeAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Integer value); + } - StructType commandArgs = new StructType(elements); - invoke(new InvokeCallbackImpl(callback) { - @Override - public void onResponse(StructType invokeStructValue) { - callback.onSuccess(); - }}, commandId, commandArgs, timedInvokeTimeoutMs); + public interface OnModeAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Integer value); } + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } - public void unlockWithTimeout(DefaultClusterCallback callback, Integer timeout, Optional PINCode, int timedInvokeTimeoutMs) { - final long commandId = 3L; + public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } - ArrayList elements = new ArrayList<>(); - final long timeoutFieldID = 0L; - BaseTLVType timeouttlvValue = new UIntType(timeout); - elements.add(new StructElement(timeoutFieldID, timeouttlvValue)); + public interface EventListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } - final long PINCodeFieldID = 1L; - BaseTLVType PINCodetlvValue = PINCode.map((nonOptionalPINCode) -> new ByteArrayType(nonOptionalPINCode)).orElse(new EmptyType()); - elements.add(new StructElement(PINCodeFieldID, PINCodetlvValue)); + public interface AttributeListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } - StructType commandArgs = new StructType(elements); - invoke(new InvokeCallbackImpl(callback) { + public void readSupportedModesAttribute( + SupportedModesAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_MODES_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { @Override - public void onResponse(StructType invokeStructValue) { - callback.onSuccess(); - }}, commandId, commandArgs, timedInvokeTimeoutMs); + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SUPPORTED_MODES_ATTRIBUTE_ID, true); } - public void setWeekDaySchedule(DefaultClusterCallback callback, Integer weekDayIndex, Integer userIndex, Integer daysMask, Integer startHour, Integer startMinute, Integer endHour, Integer endMinute) { - setWeekDaySchedule(callback, weekDayIndex, userIndex, daysMask, startHour, startMinute, endHour, endMinute, 0); - } + public void subscribeSupportedModesAttribute( + SupportedModesAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_MODES_ATTRIBUTE_ID); - public void setWeekDaySchedule(DefaultClusterCallback callback, Integer weekDayIndex, Integer userIndex, Integer daysMask, Integer startHour, Integer startMinute, Integer endHour, Integer endMinute, int timedInvokeTimeoutMs) { - final long commandId = 11L; + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SUPPORTED_MODES_ATTRIBUTE_ID, minInterval, maxInterval); + } - ArrayList elements = new ArrayList<>(); - final long weekDayIndexFieldID = 0L; - BaseTLVType weekDayIndextlvValue = new UIntType(weekDayIndex); - elements.add(new StructElement(weekDayIndexFieldID, weekDayIndextlvValue)); + public void readCurrentModeAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_MODE_ATTRIBUTE_ID); - final long userIndexFieldID = 1L; - BaseTLVType userIndextlvValue = new UIntType(userIndex); - elements.add(new StructElement(userIndexFieldID, userIndextlvValue)); + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_MODE_ATTRIBUTE_ID, true); + } - final long daysMaskFieldID = 2L; - BaseTLVType daysMasktlvValue = new UIntType(daysMask); - elements.add(new StructElement(daysMaskFieldID, daysMasktlvValue)); + public void subscribeCurrentModeAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_MODE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_MODE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readStartUpModeAttribute( + StartUpModeAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, START_UP_MODE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, START_UP_MODE_ATTRIBUTE_ID, true); + } + + public void writeStartUpModeAttribute(DefaultClusterCallback callback, Integer value) { + writeStartUpModeAttribute(callback, value, 0); + } + + public void writeStartUpModeAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = value != null ? new UIntType(value) : new NullType(); + writeAttribute(new WriteAttributesCallbackImpl(callback), START_UP_MODE_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeStartUpModeAttribute( + StartUpModeAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, START_UP_MODE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, START_UP_MODE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readOnModeAttribute( + OnModeAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ON_MODE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ON_MODE_ATTRIBUTE_ID, true); + } + + public void writeOnModeAttribute(DefaultClusterCallback callback, Integer value) { + writeOnModeAttribute(callback, value, 0); + } + + public void writeOnModeAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = value != null ? new UIntType(value) : new NullType(); + writeAttribute(new WriteAttributesCallbackImpl(callback), ON_MODE_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeOnModeAttribute( + OnModeAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ON_MODE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ON_MODE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readEventListAttribute( + EventListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAttributeListAttribute( + AttributeListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readFeatureMapAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, true); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, true); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, minInterval, maxInterval); + } + } + + public static class DoorLockCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 257L; + + private static final long LOCK_STATE_ATTRIBUTE_ID = 0L; + private static final long LOCK_TYPE_ATTRIBUTE_ID = 1L; + private static final long ACTUATOR_ENABLED_ATTRIBUTE_ID = 2L; + private static final long DOOR_STATE_ATTRIBUTE_ID = 3L; + private static final long DOOR_OPEN_EVENTS_ATTRIBUTE_ID = 4L; + private static final long DOOR_CLOSED_EVENTS_ATTRIBUTE_ID = 5L; + private static final long OPEN_PERIOD_ATTRIBUTE_ID = 6L; + private static final long NUMBER_OF_TOTAL_USERS_SUPPORTED_ATTRIBUTE_ID = 17L; + private static final long NUMBER_OF_P_I_N_USERS_SUPPORTED_ATTRIBUTE_ID = 18L; + private static final long NUMBER_OF_R_F_I_D_USERS_SUPPORTED_ATTRIBUTE_ID = 19L; + private static final long NUMBER_OF_WEEK_DAY_SCHEDULES_SUPPORTED_PER_USER_ATTRIBUTE_ID = 20L; + private static final long NUMBER_OF_YEAR_DAY_SCHEDULES_SUPPORTED_PER_USER_ATTRIBUTE_ID = 21L; + private static final long NUMBER_OF_HOLIDAY_SCHEDULES_SUPPORTED_ATTRIBUTE_ID = 22L; + private static final long MAX_P_I_N_CODE_LENGTH_ATTRIBUTE_ID = 23L; + private static final long MIN_P_I_N_CODE_LENGTH_ATTRIBUTE_ID = 24L; + private static final long MAX_R_F_I_D_CODE_LENGTH_ATTRIBUTE_ID = 25L; + private static final long MIN_R_F_I_D_CODE_LENGTH_ATTRIBUTE_ID = 26L; + private static final long CREDENTIAL_RULES_SUPPORT_ATTRIBUTE_ID = 27L; + private static final long NUMBER_OF_CREDENTIALS_SUPPORTED_PER_USER_ATTRIBUTE_ID = 28L; + private static final long LANGUAGE_ATTRIBUTE_ID = 33L; + private static final long L_E_D_SETTINGS_ATTRIBUTE_ID = 34L; + private static final long AUTO_RELOCK_TIME_ATTRIBUTE_ID = 35L; + private static final long SOUND_VOLUME_ATTRIBUTE_ID = 36L; + private static final long OPERATING_MODE_ATTRIBUTE_ID = 37L; + private static final long SUPPORTED_OPERATING_MODES_ATTRIBUTE_ID = 38L; + private static final long DEFAULT_CONFIGURATION_REGISTER_ATTRIBUTE_ID = 39L; + private static final long ENABLE_LOCAL_PROGRAMMING_ATTRIBUTE_ID = 40L; + private static final long ENABLE_ONE_TOUCH_LOCKING_ATTRIBUTE_ID = 41L; + private static final long ENABLE_INSIDE_STATUS_L_E_D_ATTRIBUTE_ID = 42L; + private static final long ENABLE_PRIVACY_MODE_BUTTON_ATTRIBUTE_ID = 43L; + private static final long LOCAL_PROGRAMMING_FEATURES_ATTRIBUTE_ID = 44L; + private static final long WRONG_CODE_ENTRY_LIMIT_ATTRIBUTE_ID = 48L; + private static final long USER_CODE_TEMPORARY_DISABLE_TIME_ATTRIBUTE_ID = 49L; + private static final long SEND_P_I_N_OVER_THE_AIR_ATTRIBUTE_ID = 50L; + private static final long REQUIRE_P_I_NFOR_REMOTE_OPERATION_ATTRIBUTE_ID = 51L; + private static final long EXPIRING_USER_TIMEOUT_ATTRIBUTE_ID = 53L; + private static final long ALIRO_READER_VERIFICATION_KEY_ATTRIBUTE_ID = 128L; + private static final long ALIRO_READER_GROUP_IDENTIFIER_ATTRIBUTE_ID = 129L; + private static final long ALIRO_READER_GROUP_SUB_IDENTIFIER_ATTRIBUTE_ID = 130L; + private static final long ALIRO_EXPEDITED_TRANSACTION_SUPPORTED_PROTOCOL_VERSIONS_ATTRIBUTE_ID = 131L; + private static final long ALIRO_GROUP_RESOLVING_KEY_ATTRIBUTE_ID = 132L; + private static final long ALIRO_SUPPORTED_B_L_E_U_W_B_PROTOCOL_VERSIONS_ATTRIBUTE_ID = 133L; + private static final long ALIRO_B_L_E_ADVERTISING_VERSION_ATTRIBUTE_ID = 134L; + private static final long NUMBER_OF_ALIRO_CREDENTIAL_ISSUER_KEYS_SUPPORTED_ATTRIBUTE_ID = 135L; + private static final long NUMBER_OF_ALIRO_ENDPOINT_KEYS_SUPPORTED_ATTRIBUTE_ID = 136L; + private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; + private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; + private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; + private static final long ATTRIBUTE_LIST_ATTRIBUTE_ID = 65531L; + private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; + private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; + + public DoorLockCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId, CLUSTER_ID); + } + + @Override + @Deprecated + public long initWithDevice(long devicePtr, int endpointId) { + return 0L; + } + + + public void lockDoor(DefaultClusterCallback callback, Optional PINCode, int timedInvokeTimeoutMs) { + final long commandId = 0L; + + ArrayList elements = new ArrayList<>(); + final long PINCodeFieldID = 0L; + BaseTLVType PINCodetlvValue = PINCode.map((nonOptionalPINCode) -> new ByteArrayType(nonOptionalPINCode)).orElse(new EmptyType()); + elements.add(new StructElement(PINCodeFieldID, PINCodetlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + + public void unlockDoor(DefaultClusterCallback callback, Optional PINCode, int timedInvokeTimeoutMs) { + final long commandId = 1L; + + ArrayList elements = new ArrayList<>(); + final long PINCodeFieldID = 0L; + BaseTLVType PINCodetlvValue = PINCode.map((nonOptionalPINCode) -> new ByteArrayType(nonOptionalPINCode)).orElse(new EmptyType()); + elements.add(new StructElement(PINCodeFieldID, PINCodetlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + + public void unlockWithTimeout(DefaultClusterCallback callback, Integer timeout, Optional PINCode, int timedInvokeTimeoutMs) { + final long commandId = 3L; + + ArrayList elements = new ArrayList<>(); + final long timeoutFieldID = 0L; + BaseTLVType timeouttlvValue = new UIntType(timeout); + elements.add(new StructElement(timeoutFieldID, timeouttlvValue)); + + final long PINCodeFieldID = 1L; + BaseTLVType PINCodetlvValue = PINCode.map((nonOptionalPINCode) -> new ByteArrayType(nonOptionalPINCode)).orElse(new EmptyType()); + elements.add(new StructElement(PINCodeFieldID, PINCodetlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void setWeekDaySchedule(DefaultClusterCallback callback, Integer weekDayIndex, Integer userIndex, Integer daysMask, Integer startHour, Integer startMinute, Integer endHour, Integer endMinute) { + setWeekDaySchedule(callback, weekDayIndex, userIndex, daysMask, startHour, startMinute, endHour, endMinute, 0); + } + + public void setWeekDaySchedule(DefaultClusterCallback callback, Integer weekDayIndex, Integer userIndex, Integer daysMask, Integer startHour, Integer startMinute, Integer endHour, Integer endMinute, int timedInvokeTimeoutMs) { + final long commandId = 11L; + + ArrayList elements = new ArrayList<>(); + final long weekDayIndexFieldID = 0L; + BaseTLVType weekDayIndextlvValue = new UIntType(weekDayIndex); + elements.add(new StructElement(weekDayIndexFieldID, weekDayIndextlvValue)); + + final long userIndexFieldID = 1L; + BaseTLVType userIndextlvValue = new UIntType(userIndex); + elements.add(new StructElement(userIndexFieldID, userIndextlvValue)); + + final long daysMaskFieldID = 2L; + BaseTLVType daysMasktlvValue = new UIntType(daysMask); + elements.add(new StructElement(daysMaskFieldID, daysMasktlvValue)); final long startHourFieldID = 3L; BaseTLVType startHourtlvValue = new UIntType(startHour); @@ -59818,105 +60383,365 @@ public static class ElectricalMeasurementCluster extends BaseChipCluster { private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; - public ElectricalMeasurementCluster(long devicePtr, int endpointId) { - super(devicePtr, endpointId, CLUSTER_ID); + public ElectricalMeasurementCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId, CLUSTER_ID); + } + + @Override + @Deprecated + public long initWithDevice(long devicePtr, int endpointId) { + return 0L; + } + + public void getProfileInfoCommand(DefaultClusterCallback callback) { + getProfileInfoCommand(callback, 0); + } + + public void getProfileInfoCommand(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { + final long commandId = 0L; + + ArrayList elements = new ArrayList<>(); + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void getMeasurementProfileCommand(DefaultClusterCallback callback, Integer attributeId, Long startTime, Integer numberOfIntervals) { + getMeasurementProfileCommand(callback, attributeId, startTime, numberOfIntervals, 0); + } + + public void getMeasurementProfileCommand(DefaultClusterCallback callback, Integer attributeId, Long startTime, Integer numberOfIntervals, int timedInvokeTimeoutMs) { + final long commandId = 1L; + + ArrayList elements = new ArrayList<>(); + final long attributeIdFieldID = 0L; + BaseTLVType attributeIdtlvValue = new UIntType(attributeId); + elements.add(new StructElement(attributeIdFieldID, attributeIdtlvValue)); + + final long startTimeFieldID = 1L; + BaseTLVType startTimetlvValue = new UIntType(startTime); + elements.add(new StructElement(startTimeFieldID, startTimetlvValue)); + + final long numberOfIntervalsFieldID = 2L; + BaseTLVType numberOfIntervalstlvValue = new UIntType(numberOfIntervals); + elements.add(new StructElement(numberOfIntervalsFieldID, numberOfIntervalstlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface EventListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AttributeListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public void readMeasurementTypeAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASUREMENT_TYPE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MEASUREMENT_TYPE_ATTRIBUTE_ID, true); + } + + public void subscribeMeasurementTypeAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASUREMENT_TYPE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MEASUREMENT_TYPE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readDcVoltageAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DC_VOLTAGE_ATTRIBUTE_ID, true); + } + + public void subscribeDcVoltageAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DC_VOLTAGE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readDcVoltageMinAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_MIN_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DC_VOLTAGE_MIN_ATTRIBUTE_ID, true); + } + + public void subscribeDcVoltageMinAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_MIN_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DC_VOLTAGE_MIN_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readDcVoltageMaxAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_MAX_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DC_VOLTAGE_MAX_ATTRIBUTE_ID, true); + } + + public void subscribeDcVoltageMaxAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_MAX_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DC_VOLTAGE_MAX_ATTRIBUTE_ID, minInterval, maxInterval); } - @Override - @Deprecated - public long initWithDevice(long devicePtr, int endpointId) { - return 0L; + public void readDcCurrentAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DC_CURRENT_ATTRIBUTE_ID, true); } - public void getProfileInfoCommand(DefaultClusterCallback callback) { - getProfileInfoCommand(callback, 0); + public void subscribeDcCurrentAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); } - public void getProfileInfoCommand(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { - final long commandId = 0L; + public void readDcCurrentMinAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_MIN_ATTRIBUTE_ID); - ArrayList elements = new ArrayList<>(); - StructType commandArgs = new StructType(elements); - invoke(new InvokeCallbackImpl(callback) { + readAttribute(new ReportCallbackImpl(callback, path) { @Override - public void onResponse(StructType invokeStructValue) { - callback.onSuccess(); - }}, commandId, commandArgs, timedInvokeTimeoutMs); + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DC_CURRENT_MIN_ATTRIBUTE_ID, true); } - public void getMeasurementProfileCommand(DefaultClusterCallback callback, Integer attributeId, Long startTime, Integer numberOfIntervals) { - getMeasurementProfileCommand(callback, attributeId, startTime, numberOfIntervals, 0); + public void subscribeDcCurrentMinAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_MIN_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DC_CURRENT_MIN_ATTRIBUTE_ID, minInterval, maxInterval); } - public void getMeasurementProfileCommand(DefaultClusterCallback callback, Integer attributeId, Long startTime, Integer numberOfIntervals, int timedInvokeTimeoutMs) { - final long commandId = 1L; + public void readDcCurrentMaxAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_MAX_ATTRIBUTE_ID); - ArrayList elements = new ArrayList<>(); - final long attributeIdFieldID = 0L; - BaseTLVType attributeIdtlvValue = new UIntType(attributeId); - elements.add(new StructElement(attributeIdFieldID, attributeIdtlvValue)); + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DC_CURRENT_MAX_ATTRIBUTE_ID, true); + } - final long startTimeFieldID = 1L; - BaseTLVType startTimetlvValue = new UIntType(startTime); - elements.add(new StructElement(startTimeFieldID, startTimetlvValue)); + public void subscribeDcCurrentMaxAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_MAX_ATTRIBUTE_ID); - final long numberOfIntervalsFieldID = 2L; - BaseTLVType numberOfIntervalstlvValue = new UIntType(numberOfIntervals); - elements.add(new StructElement(numberOfIntervalsFieldID, numberOfIntervalstlvValue)); + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DC_CURRENT_MAX_ATTRIBUTE_ID, minInterval, maxInterval); + } - StructType commandArgs = new StructType(elements); - invoke(new InvokeCallbackImpl(callback) { + public void readDcPowerAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { @Override - public void onResponse(StructType invokeStructValue) { - callback.onSuccess(); - }}, commandId, commandArgs, timedInvokeTimeoutMs); + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DC_POWER_ATTRIBUTE_ID, true); } - public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); + public void subscribeDcPowerAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DC_POWER_ATTRIBUTE_ID, minInterval, maxInterval); } - public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); + public void readDcPowerMinAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_MIN_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DC_POWER_MIN_ATTRIBUTE_ID, true); } - public interface EventListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); + public void subscribeDcPowerMinAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_MIN_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DC_POWER_MIN_ATTRIBUTE_ID, minInterval, maxInterval); } - public interface AttributeListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); + public void readDcPowerMaxAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_MAX_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DC_POWER_MAX_ATTRIBUTE_ID, true); } - public void readMeasurementTypeAttribute( - LongAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASUREMENT_TYPE_ATTRIBUTE_ID); + public void subscribeDcPowerMaxAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_MAX_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DC_POWER_MAX_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readDcVoltageMultiplierAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASUREMENT_TYPE_ATTRIBUTE_ID, true); + }, DC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID, true); } - public void subscribeMeasurementTypeAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASUREMENT_TYPE_ATTRIBUTE_ID); + public void subscribeDcVoltageMultiplierAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASUREMENT_TYPE_ATTRIBUTE_ID, minInterval, maxInterval); + }, DC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readDcVoltageAttribute( + public void readDcVoltageDivisorAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_DIVISOR_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -59924,12 +60749,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_VOLTAGE_ATTRIBUTE_ID, true); + }, DC_VOLTAGE_DIVISOR_ATTRIBUTE_ID, true); } - public void subscribeDcVoltageAttribute( + public void subscribeDcVoltageDivisorAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_DIVISOR_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -59937,12 +60762,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_VOLTAGE_ATTRIBUTE_ID, minInterval, maxInterval); + }, DC_VOLTAGE_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readDcVoltageMinAttribute( + public void readDcCurrentMultiplierAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_MIN_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -59950,12 +60775,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_VOLTAGE_MIN_ATTRIBUTE_ID, true); + }, DC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, true); } - public void subscribeDcVoltageMinAttribute( + public void subscribeDcCurrentMultiplierAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_MIN_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -59963,12 +60788,38 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_VOLTAGE_MIN_ATTRIBUTE_ID, minInterval, maxInterval); + }, DC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readDcVoltageMaxAttribute( + public void readDcCurrentDivisorAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_DIVISOR_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DC_CURRENT_DIVISOR_ATTRIBUTE_ID, true); + } + + public void subscribeDcCurrentDivisorAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_DIVISOR_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DC_CURRENT_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readDcPowerMultiplierAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_MAX_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_MULTIPLIER_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -59976,12 +60827,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_VOLTAGE_MAX_ATTRIBUTE_ID, true); + }, DC_POWER_MULTIPLIER_ATTRIBUTE_ID, true); } - public void subscribeDcVoltageMaxAttribute( + public void subscribeDcPowerMultiplierAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_MAX_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_MULTIPLIER_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -59989,12 +60840,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_VOLTAGE_MAX_ATTRIBUTE_ID, minInterval, maxInterval); + }, DC_POWER_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readDcCurrentAttribute( + public void readDcPowerDivisorAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_DIVISOR_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60002,12 +60853,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_CURRENT_ATTRIBUTE_ID, true); + }, DC_POWER_DIVISOR_ATTRIBUTE_ID, true); } - public void subscribeDcCurrentAttribute( + public void subscribeDcPowerDivisorAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_DIVISOR_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60015,12 +60866,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); + }, DC_POWER_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readDcCurrentMinAttribute( + public void readAcFrequencyAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_MIN_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60028,12 +60879,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_CURRENT_MIN_ATTRIBUTE_ID, true); + }, AC_FREQUENCY_ATTRIBUTE_ID, true); } - public void subscribeDcCurrentMinAttribute( + public void subscribeAcFrequencyAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_MIN_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60041,12 +60892,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_CURRENT_MIN_ATTRIBUTE_ID, minInterval, maxInterval); + }, AC_FREQUENCY_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readDcCurrentMaxAttribute( + public void readAcFrequencyMinAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_MAX_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_MIN_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60054,12 +60905,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_CURRENT_MAX_ATTRIBUTE_ID, true); + }, AC_FREQUENCY_MIN_ATTRIBUTE_ID, true); } - public void subscribeDcCurrentMaxAttribute( + public void subscribeAcFrequencyMinAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_MAX_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_MIN_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60067,12 +60918,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_CURRENT_MAX_ATTRIBUTE_ID, minInterval, maxInterval); + }, AC_FREQUENCY_MIN_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readDcPowerAttribute( + public void readAcFrequencyMaxAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_MAX_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60080,12 +60931,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_POWER_ATTRIBUTE_ID, true); + }, AC_FREQUENCY_MAX_ATTRIBUTE_ID, true); } - public void subscribeDcPowerAttribute( + public void subscribeAcFrequencyMaxAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_MAX_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60093,12 +60944,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_POWER_ATTRIBUTE_ID, minInterval, maxInterval); + }, AC_FREQUENCY_MAX_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readDcPowerMinAttribute( + public void readNeutralCurrentAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_MIN_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NEUTRAL_CURRENT_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60106,12 +60957,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_POWER_MIN_ATTRIBUTE_ID, true); + }, NEUTRAL_CURRENT_ATTRIBUTE_ID, true); } - public void subscribeDcPowerMinAttribute( + public void subscribeNeutralCurrentAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_MIN_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NEUTRAL_CURRENT_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60119,90 +60970,90 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_POWER_MIN_ATTRIBUTE_ID, minInterval, maxInterval); + }, NEUTRAL_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readDcPowerMaxAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_MAX_ATTRIBUTE_ID); + public void readTotalActivePowerAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TOTAL_ACTIVE_POWER_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_POWER_MAX_ATTRIBUTE_ID, true); + }, TOTAL_ACTIVE_POWER_ATTRIBUTE_ID, true); } - public void subscribeDcPowerMaxAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_MAX_ATTRIBUTE_ID); + public void subscribeTotalActivePowerAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TOTAL_ACTIVE_POWER_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_POWER_MAX_ATTRIBUTE_ID, minInterval, maxInterval); + }, TOTAL_ACTIVE_POWER_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readDcVoltageMultiplierAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID); + public void readTotalReactivePowerAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TOTAL_REACTIVE_POWER_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID, true); + }, TOTAL_REACTIVE_POWER_ATTRIBUTE_ID, true); } - public void subscribeDcVoltageMultiplierAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID); + public void subscribeTotalReactivePowerAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TOTAL_REACTIVE_POWER_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); + }, TOTAL_REACTIVE_POWER_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readDcVoltageDivisorAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_DIVISOR_ATTRIBUTE_ID); + public void readTotalApparentPowerAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TOTAL_APPARENT_POWER_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_VOLTAGE_DIVISOR_ATTRIBUTE_ID, true); + }, TOTAL_APPARENT_POWER_ATTRIBUTE_ID, true); } - public void subscribeDcVoltageDivisorAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_DIVISOR_ATTRIBUTE_ID); + public void subscribeTotalApparentPowerAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TOTAL_APPARENT_POWER_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_VOLTAGE_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); + }, TOTAL_APPARENT_POWER_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readDcCurrentMultiplierAttribute( + public void readMeasured1stHarmonicCurrentAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED1ST_HARMONIC_CURRENT_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60210,12 +61061,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, true); + }, MEASURED1ST_HARMONIC_CURRENT_ATTRIBUTE_ID, true); } - public void subscribeDcCurrentMultiplierAttribute( + public void subscribeMeasured1stHarmonicCurrentAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED1ST_HARMONIC_CURRENT_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60223,12 +61074,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); + }, MEASURED1ST_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readDcCurrentDivisorAttribute( + public void readMeasured3rdHarmonicCurrentAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_DIVISOR_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED3RD_HARMONIC_CURRENT_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60236,12 +61087,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_CURRENT_DIVISOR_ATTRIBUTE_ID, true); + }, MEASURED3RD_HARMONIC_CURRENT_ATTRIBUTE_ID, true); } - public void subscribeDcCurrentDivisorAttribute( + public void subscribeMeasured3rdHarmonicCurrentAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_DIVISOR_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED3RD_HARMONIC_CURRENT_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60249,12 +61100,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_CURRENT_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); + }, MEASURED3RD_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readDcPowerMultiplierAttribute( + public void readMeasured5thHarmonicCurrentAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_MULTIPLIER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED5TH_HARMONIC_CURRENT_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60262,12 +61113,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_POWER_MULTIPLIER_ATTRIBUTE_ID, true); + }, MEASURED5TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); } - public void subscribeDcPowerMultiplierAttribute( + public void subscribeMeasured5thHarmonicCurrentAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_MULTIPLIER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED5TH_HARMONIC_CURRENT_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60275,12 +61126,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_POWER_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); + }, MEASURED5TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readDcPowerDivisorAttribute( + public void readMeasured7thHarmonicCurrentAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_DIVISOR_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED7TH_HARMONIC_CURRENT_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60288,12 +61139,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_POWER_DIVISOR_ATTRIBUTE_ID, true); + }, MEASURED7TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); } - public void subscribeDcPowerDivisorAttribute( + public void subscribeMeasured7thHarmonicCurrentAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_DIVISOR_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED7TH_HARMONIC_CURRENT_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60301,12 +61152,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, DC_POWER_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); + }, MEASURED7TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAcFrequencyAttribute( + public void readMeasured9thHarmonicCurrentAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED9TH_HARMONIC_CURRENT_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60314,12 +61165,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_FREQUENCY_ATTRIBUTE_ID, true); + }, MEASURED9TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); } - public void subscribeAcFrequencyAttribute( + public void subscribeMeasured9thHarmonicCurrentAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED9TH_HARMONIC_CURRENT_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60327,12 +61178,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_FREQUENCY_ATTRIBUTE_ID, minInterval, maxInterval); + }, MEASURED9TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAcFrequencyMinAttribute( + public void readMeasured11thHarmonicCurrentAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_MIN_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED11TH_HARMONIC_CURRENT_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60340,12 +61191,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_FREQUENCY_MIN_ATTRIBUTE_ID, true); + }, MEASURED11TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); } - public void subscribeAcFrequencyMinAttribute( + public void subscribeMeasured11thHarmonicCurrentAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_MIN_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED11TH_HARMONIC_CURRENT_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60353,12 +61204,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_FREQUENCY_MIN_ATTRIBUTE_ID, minInterval, maxInterval); + }, MEASURED11TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAcFrequencyMaxAttribute( + public void readMeasuredPhase1stHarmonicCurrentAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_MAX_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE1ST_HARMONIC_CURRENT_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60366,12 +61217,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_FREQUENCY_MAX_ATTRIBUTE_ID, true); + }, MEASURED_PHASE1ST_HARMONIC_CURRENT_ATTRIBUTE_ID, true); } - public void subscribeAcFrequencyMaxAttribute( + public void subscribeMeasuredPhase1stHarmonicCurrentAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_MAX_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE1ST_HARMONIC_CURRENT_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60379,12 +61230,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_FREQUENCY_MAX_ATTRIBUTE_ID, minInterval, maxInterval); + }, MEASURED_PHASE1ST_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readNeutralCurrentAttribute( + public void readMeasuredPhase3rdHarmonicCurrentAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NEUTRAL_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE3RD_HARMONIC_CURRENT_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60392,12 +61243,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, NEUTRAL_CURRENT_ATTRIBUTE_ID, true); + }, MEASURED_PHASE3RD_HARMONIC_CURRENT_ATTRIBUTE_ID, true); } - public void subscribeNeutralCurrentAttribute( + public void subscribeMeasuredPhase3rdHarmonicCurrentAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NEUTRAL_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE3RD_HARMONIC_CURRENT_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60405,90 +61256,90 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, NEUTRAL_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); + }, MEASURED_PHASE3RD_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readTotalActivePowerAttribute( - LongAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TOTAL_ACTIVE_POWER_ATTRIBUTE_ID); + public void readMeasuredPhase5thHarmonicCurrentAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE5TH_HARMONIC_CURRENT_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, TOTAL_ACTIVE_POWER_ATTRIBUTE_ID, true); + }, MEASURED_PHASE5TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); } - public void subscribeTotalActivePowerAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TOTAL_ACTIVE_POWER_ATTRIBUTE_ID); + public void subscribeMeasuredPhase5thHarmonicCurrentAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE5TH_HARMONIC_CURRENT_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, TOTAL_ACTIVE_POWER_ATTRIBUTE_ID, minInterval, maxInterval); + }, MEASURED_PHASE5TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readTotalReactivePowerAttribute( - LongAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TOTAL_REACTIVE_POWER_ATTRIBUTE_ID); + public void readMeasuredPhase7thHarmonicCurrentAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE7TH_HARMONIC_CURRENT_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, TOTAL_REACTIVE_POWER_ATTRIBUTE_ID, true); + }, MEASURED_PHASE7TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); } - public void subscribeTotalReactivePowerAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TOTAL_REACTIVE_POWER_ATTRIBUTE_ID); + public void subscribeMeasuredPhase7thHarmonicCurrentAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE7TH_HARMONIC_CURRENT_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, TOTAL_REACTIVE_POWER_ATTRIBUTE_ID, minInterval, maxInterval); + }, MEASURED_PHASE7TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readTotalApparentPowerAttribute( - LongAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TOTAL_APPARENT_POWER_ATTRIBUTE_ID); + public void readMeasuredPhase9thHarmonicCurrentAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE9TH_HARMONIC_CURRENT_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, TOTAL_APPARENT_POWER_ATTRIBUTE_ID, true); + }, MEASURED_PHASE9TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); } - public void subscribeTotalApparentPowerAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TOTAL_APPARENT_POWER_ATTRIBUTE_ID); + public void subscribeMeasuredPhase9thHarmonicCurrentAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE9TH_HARMONIC_CURRENT_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, TOTAL_APPARENT_POWER_ATTRIBUTE_ID, minInterval, maxInterval); + }, MEASURED_PHASE9TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readMeasured1stHarmonicCurrentAttribute( + public void readMeasuredPhase11thHarmonicCurrentAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED1ST_HARMONIC_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE11TH_HARMONIC_CURRENT_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60496,12 +61347,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED1ST_HARMONIC_CURRENT_ATTRIBUTE_ID, true); + }, MEASURED_PHASE11TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); } - public void subscribeMeasured1stHarmonicCurrentAttribute( + public void subscribeMeasuredPhase11thHarmonicCurrentAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED1ST_HARMONIC_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE11TH_HARMONIC_CURRENT_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60509,12 +61360,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED1ST_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); + }, MEASURED_PHASE11TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readMeasured3rdHarmonicCurrentAttribute( + public void readAcFrequencyMultiplierAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED3RD_HARMONIC_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_MULTIPLIER_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60522,12 +61373,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED3RD_HARMONIC_CURRENT_ATTRIBUTE_ID, true); + }, AC_FREQUENCY_MULTIPLIER_ATTRIBUTE_ID, true); } - public void subscribeMeasured3rdHarmonicCurrentAttribute( + public void subscribeAcFrequencyMultiplierAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED3RD_HARMONIC_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_MULTIPLIER_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60535,12 +61386,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED3RD_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); + }, AC_FREQUENCY_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readMeasured5thHarmonicCurrentAttribute( + public void readAcFrequencyDivisorAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED5TH_HARMONIC_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_DIVISOR_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60548,12 +61399,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED5TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); + }, AC_FREQUENCY_DIVISOR_ATTRIBUTE_ID, true); } - public void subscribeMeasured5thHarmonicCurrentAttribute( + public void subscribeAcFrequencyDivisorAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED5TH_HARMONIC_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_DIVISOR_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60561,64 +61412,64 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED5TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); + }, AC_FREQUENCY_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readMeasured7thHarmonicCurrentAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED7TH_HARMONIC_CURRENT_ATTRIBUTE_ID); + public void readPowerMultiplierAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_MULTIPLIER_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED7TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); + }, POWER_MULTIPLIER_ATTRIBUTE_ID, true); } - public void subscribeMeasured7thHarmonicCurrentAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED7TH_HARMONIC_CURRENT_ATTRIBUTE_ID); + public void subscribePowerMultiplierAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_MULTIPLIER_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED7TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); + }, POWER_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readMeasured9thHarmonicCurrentAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED9TH_HARMONIC_CURRENT_ATTRIBUTE_ID); + public void readPowerDivisorAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_DIVISOR_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED9TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); + }, POWER_DIVISOR_ATTRIBUTE_ID, true); } - public void subscribeMeasured9thHarmonicCurrentAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED9TH_HARMONIC_CURRENT_ATTRIBUTE_ID); + public void subscribePowerDivisorAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_DIVISOR_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED9TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); + }, POWER_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readMeasured11thHarmonicCurrentAttribute( + public void readHarmonicCurrentMultiplierAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED11TH_HARMONIC_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60626,12 +61477,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED11TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); + }, HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, true); } - public void subscribeMeasured11thHarmonicCurrentAttribute( + public void subscribeHarmonicCurrentMultiplierAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED11TH_HARMONIC_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60639,12 +61490,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED11TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); + }, HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readMeasuredPhase1stHarmonicCurrentAttribute( + public void readPhaseHarmonicCurrentMultiplierAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE1ST_HARMONIC_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PHASE_HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60652,12 +61503,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED_PHASE1ST_HARMONIC_CURRENT_ATTRIBUTE_ID, true); + }, PHASE_HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, true); } - public void subscribeMeasuredPhase1stHarmonicCurrentAttribute( + public void subscribePhaseHarmonicCurrentMultiplierAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE1ST_HARMONIC_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PHASE_HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60665,12 +61516,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED_PHASE1ST_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); + }, PHASE_HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readMeasuredPhase3rdHarmonicCurrentAttribute( + public void readInstantaneousVoltageAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE3RD_HARMONIC_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_VOLTAGE_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60678,12 +61529,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED_PHASE3RD_HARMONIC_CURRENT_ATTRIBUTE_ID, true); + }, INSTANTANEOUS_VOLTAGE_ATTRIBUTE_ID, true); } - public void subscribeMeasuredPhase3rdHarmonicCurrentAttribute( + public void subscribeInstantaneousVoltageAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE3RD_HARMONIC_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_VOLTAGE_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60691,12 +61542,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED_PHASE3RD_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); + }, INSTANTANEOUS_VOLTAGE_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readMeasuredPhase5thHarmonicCurrentAttribute( + public void readInstantaneousLineCurrentAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE5TH_HARMONIC_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_LINE_CURRENT_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60704,12 +61555,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED_PHASE5TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); + }, INSTANTANEOUS_LINE_CURRENT_ATTRIBUTE_ID, true); } - public void subscribeMeasuredPhase5thHarmonicCurrentAttribute( + public void subscribeInstantaneousLineCurrentAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE5TH_HARMONIC_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_LINE_CURRENT_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60717,12 +61568,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED_PHASE5TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); + }, INSTANTANEOUS_LINE_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readMeasuredPhase7thHarmonicCurrentAttribute( + public void readInstantaneousActiveCurrentAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE7TH_HARMONIC_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_ACTIVE_CURRENT_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60730,12 +61581,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED_PHASE7TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); + }, INSTANTANEOUS_ACTIVE_CURRENT_ATTRIBUTE_ID, true); } - public void subscribeMeasuredPhase7thHarmonicCurrentAttribute( + public void subscribeInstantaneousActiveCurrentAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE7TH_HARMONIC_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_ACTIVE_CURRENT_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60743,12 +61594,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED_PHASE7TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); + }, INSTANTANEOUS_ACTIVE_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readMeasuredPhase9thHarmonicCurrentAttribute( + public void readInstantaneousReactiveCurrentAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE9TH_HARMONIC_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_REACTIVE_CURRENT_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60756,12 +61607,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED_PHASE9TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); + }, INSTANTANEOUS_REACTIVE_CURRENT_ATTRIBUTE_ID, true); } - public void subscribeMeasuredPhase9thHarmonicCurrentAttribute( + public void subscribeInstantaneousReactiveCurrentAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE9TH_HARMONIC_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_REACTIVE_CURRENT_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60769,12 +61620,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED_PHASE9TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); + }, INSTANTANEOUS_REACTIVE_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readMeasuredPhase11thHarmonicCurrentAttribute( + public void readInstantaneousPowerAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE11TH_HARMONIC_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_POWER_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60782,12 +61633,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED_PHASE11TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); + }, INSTANTANEOUS_POWER_ATTRIBUTE_ID, true); } - public void subscribeMeasuredPhase11thHarmonicCurrentAttribute( + public void subscribeInstantaneousPowerAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE11TH_HARMONIC_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_POWER_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60795,12 +61646,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, MEASURED_PHASE11TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); + }, INSTANTANEOUS_POWER_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAcFrequencyMultiplierAttribute( + public void readRmsVoltageAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_MULTIPLIER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60808,12 +61659,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_FREQUENCY_MULTIPLIER_ATTRIBUTE_ID, true); + }, RMS_VOLTAGE_ATTRIBUTE_ID, true); } - public void subscribeAcFrequencyMultiplierAttribute( + public void subscribeRmsVoltageAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_MULTIPLIER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60821,12 +61672,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_FREQUENCY_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_VOLTAGE_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAcFrequencyDivisorAttribute( + public void readRmsVoltageMinAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_DIVISOR_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MIN_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60834,12 +61685,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_FREQUENCY_DIVISOR_ATTRIBUTE_ID, true); + }, RMS_VOLTAGE_MIN_ATTRIBUTE_ID, true); } - public void subscribeAcFrequencyDivisorAttribute( + public void subscribeRmsVoltageMinAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_DIVISOR_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MIN_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60847,64 +61698,64 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_FREQUENCY_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_VOLTAGE_MIN_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readPowerMultiplierAttribute( - LongAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_MULTIPLIER_ATTRIBUTE_ID); + public void readRmsVoltageMaxAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MAX_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, POWER_MULTIPLIER_ATTRIBUTE_ID, true); + }, RMS_VOLTAGE_MAX_ATTRIBUTE_ID, true); } - public void subscribePowerMultiplierAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_MULTIPLIER_ATTRIBUTE_ID); + public void subscribeRmsVoltageMaxAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MAX_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, POWER_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_VOLTAGE_MAX_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readPowerDivisorAttribute( - LongAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_DIVISOR_ATTRIBUTE_ID); + public void readRmsCurrentAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, POWER_DIVISOR_ATTRIBUTE_ID, true); + }, RMS_CURRENT_ATTRIBUTE_ID, true); } - public void subscribePowerDivisorAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_DIVISOR_ATTRIBUTE_ID); + public void subscribeRmsCurrentAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, POWER_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readHarmonicCurrentMultiplierAttribute( + public void readRmsCurrentMinAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MIN_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60912,12 +61763,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, true); + }, RMS_CURRENT_MIN_ATTRIBUTE_ID, true); } - public void subscribeHarmonicCurrentMultiplierAttribute( + public void subscribeRmsCurrentMinAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MIN_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60925,12 +61776,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_CURRENT_MIN_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readPhaseHarmonicCurrentMultiplierAttribute( + public void readRmsCurrentMaxAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PHASE_HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MAX_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60938,12 +61789,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, PHASE_HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, true); + }, RMS_CURRENT_MAX_ATTRIBUTE_ID, true); } - public void subscribePhaseHarmonicCurrentMultiplierAttribute( + public void subscribeRmsCurrentMaxAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PHASE_HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MAX_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60951,12 +61802,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, PHASE_HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_CURRENT_MAX_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readInstantaneousVoltageAttribute( + public void readActivePowerAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_VOLTAGE_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60964,12 +61815,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, INSTANTANEOUS_VOLTAGE_ATTRIBUTE_ID, true); + }, ACTIVE_POWER_ATTRIBUTE_ID, true); } - public void subscribeInstantaneousVoltageAttribute( + public void subscribeActivePowerAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_VOLTAGE_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60977,12 +61828,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, INSTANTANEOUS_VOLTAGE_ATTRIBUTE_ID, minInterval, maxInterval); + }, ACTIVE_POWER_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readInstantaneousLineCurrentAttribute( + public void readActivePowerMinAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_LINE_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MIN_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -60990,12 +61841,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, INSTANTANEOUS_LINE_CURRENT_ATTRIBUTE_ID, true); + }, ACTIVE_POWER_MIN_ATTRIBUTE_ID, true); } - public void subscribeInstantaneousLineCurrentAttribute( + public void subscribeActivePowerMinAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_LINE_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MIN_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61003,12 +61854,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, INSTANTANEOUS_LINE_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); + }, ACTIVE_POWER_MIN_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readInstantaneousActiveCurrentAttribute( + public void readActivePowerMaxAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_ACTIVE_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MAX_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61016,12 +61867,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, INSTANTANEOUS_ACTIVE_CURRENT_ATTRIBUTE_ID, true); + }, ACTIVE_POWER_MAX_ATTRIBUTE_ID, true); } - public void subscribeInstantaneousActiveCurrentAttribute( + public void subscribeActivePowerMaxAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_ACTIVE_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MAX_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61029,12 +61880,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, INSTANTANEOUS_ACTIVE_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); + }, ACTIVE_POWER_MAX_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readInstantaneousReactiveCurrentAttribute( + public void readReactivePowerAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_REACTIVE_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_POWER_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61042,12 +61893,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, INSTANTANEOUS_REACTIVE_CURRENT_ATTRIBUTE_ID, true); + }, REACTIVE_POWER_ATTRIBUTE_ID, true); } - public void subscribeInstantaneousReactiveCurrentAttribute( + public void subscribeReactivePowerAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_REACTIVE_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_POWER_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61055,12 +61906,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, INSTANTANEOUS_REACTIVE_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); + }, REACTIVE_POWER_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readInstantaneousPowerAttribute( + public void readApparentPowerAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_POWER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, APPARENT_POWER_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61068,12 +61919,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, INSTANTANEOUS_POWER_ATTRIBUTE_ID, true); + }, APPARENT_POWER_ATTRIBUTE_ID, true); } - public void subscribeInstantaneousPowerAttribute( + public void subscribeApparentPowerAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_POWER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, APPARENT_POWER_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61081,12 +61932,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, INSTANTANEOUS_POWER_ATTRIBUTE_ID, minInterval, maxInterval); + }, APPARENT_POWER_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsVoltageAttribute( + public void readPowerFactorAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_FACTOR_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61094,12 +61945,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_ATTRIBUTE_ID, true); + }, POWER_FACTOR_ATTRIBUTE_ID, true); } - public void subscribeRmsVoltageAttribute( + public void subscribePowerFactorAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_FACTOR_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61107,12 +61958,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_ATTRIBUTE_ID, minInterval, maxInterval); + }, POWER_FACTOR_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsVoltageMinAttribute( + public void readAverageRmsVoltageMeasurementPeriodAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MIN_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61120,12 +61971,21 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_MIN_ATTRIBUTE_ID, true); + }, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_ATTRIBUTE_ID, true); } - public void subscribeRmsVoltageMinAttribute( + public void writeAverageRmsVoltageMeasurementPeriodAttribute(DefaultClusterCallback callback, Integer value) { + writeAverageRmsVoltageMeasurementPeriodAttribute(callback, value, 0); + } + + public void writeAverageRmsVoltageMeasurementPeriodAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeAverageRmsVoltageMeasurementPeriodAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MIN_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61133,12 +61993,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_MIN_ATTRIBUTE_ID, minInterval, maxInterval); + }, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsVoltageMaxAttribute( + public void readAverageRmsUnderVoltageCounterAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MAX_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61146,12 +62006,21 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_MAX_ATTRIBUTE_ID, true); + }, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_ATTRIBUTE_ID, true); } - public void subscribeRmsVoltageMaxAttribute( + public void writeAverageRmsUnderVoltageCounterAttribute(DefaultClusterCallback callback, Integer value) { + writeAverageRmsUnderVoltageCounterAttribute(callback, value, 0); + } + + public void writeAverageRmsUnderVoltageCounterAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeAverageRmsUnderVoltageCounterAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MAX_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61159,12 +62028,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_MAX_ATTRIBUTE_ID, minInterval, maxInterval); + }, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsCurrentAttribute( + public void readRmsExtremeOverVoltagePeriodAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_PERIOD_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61172,12 +62041,21 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_CURRENT_ATTRIBUTE_ID, true); + }, RMS_EXTREME_OVER_VOLTAGE_PERIOD_ATTRIBUTE_ID, true); } - public void subscribeRmsCurrentAttribute( + public void writeRmsExtremeOverVoltagePeriodAttribute(DefaultClusterCallback callback, Integer value) { + writeRmsExtremeOverVoltagePeriodAttribute(callback, value, 0); + } + + public void writeRmsExtremeOverVoltagePeriodAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), RMS_EXTREME_OVER_VOLTAGE_PERIOD_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeRmsExtremeOverVoltagePeriodAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_PERIOD_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61185,12 +62063,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_EXTREME_OVER_VOLTAGE_PERIOD_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsCurrentMinAttribute( + public void readRmsExtremeUnderVoltagePeriodAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MIN_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61198,12 +62076,21 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_CURRENT_MIN_ATTRIBUTE_ID, true); + }, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_ATTRIBUTE_ID, true); } - public void subscribeRmsCurrentMinAttribute( + public void writeRmsExtremeUnderVoltagePeriodAttribute(DefaultClusterCallback callback, Integer value) { + writeRmsExtremeUnderVoltagePeriodAttribute(callback, value, 0); + } + + public void writeRmsExtremeUnderVoltagePeriodAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), RMS_EXTREME_UNDER_VOLTAGE_PERIOD_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeRmsExtremeUnderVoltagePeriodAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MIN_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61211,12 +62098,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_CURRENT_MIN_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsCurrentMaxAttribute( + public void readRmsVoltageSagPeriodAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MAX_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_PERIOD_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61224,12 +62111,21 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_CURRENT_MAX_ATTRIBUTE_ID, true); + }, RMS_VOLTAGE_SAG_PERIOD_ATTRIBUTE_ID, true); } - public void subscribeRmsCurrentMaxAttribute( + public void writeRmsVoltageSagPeriodAttribute(DefaultClusterCallback callback, Integer value) { + writeRmsVoltageSagPeriodAttribute(callback, value, 0); + } + + public void writeRmsVoltageSagPeriodAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), RMS_VOLTAGE_SAG_PERIOD_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeRmsVoltageSagPeriodAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MAX_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_PERIOD_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61237,12 +62133,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_CURRENT_MAX_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_VOLTAGE_SAG_PERIOD_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readActivePowerAttribute( + public void readRmsVoltageSwellPeriodAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_PERIOD_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61250,12 +62146,21 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_POWER_ATTRIBUTE_ID, true); + }, RMS_VOLTAGE_SWELL_PERIOD_ATTRIBUTE_ID, true); } - public void subscribeActivePowerAttribute( + public void writeRmsVoltageSwellPeriodAttribute(DefaultClusterCallback callback, Integer value) { + writeRmsVoltageSwellPeriodAttribute(callback, value, 0); + } + + public void writeRmsVoltageSwellPeriodAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), RMS_VOLTAGE_SWELL_PERIOD_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeRmsVoltageSwellPeriodAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_PERIOD_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61263,12 +62168,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_POWER_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_VOLTAGE_SWELL_PERIOD_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readActivePowerMinAttribute( + public void readAcVoltageMultiplierAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MIN_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61276,12 +62181,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_POWER_MIN_ATTRIBUTE_ID, true); + }, AC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID, true); } - public void subscribeActivePowerMinAttribute( + public void subscribeAcVoltageMultiplierAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MIN_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61289,12 +62194,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_POWER_MIN_ATTRIBUTE_ID, minInterval, maxInterval); + }, AC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readActivePowerMaxAttribute( + public void readAcVoltageDivisorAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MAX_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_VOLTAGE_DIVISOR_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61302,12 +62207,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_POWER_MAX_ATTRIBUTE_ID, true); + }, AC_VOLTAGE_DIVISOR_ATTRIBUTE_ID, true); } - public void subscribeActivePowerMaxAttribute( + public void subscribeAcVoltageDivisorAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MAX_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_VOLTAGE_DIVISOR_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61315,12 +62220,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_POWER_MAX_ATTRIBUTE_ID, minInterval, maxInterval); + }, AC_VOLTAGE_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readReactivePowerAttribute( + public void readAcCurrentMultiplierAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_POWER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61328,12 +62233,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, REACTIVE_POWER_ATTRIBUTE_ID, true); + }, AC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, true); } - public void subscribeReactivePowerAttribute( + public void subscribeAcCurrentMultiplierAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_POWER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61341,12 +62246,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, REACTIVE_POWER_ATTRIBUTE_ID, minInterval, maxInterval); + }, AC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readApparentPowerAttribute( + public void readAcCurrentDivisorAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, APPARENT_POWER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_CURRENT_DIVISOR_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61354,12 +62259,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, APPARENT_POWER_ATTRIBUTE_ID, true); + }, AC_CURRENT_DIVISOR_ATTRIBUTE_ID, true); } - public void subscribeApparentPowerAttribute( + public void subscribeAcCurrentDivisorAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, APPARENT_POWER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_CURRENT_DIVISOR_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61367,12 +62272,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, APPARENT_POWER_ATTRIBUTE_ID, minInterval, maxInterval); + }, AC_CURRENT_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readPowerFactorAttribute( + public void readAcPowerMultiplierAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_FACTOR_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_POWER_MULTIPLIER_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61380,12 +62285,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, POWER_FACTOR_ATTRIBUTE_ID, true); + }, AC_POWER_MULTIPLIER_ATTRIBUTE_ID, true); } - public void subscribePowerFactorAttribute( + public void subscribeAcPowerMultiplierAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_FACTOR_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_POWER_MULTIPLIER_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61393,12 +62298,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, POWER_FACTOR_ATTRIBUTE_ID, minInterval, maxInterval); + }, AC_POWER_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAverageRmsVoltageMeasurementPeriodAttribute( + public void readAcPowerDivisorAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_POWER_DIVISOR_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61406,21 +62311,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_ATTRIBUTE_ID, true); - } - - public void writeAverageRmsVoltageMeasurementPeriodAttribute(DefaultClusterCallback callback, Integer value) { - writeAverageRmsVoltageMeasurementPeriodAttribute(callback, value, 0); - } - - public void writeAverageRmsVoltageMeasurementPeriodAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + }, AC_POWER_DIVISOR_ATTRIBUTE_ID, true); } - public void subscribeAverageRmsVoltageMeasurementPeriodAttribute( + public void subscribeAcPowerDivisorAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_POWER_DIVISOR_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61428,12 +62324,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_ATTRIBUTE_ID, minInterval, maxInterval); + }, AC_POWER_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAverageRmsUnderVoltageCounterAttribute( + public void readOverloadAlarmsMaskAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61441,21 +62337,21 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_ATTRIBUTE_ID, true); + }, OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID, true); } - public void writeAverageRmsUnderVoltageCounterAttribute(DefaultClusterCallback callback, Integer value) { - writeAverageRmsUnderVoltageCounterAttribute(callback, value, 0); + public void writeOverloadAlarmsMaskAttribute(DefaultClusterCallback callback, Integer value) { + writeOverloadAlarmsMaskAttribute(callback, value, 0); } - public void writeAverageRmsUnderVoltageCounterAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + public void writeOverloadAlarmsMaskAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + writeAttribute(new WriteAttributesCallbackImpl(callback), OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); } - public void subscribeAverageRmsUnderVoltageCounterAttribute( + public void subscribeOverloadAlarmsMaskAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61463,12 +62359,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_ATTRIBUTE_ID, minInterval, maxInterval); + }, OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsExtremeOverVoltagePeriodAttribute( + public void readVoltageOverloadAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_PERIOD_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, VOLTAGE_OVERLOAD_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61476,21 +62372,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_EXTREME_OVER_VOLTAGE_PERIOD_ATTRIBUTE_ID, true); - } - - public void writeRmsExtremeOverVoltagePeriodAttribute(DefaultClusterCallback callback, Integer value) { - writeRmsExtremeOverVoltagePeriodAttribute(callback, value, 0); - } - - public void writeRmsExtremeOverVoltagePeriodAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), RMS_EXTREME_OVER_VOLTAGE_PERIOD_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + }, VOLTAGE_OVERLOAD_ATTRIBUTE_ID, true); } - public void subscribeRmsExtremeOverVoltagePeriodAttribute( + public void subscribeVoltageOverloadAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_PERIOD_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, VOLTAGE_OVERLOAD_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61498,12 +62385,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_EXTREME_OVER_VOLTAGE_PERIOD_ATTRIBUTE_ID, minInterval, maxInterval); + }, VOLTAGE_OVERLOAD_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsExtremeUnderVoltagePeriodAttribute( + public void readCurrentOverloadAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_OVERLOAD_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61511,21 +62398,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_ATTRIBUTE_ID, true); - } - - public void writeRmsExtremeUnderVoltagePeriodAttribute(DefaultClusterCallback callback, Integer value) { - writeRmsExtremeUnderVoltagePeriodAttribute(callback, value, 0); - } - - public void writeRmsExtremeUnderVoltagePeriodAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), RMS_EXTREME_UNDER_VOLTAGE_PERIOD_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + }, CURRENT_OVERLOAD_ATTRIBUTE_ID, true); } - public void subscribeRmsExtremeUnderVoltagePeriodAttribute( + public void subscribeCurrentOverloadAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_OVERLOAD_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61533,12 +62411,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_ATTRIBUTE_ID, minInterval, maxInterval); + }, CURRENT_OVERLOAD_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsVoltageSagPeriodAttribute( + public void readAcOverloadAlarmsMaskAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_PERIOD_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61546,21 +62424,21 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_SAG_PERIOD_ATTRIBUTE_ID, true); + }, AC_OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID, true); } - public void writeRmsVoltageSagPeriodAttribute(DefaultClusterCallback callback, Integer value) { - writeRmsVoltageSagPeriodAttribute(callback, value, 0); + public void writeAcOverloadAlarmsMaskAttribute(DefaultClusterCallback callback, Integer value) { + writeAcOverloadAlarmsMaskAttribute(callback, value, 0); } - public void writeRmsVoltageSagPeriodAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + public void writeAcOverloadAlarmsMaskAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), RMS_VOLTAGE_SAG_PERIOD_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + writeAttribute(new WriteAttributesCallbackImpl(callback), AC_OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); } - public void subscribeRmsVoltageSagPeriodAttribute( + public void subscribeAcOverloadAlarmsMaskAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_PERIOD_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61568,12 +62446,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_SAG_PERIOD_ATTRIBUTE_ID, minInterval, maxInterval); + }, AC_OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsVoltageSwellPeriodAttribute( + public void readAcVoltageOverloadAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_PERIOD_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_VOLTAGE_OVERLOAD_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61581,21 +62459,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_SWELL_PERIOD_ATTRIBUTE_ID, true); - } - - public void writeRmsVoltageSwellPeriodAttribute(DefaultClusterCallback callback, Integer value) { - writeRmsVoltageSwellPeriodAttribute(callback, value, 0); - } - - public void writeRmsVoltageSwellPeriodAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), RMS_VOLTAGE_SWELL_PERIOD_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + }, AC_VOLTAGE_OVERLOAD_ATTRIBUTE_ID, true); } - public void subscribeRmsVoltageSwellPeriodAttribute( + public void subscribeAcVoltageOverloadAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_PERIOD_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_VOLTAGE_OVERLOAD_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61603,12 +62472,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_SWELL_PERIOD_ATTRIBUTE_ID, minInterval, maxInterval); + }, AC_VOLTAGE_OVERLOAD_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAcVoltageMultiplierAttribute( + public void readAcCurrentOverloadAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_CURRENT_OVERLOAD_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61616,12 +62485,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID, true); + }, AC_CURRENT_OVERLOAD_ATTRIBUTE_ID, true); } - public void subscribeAcVoltageMultiplierAttribute( + public void subscribeAcCurrentOverloadAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_CURRENT_OVERLOAD_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61629,12 +62498,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); + }, AC_CURRENT_OVERLOAD_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAcVoltageDivisorAttribute( + public void readAcActivePowerOverloadAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_VOLTAGE_DIVISOR_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_ACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61642,12 +62511,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_VOLTAGE_DIVISOR_ATTRIBUTE_ID, true); + }, AC_ACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID, true); } - public void subscribeAcVoltageDivisorAttribute( + public void subscribeAcActivePowerOverloadAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_VOLTAGE_DIVISOR_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_ACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61655,12 +62524,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_VOLTAGE_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); + }, AC_ACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAcCurrentMultiplierAttribute( + public void readAcReactivePowerOverloadAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_REACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61668,12 +62537,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, true); + }, AC_REACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID, true); } - public void subscribeAcCurrentMultiplierAttribute( + public void subscribeAcReactivePowerOverloadAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_REACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61681,12 +62550,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); + }, AC_REACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAcCurrentDivisorAttribute( + public void readAverageRmsOverVoltageAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_CURRENT_DIVISOR_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_OVER_VOLTAGE_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61694,12 +62563,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_CURRENT_DIVISOR_ATTRIBUTE_ID, true); + }, AVERAGE_RMS_OVER_VOLTAGE_ATTRIBUTE_ID, true); } - public void subscribeAcCurrentDivisorAttribute( + public void subscribeAverageRmsOverVoltageAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_CURRENT_DIVISOR_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_OVER_VOLTAGE_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61707,12 +62576,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_CURRENT_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); + }, AVERAGE_RMS_OVER_VOLTAGE_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAcPowerMultiplierAttribute( + public void readAverageRmsUnderVoltageAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_POWER_MULTIPLIER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61720,12 +62589,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_POWER_MULTIPLIER_ATTRIBUTE_ID, true); + }, AVERAGE_RMS_UNDER_VOLTAGE_ATTRIBUTE_ID, true); } - public void subscribeAcPowerMultiplierAttribute( + public void subscribeAverageRmsUnderVoltageAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_POWER_MULTIPLIER_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61733,12 +62602,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_POWER_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); + }, AVERAGE_RMS_UNDER_VOLTAGE_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAcPowerDivisorAttribute( + public void readRmsExtremeOverVoltageAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_POWER_DIVISOR_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61746,12 +62615,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_POWER_DIVISOR_ATTRIBUTE_ID, true); + }, RMS_EXTREME_OVER_VOLTAGE_ATTRIBUTE_ID, true); } - public void subscribeAcPowerDivisorAttribute( + public void subscribeRmsExtremeOverVoltageAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_POWER_DIVISOR_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61759,12 +62628,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_POWER_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_EXTREME_OVER_VOLTAGE_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readOverloadAlarmsMaskAttribute( + public void readRmsExtremeUnderVoltageAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61772,21 +62641,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID, true); - } - - public void writeOverloadAlarmsMaskAttribute(DefaultClusterCallback callback, Integer value) { - writeOverloadAlarmsMaskAttribute(callback, value, 0); - } - - public void writeOverloadAlarmsMaskAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + }, RMS_EXTREME_UNDER_VOLTAGE_ATTRIBUTE_ID, true); } - public void subscribeOverloadAlarmsMaskAttribute( + public void subscribeRmsExtremeUnderVoltageAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61794,12 +62654,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_EXTREME_UNDER_VOLTAGE_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readVoltageOverloadAttribute( + public void readRmsVoltageSagAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, VOLTAGE_OVERLOAD_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61807,12 +62667,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, VOLTAGE_OVERLOAD_ATTRIBUTE_ID, true); + }, RMS_VOLTAGE_SAG_ATTRIBUTE_ID, true); } - public void subscribeVoltageOverloadAttribute( + public void subscribeRmsVoltageSagAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, VOLTAGE_OVERLOAD_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61820,12 +62680,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, VOLTAGE_OVERLOAD_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_VOLTAGE_SAG_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readCurrentOverloadAttribute( + public void readRmsVoltageSwellAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_OVERLOAD_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61833,12 +62693,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, CURRENT_OVERLOAD_ATTRIBUTE_ID, true); + }, RMS_VOLTAGE_SWELL_ATTRIBUTE_ID, true); } - public void subscribeCurrentOverloadAttribute( + public void subscribeRmsVoltageSwellAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_OVERLOAD_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61846,12 +62706,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, CURRENT_OVERLOAD_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_VOLTAGE_SWELL_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAcOverloadAlarmsMaskAttribute( + public void readLineCurrentPhaseBAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LINE_CURRENT_PHASE_B_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61859,21 +62719,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID, true); - } - - public void writeAcOverloadAlarmsMaskAttribute(DefaultClusterCallback callback, Integer value) { - writeAcOverloadAlarmsMaskAttribute(callback, value, 0); - } - - public void writeAcOverloadAlarmsMaskAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), AC_OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + }, LINE_CURRENT_PHASE_B_ATTRIBUTE_ID, true); } - public void subscribeAcOverloadAlarmsMaskAttribute( + public void subscribeLineCurrentPhaseBAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LINE_CURRENT_PHASE_B_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61881,12 +62732,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID, minInterval, maxInterval); + }, LINE_CURRENT_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAcVoltageOverloadAttribute( + public void readActiveCurrentPhaseBAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_VOLTAGE_OVERLOAD_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61894,12 +62745,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_VOLTAGE_OVERLOAD_ATTRIBUTE_ID, true); + }, ACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID, true); } - public void subscribeAcVoltageOverloadAttribute( + public void subscribeActiveCurrentPhaseBAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_VOLTAGE_OVERLOAD_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61907,12 +62758,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_VOLTAGE_OVERLOAD_ATTRIBUTE_ID, minInterval, maxInterval); + }, ACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAcCurrentOverloadAttribute( + public void readReactiveCurrentPhaseBAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_CURRENT_OVERLOAD_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61920,12 +62771,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_CURRENT_OVERLOAD_ATTRIBUTE_ID, true); + }, REACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID, true); } - public void subscribeAcCurrentOverloadAttribute( + public void subscribeReactiveCurrentPhaseBAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_CURRENT_OVERLOAD_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61933,12 +62784,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_CURRENT_OVERLOAD_ATTRIBUTE_ID, minInterval, maxInterval); + }, REACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAcActivePowerOverloadAttribute( + public void readRmsVoltagePhaseBAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_ACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_PHASE_B_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61946,12 +62797,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_ACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID, true); + }, RMS_VOLTAGE_PHASE_B_ATTRIBUTE_ID, true); } - public void subscribeAcActivePowerOverloadAttribute( + public void subscribeRmsVoltagePhaseBAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_ACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_PHASE_B_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61959,12 +62810,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_ACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_VOLTAGE_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAcReactivePowerOverloadAttribute( + public void readRmsVoltageMinPhaseBAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_REACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MIN_PHASE_B_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61972,12 +62823,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_REACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID, true); + }, RMS_VOLTAGE_MIN_PHASE_B_ATTRIBUTE_ID, true); } - public void subscribeAcReactivePowerOverloadAttribute( + public void subscribeRmsVoltageMinPhaseBAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_REACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MIN_PHASE_B_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61985,12 +62836,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AC_REACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_VOLTAGE_MIN_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAverageRmsOverVoltageAttribute( + public void readRmsVoltageMaxPhaseBAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_OVER_VOLTAGE_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MAX_PHASE_B_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -61998,12 +62849,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AVERAGE_RMS_OVER_VOLTAGE_ATTRIBUTE_ID, true); + }, RMS_VOLTAGE_MAX_PHASE_B_ATTRIBUTE_ID, true); } - public void subscribeAverageRmsOverVoltageAttribute( + public void subscribeRmsVoltageMaxPhaseBAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_OVER_VOLTAGE_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MAX_PHASE_B_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62011,12 +62862,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AVERAGE_RMS_OVER_VOLTAGE_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_VOLTAGE_MAX_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAverageRmsUnderVoltageAttribute( + public void readRmsCurrentPhaseBAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_PHASE_B_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62024,12 +62875,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AVERAGE_RMS_UNDER_VOLTAGE_ATTRIBUTE_ID, true); + }, RMS_CURRENT_PHASE_B_ATTRIBUTE_ID, true); } - public void subscribeAverageRmsUnderVoltageAttribute( + public void subscribeRmsCurrentPhaseBAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_PHASE_B_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62037,12 +62888,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AVERAGE_RMS_UNDER_VOLTAGE_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_CURRENT_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsExtremeOverVoltageAttribute( + public void readRmsCurrentMinPhaseBAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MIN_PHASE_B_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62050,12 +62901,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_EXTREME_OVER_VOLTAGE_ATTRIBUTE_ID, true); + }, RMS_CURRENT_MIN_PHASE_B_ATTRIBUTE_ID, true); } - public void subscribeRmsExtremeOverVoltageAttribute( + public void subscribeRmsCurrentMinPhaseBAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MIN_PHASE_B_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62063,12 +62914,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_EXTREME_OVER_VOLTAGE_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_CURRENT_MIN_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsExtremeUnderVoltageAttribute( + public void readRmsCurrentMaxPhaseBAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MAX_PHASE_B_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62076,12 +62927,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_EXTREME_UNDER_VOLTAGE_ATTRIBUTE_ID, true); + }, RMS_CURRENT_MAX_PHASE_B_ATTRIBUTE_ID, true); } - public void subscribeRmsExtremeUnderVoltageAttribute( + public void subscribeRmsCurrentMaxPhaseBAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MAX_PHASE_B_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62089,12 +62940,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_EXTREME_UNDER_VOLTAGE_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_CURRENT_MAX_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsVoltageSagAttribute( + public void readActivePowerPhaseBAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_PHASE_B_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62102,12 +62953,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_SAG_ATTRIBUTE_ID, true); + }, ACTIVE_POWER_PHASE_B_ATTRIBUTE_ID, true); } - public void subscribeRmsVoltageSagAttribute( + public void subscribeActivePowerPhaseBAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_PHASE_B_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62115,12 +62966,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_SAG_ATTRIBUTE_ID, minInterval, maxInterval); + }, ACTIVE_POWER_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsVoltageSwellAttribute( + public void readActivePowerMinPhaseBAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MIN_PHASE_B_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62128,12 +62979,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_SWELL_ATTRIBUTE_ID, true); + }, ACTIVE_POWER_MIN_PHASE_B_ATTRIBUTE_ID, true); } - public void subscribeRmsVoltageSwellAttribute( + public void subscribeActivePowerMinPhaseBAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MIN_PHASE_B_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62141,12 +62992,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_SWELL_ATTRIBUTE_ID, minInterval, maxInterval); + }, ACTIVE_POWER_MIN_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readLineCurrentPhaseBAttribute( + public void readActivePowerMaxPhaseBAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LINE_CURRENT_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MAX_PHASE_B_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62154,12 +63005,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, LINE_CURRENT_PHASE_B_ATTRIBUTE_ID, true); + }, ACTIVE_POWER_MAX_PHASE_B_ATTRIBUTE_ID, true); } - public void subscribeLineCurrentPhaseBAttribute( + public void subscribeActivePowerMaxPhaseBAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LINE_CURRENT_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MAX_PHASE_B_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62167,12 +63018,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, LINE_CURRENT_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); + }, ACTIVE_POWER_MAX_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readActiveCurrentPhaseBAttribute( + public void readReactivePowerPhaseBAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_POWER_PHASE_B_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62180,12 +63031,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID, true); + }, REACTIVE_POWER_PHASE_B_ATTRIBUTE_ID, true); } - public void subscribeActiveCurrentPhaseBAttribute( + public void subscribeReactivePowerPhaseBAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_POWER_PHASE_B_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62193,12 +63044,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); + }, REACTIVE_POWER_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readReactiveCurrentPhaseBAttribute( + public void readApparentPowerPhaseBAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, APPARENT_POWER_PHASE_B_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62206,12 +63057,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, REACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID, true); + }, APPARENT_POWER_PHASE_B_ATTRIBUTE_ID, true); } - public void subscribeReactiveCurrentPhaseBAttribute( + public void subscribeApparentPowerPhaseBAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, APPARENT_POWER_PHASE_B_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62219,12 +63070,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, REACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); + }, APPARENT_POWER_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsVoltagePhaseBAttribute( + public void readPowerFactorPhaseBAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_FACTOR_PHASE_B_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62232,12 +63083,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_PHASE_B_ATTRIBUTE_ID, true); + }, POWER_FACTOR_PHASE_B_ATTRIBUTE_ID, true); } - public void subscribeRmsVoltagePhaseBAttribute( + public void subscribePowerFactorPhaseBAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_FACTOR_PHASE_B_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62245,12 +63096,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); + }, POWER_FACTOR_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsVoltageMinPhaseBAttribute( + public void readAverageRmsVoltageMeasurementPeriodPhaseBAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MIN_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_B_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62258,12 +63109,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_MIN_PHASE_B_ATTRIBUTE_ID, true); + }, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_B_ATTRIBUTE_ID, true); } - public void subscribeRmsVoltageMinPhaseBAttribute( + public void subscribeAverageRmsVoltageMeasurementPeriodPhaseBAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MIN_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_B_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62271,12 +63122,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_MIN_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); + }, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsVoltageMaxPhaseBAttribute( + public void readAverageRmsOverVoltageCounterPhaseBAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MAX_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62284,12 +63135,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_MAX_PHASE_B_ATTRIBUTE_ID, true); + }, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID, true); } - public void subscribeRmsVoltageMaxPhaseBAttribute( + public void subscribeAverageRmsOverVoltageCounterPhaseBAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MAX_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62297,12 +63148,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_MAX_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); + }, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsCurrentPhaseBAttribute( + public void readAverageRmsUnderVoltageCounterPhaseBAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62310,12 +63161,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_CURRENT_PHASE_B_ATTRIBUTE_ID, true); + }, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID, true); } - public void subscribeRmsCurrentPhaseBAttribute( + public void subscribeAverageRmsUnderVoltageCounterPhaseBAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62323,12 +63174,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_CURRENT_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); + }, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsCurrentMinPhaseBAttribute( + public void readRmsExtremeOverVoltagePeriodPhaseBAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MIN_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62336,12 +63187,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_CURRENT_MIN_PHASE_B_ATTRIBUTE_ID, true); + }, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID, true); } - public void subscribeRmsCurrentMinPhaseBAttribute( + public void subscribeRmsExtremeOverVoltagePeriodPhaseBAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MIN_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62349,12 +63200,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_CURRENT_MIN_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsCurrentMaxPhaseBAttribute( + public void readRmsExtremeUnderVoltagePeriodPhaseBAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MAX_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62362,12 +63213,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_CURRENT_MAX_PHASE_B_ATTRIBUTE_ID, true); + }, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID, true); } - public void subscribeRmsCurrentMaxPhaseBAttribute( + public void subscribeRmsExtremeUnderVoltagePeriodPhaseBAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MAX_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62375,12 +63226,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_CURRENT_MAX_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readActivePowerPhaseBAttribute( + public void readRmsVoltageSagPeriodPhaseBAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_PERIOD_PHASE_B_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62388,12 +63239,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_POWER_PHASE_B_ATTRIBUTE_ID, true); + }, RMS_VOLTAGE_SAG_PERIOD_PHASE_B_ATTRIBUTE_ID, true); } - public void subscribeActivePowerPhaseBAttribute( + public void subscribeRmsVoltageSagPeriodPhaseBAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_PERIOD_PHASE_B_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62401,12 +63252,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_POWER_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_VOLTAGE_SAG_PERIOD_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readActivePowerMinPhaseBAttribute( + public void readRmsVoltageSwellPeriodPhaseBAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MIN_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_PERIOD_PHASE_B_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62414,12 +63265,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_POWER_MIN_PHASE_B_ATTRIBUTE_ID, true); + }, RMS_VOLTAGE_SWELL_PERIOD_PHASE_B_ATTRIBUTE_ID, true); } - public void subscribeActivePowerMinPhaseBAttribute( + public void subscribeRmsVoltageSwellPeriodPhaseBAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MIN_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_PERIOD_PHASE_B_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62427,12 +63278,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_POWER_MIN_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_VOLTAGE_SWELL_PERIOD_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readActivePowerMaxPhaseBAttribute( + public void readLineCurrentPhaseCAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MAX_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LINE_CURRENT_PHASE_C_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62440,12 +63291,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_POWER_MAX_PHASE_B_ATTRIBUTE_ID, true); + }, LINE_CURRENT_PHASE_C_ATTRIBUTE_ID, true); } - public void subscribeActivePowerMaxPhaseBAttribute( + public void subscribeLineCurrentPhaseCAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MAX_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LINE_CURRENT_PHASE_C_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62453,12 +63304,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_POWER_MAX_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); + }, LINE_CURRENT_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readReactivePowerPhaseBAttribute( + public void readActiveCurrentPhaseCAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_POWER_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62466,12 +63317,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, REACTIVE_POWER_PHASE_B_ATTRIBUTE_ID, true); + }, ACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID, true); } - public void subscribeReactivePowerPhaseBAttribute( + public void subscribeActiveCurrentPhaseCAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_POWER_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62479,12 +63330,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, REACTIVE_POWER_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); + }, ACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readApparentPowerPhaseBAttribute( + public void readReactiveCurrentPhaseCAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, APPARENT_POWER_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62492,12 +63343,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, APPARENT_POWER_PHASE_B_ATTRIBUTE_ID, true); + }, REACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID, true); } - public void subscribeApparentPowerPhaseBAttribute( + public void subscribeReactiveCurrentPhaseCAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, APPARENT_POWER_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62505,12 +63356,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, APPARENT_POWER_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); + }, REACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readPowerFactorPhaseBAttribute( + public void readRmsVoltagePhaseCAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_FACTOR_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_PHASE_C_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62518,12 +63369,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, POWER_FACTOR_PHASE_B_ATTRIBUTE_ID, true); + }, RMS_VOLTAGE_PHASE_C_ATTRIBUTE_ID, true); } - public void subscribePowerFactorPhaseBAttribute( + public void subscribeRmsVoltagePhaseCAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_FACTOR_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_PHASE_C_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62531,12 +63382,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, POWER_FACTOR_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_VOLTAGE_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAverageRmsVoltageMeasurementPeriodPhaseBAttribute( + public void readRmsVoltageMinPhaseCAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MIN_PHASE_C_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62544,12 +63395,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_B_ATTRIBUTE_ID, true); + }, RMS_VOLTAGE_MIN_PHASE_C_ATTRIBUTE_ID, true); } - public void subscribeAverageRmsVoltageMeasurementPeriodPhaseBAttribute( + public void subscribeRmsVoltageMinPhaseCAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MIN_PHASE_C_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62557,12 +63408,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_VOLTAGE_MIN_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAverageRmsOverVoltageCounterPhaseBAttribute( + public void readRmsVoltageMaxPhaseCAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MAX_PHASE_C_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62570,12 +63421,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID, true); + }, RMS_VOLTAGE_MAX_PHASE_C_ATTRIBUTE_ID, true); } - public void subscribeAverageRmsOverVoltageCounterPhaseBAttribute( + public void subscribeRmsVoltageMaxPhaseCAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MAX_PHASE_C_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62583,12 +63434,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_VOLTAGE_MAX_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAverageRmsUnderVoltageCounterPhaseBAttribute( + public void readRmsCurrentPhaseCAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_PHASE_C_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62596,12 +63447,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID, true); + }, RMS_CURRENT_PHASE_C_ATTRIBUTE_ID, true); } - public void subscribeAverageRmsUnderVoltageCounterPhaseBAttribute( + public void subscribeRmsCurrentPhaseCAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_PHASE_C_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62609,12 +63460,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_CURRENT_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsExtremeOverVoltagePeriodPhaseBAttribute( + public void readRmsCurrentMinPhaseCAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MIN_PHASE_C_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62622,12 +63473,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID, true); + }, RMS_CURRENT_MIN_PHASE_C_ATTRIBUTE_ID, true); } - public void subscribeRmsExtremeOverVoltagePeriodPhaseBAttribute( + public void subscribeRmsCurrentMinPhaseCAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MIN_PHASE_C_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62635,12 +63486,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_CURRENT_MIN_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsExtremeUnderVoltagePeriodPhaseBAttribute( + public void readRmsCurrentMaxPhaseCAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MAX_PHASE_C_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62648,12 +63499,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID, true); + }, RMS_CURRENT_MAX_PHASE_C_ATTRIBUTE_ID, true); } - public void subscribeRmsExtremeUnderVoltagePeriodPhaseBAttribute( + public void subscribeRmsCurrentMaxPhaseCAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MAX_PHASE_C_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62661,12 +63512,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_CURRENT_MAX_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsVoltageSagPeriodPhaseBAttribute( + public void readActivePowerPhaseCAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_PERIOD_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_PHASE_C_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62674,12 +63525,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_SAG_PERIOD_PHASE_B_ATTRIBUTE_ID, true); + }, ACTIVE_POWER_PHASE_C_ATTRIBUTE_ID, true); } - public void subscribeRmsVoltageSagPeriodPhaseBAttribute( + public void subscribeActivePowerPhaseCAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_PERIOD_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_PHASE_C_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62687,12 +63538,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_SAG_PERIOD_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); + }, ACTIVE_POWER_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsVoltageSwellPeriodPhaseBAttribute( + public void readActivePowerMinPhaseCAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_PERIOD_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MIN_PHASE_C_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62700,12 +63551,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_SWELL_PERIOD_PHASE_B_ATTRIBUTE_ID, true); + }, ACTIVE_POWER_MIN_PHASE_C_ATTRIBUTE_ID, true); } - public void subscribeRmsVoltageSwellPeriodPhaseBAttribute( + public void subscribeActivePowerMinPhaseCAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_PERIOD_PHASE_B_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MIN_PHASE_C_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62713,12 +63564,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_SWELL_PERIOD_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); + }, ACTIVE_POWER_MIN_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readLineCurrentPhaseCAttribute( + public void readActivePowerMaxPhaseCAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LINE_CURRENT_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MAX_PHASE_C_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62726,12 +63577,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, LINE_CURRENT_PHASE_C_ATTRIBUTE_ID, true); + }, ACTIVE_POWER_MAX_PHASE_C_ATTRIBUTE_ID, true); } - public void subscribeLineCurrentPhaseCAttribute( + public void subscribeActivePowerMaxPhaseCAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LINE_CURRENT_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MAX_PHASE_C_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62739,12 +63590,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, LINE_CURRENT_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); + }, ACTIVE_POWER_MAX_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readActiveCurrentPhaseCAttribute( + public void readReactivePowerPhaseCAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_POWER_PHASE_C_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62752,12 +63603,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID, true); + }, REACTIVE_POWER_PHASE_C_ATTRIBUTE_ID, true); } - public void subscribeActiveCurrentPhaseCAttribute( + public void subscribeReactivePowerPhaseCAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_POWER_PHASE_C_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62765,12 +63616,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); + }, REACTIVE_POWER_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readReactiveCurrentPhaseCAttribute( + public void readApparentPowerPhaseCAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, APPARENT_POWER_PHASE_C_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62778,12 +63629,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, REACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID, true); + }, APPARENT_POWER_PHASE_C_ATTRIBUTE_ID, true); } - public void subscribeReactiveCurrentPhaseCAttribute( + public void subscribeApparentPowerPhaseCAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, APPARENT_POWER_PHASE_C_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62791,12 +63642,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, REACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); + }, APPARENT_POWER_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsVoltagePhaseCAttribute( + public void readPowerFactorPhaseCAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_FACTOR_PHASE_C_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62804,12 +63655,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_PHASE_C_ATTRIBUTE_ID, true); + }, POWER_FACTOR_PHASE_C_ATTRIBUTE_ID, true); } - public void subscribeRmsVoltagePhaseCAttribute( + public void subscribePowerFactorPhaseCAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_FACTOR_PHASE_C_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62817,12 +63668,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); + }, POWER_FACTOR_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsVoltageMinPhaseCAttribute( + public void readAverageRmsVoltageMeasurementPeriodPhaseCAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MIN_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_C_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62830,12 +63681,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_MIN_PHASE_C_ATTRIBUTE_ID, true); + }, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_C_ATTRIBUTE_ID, true); } - public void subscribeRmsVoltageMinPhaseCAttribute( + public void subscribeAverageRmsVoltageMeasurementPeriodPhaseCAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MIN_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_C_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62843,12 +63694,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_MIN_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); + }, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsVoltageMaxPhaseCAttribute( + public void readAverageRmsOverVoltageCounterPhaseCAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MAX_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62856,12 +63707,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_MAX_PHASE_C_ATTRIBUTE_ID, true); + }, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID, true); } - public void subscribeRmsVoltageMaxPhaseCAttribute( + public void subscribeAverageRmsOverVoltageCounterPhaseCAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MAX_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62869,12 +63720,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_MAX_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); + }, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsCurrentPhaseCAttribute( + public void readAverageRmsUnderVoltageCounterPhaseCAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62882,12 +63733,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_CURRENT_PHASE_C_ATTRIBUTE_ID, true); + }, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID, true); } - public void subscribeRmsCurrentPhaseCAttribute( + public void subscribeAverageRmsUnderVoltageCounterPhaseCAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62895,12 +63746,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_CURRENT_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); + }, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsCurrentMinPhaseCAttribute( + public void readRmsExtremeOverVoltagePeriodPhaseCAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MIN_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62908,12 +63759,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_CURRENT_MIN_PHASE_C_ATTRIBUTE_ID, true); + }, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID, true); } - public void subscribeRmsCurrentMinPhaseCAttribute( + public void subscribeRmsExtremeOverVoltagePeriodPhaseCAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MIN_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62921,12 +63772,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_CURRENT_MIN_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsCurrentMaxPhaseCAttribute( + public void readRmsExtremeUnderVoltagePeriodPhaseCAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MAX_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62934,12 +63785,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_CURRENT_MAX_PHASE_C_ATTRIBUTE_ID, true); + }, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID, true); } - public void subscribeRmsCurrentMaxPhaseCAttribute( + public void subscribeRmsExtremeUnderVoltagePeriodPhaseCAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MAX_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62947,12 +63798,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_CURRENT_MAX_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readActivePowerPhaseCAttribute( + public void readRmsVoltageSagPeriodPhaseCAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_PERIOD_PHASE_C_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62960,12 +63811,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_POWER_PHASE_C_ATTRIBUTE_ID, true); + }, RMS_VOLTAGE_SAG_PERIOD_PHASE_C_ATTRIBUTE_ID, true); } - public void subscribeActivePowerPhaseCAttribute( + public void subscribeRmsVoltageSagPeriodPhaseCAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_PERIOD_PHASE_C_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62973,12 +63824,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_POWER_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_VOLTAGE_SAG_PERIOD_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readActivePowerMinPhaseCAttribute( + public void readRmsVoltageSwellPeriodPhaseCAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MIN_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_PERIOD_PHASE_C_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62986,12 +63837,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_POWER_MIN_PHASE_C_ATTRIBUTE_ID, true); + }, RMS_VOLTAGE_SWELL_PERIOD_PHASE_C_ATTRIBUTE_ID, true); } - public void subscribeActivePowerMinPhaseCAttribute( + public void subscribeRmsVoltageSwellPeriodPhaseCAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MIN_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_PERIOD_PHASE_C_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -62999,142 +63850,142 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_POWER_MIN_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); + }, RMS_VOLTAGE_SWELL_PERIOD_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readActivePowerMaxPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MAX_PHASE_C_ATTRIBUTE_ID); + public void readGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_POWER_MAX_PHASE_C_ATTRIBUTE_ID, true); + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, true); } - public void subscribeActivePowerMaxPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MAX_PHASE_C_ATTRIBUTE_ID); + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_POWER_MAX_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readReactivePowerPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_POWER_PHASE_C_ATTRIBUTE_ID); + public void readAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, REACTIVE_POWER_PHASE_C_ATTRIBUTE_ID, true); + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, true); } - public void subscribeReactivePowerPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_POWER_PHASE_C_ATTRIBUTE_ID); + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, REACTIVE_POWER_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readApparentPowerPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, APPARENT_POWER_PHASE_C_ATTRIBUTE_ID); + public void readEventListAttribute( + EventListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, APPARENT_POWER_PHASE_C_ATTRIBUTE_ID, true); + }, EVENT_LIST_ATTRIBUTE_ID, true); } - public void subscribeApparentPowerPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, APPARENT_POWER_PHASE_C_ATTRIBUTE_ID); + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, APPARENT_POWER_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); + }, EVENT_LIST_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readPowerFactorPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_FACTOR_PHASE_C_ATTRIBUTE_ID); + public void readAttributeListAttribute( + AttributeListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, POWER_FACTOR_PHASE_C_ATTRIBUTE_ID, true); + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, true); } - public void subscribePowerFactorPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_FACTOR_PHASE_C_ATTRIBUTE_ID); + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, POWER_FACTOR_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAverageRmsVoltageMeasurementPeriodPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_C_ATTRIBUTE_ID); + public void readFeatureMapAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_C_ATTRIBUTE_ID, true); + }, FEATURE_MAP_ATTRIBUTE_ID, true); } - public void subscribeAverageRmsVoltageMeasurementPeriodPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_C_ATTRIBUTE_ID); + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); + }, FEATURE_MAP_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readAverageRmsOverVoltageCounterPhaseCAttribute( + public void readClusterRevisionAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -63142,12 +63993,12 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID, true); + }, CLUSTER_REVISION_ATTRIBUTE_ID, true); } - public void subscribeAverageRmsOverVoltageCounterPhaseCAttribute( + public void subscribeClusterRevisionAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -63155,137 +64006,199 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); + }, CLUSTER_REVISION_ATTRIBUTE_ID, minInterval, maxInterval); } + } - public void readAverageRmsUnderVoltageCounterPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID); + public static class MeterIdentificationCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 2822L; + + private static final long METER_TYPE_ATTRIBUTE_ID = 0L; + private static final long UTILITY_NAME_ATTRIBUTE_ID = 1L; + private static final long POINT_OF_DELIVERY_ATTRIBUTE_ID = 2L; + private static final long POWER_THRESHOLD_ATTRIBUTE_ID = 3L; + private static final long POWER_THRESHOLD_SOURCE_ATTRIBUTE_ID = 4L; + private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; + private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; + private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; + private static final long ATTRIBUTE_LIST_ATTRIBUTE_ID = 65531L; + private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; + private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; + + public MeterIdentificationCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId, CLUSTER_ID); + } + + @Override + @Deprecated + public long initWithDevice(long devicePtr, int endpointId) { + return 0L; + } + + public interface MeterTypeAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Integer value); + } + + public interface UtilityNameAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable String value); + } + + public interface PointOfDeliveryAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable String value); + } + + public interface PowerThresholdAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Long value); + } + + public interface PowerThresholdSourceAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Integer value); + } + + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface EventListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AttributeListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public void readMeterTypeAttribute( + MeterTypeAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, METER_TYPE_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID, true); + }, METER_TYPE_ATTRIBUTE_ID, true); } - public void subscribeAverageRmsUnderVoltageCounterPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID); + public void subscribeMeterTypeAttribute( + MeterTypeAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, METER_TYPE_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); + }, METER_TYPE_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsExtremeOverVoltagePeriodPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID); + public void readUtilityNameAttribute( + UtilityNameAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, UTILITY_NAME_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID, true); + }, UTILITY_NAME_ATTRIBUTE_ID, true); } - public void subscribeRmsExtremeOverVoltagePeriodPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID); + public void subscribeUtilityNameAttribute( + UtilityNameAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, UTILITY_NAME_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); + }, UTILITY_NAME_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsExtremeUnderVoltagePeriodPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID); + public void readPointOfDeliveryAttribute( + PointOfDeliveryAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POINT_OF_DELIVERY_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID, true); + }, POINT_OF_DELIVERY_ATTRIBUTE_ID, true); } - public void subscribeRmsExtremeUnderVoltagePeriodPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID); + public void subscribePointOfDeliveryAttribute( + PointOfDeliveryAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POINT_OF_DELIVERY_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); + }, POINT_OF_DELIVERY_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsVoltageSagPeriodPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_PERIOD_PHASE_C_ATTRIBUTE_ID); + public void readPowerThresholdAttribute( + PowerThresholdAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_THRESHOLD_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_SAG_PERIOD_PHASE_C_ATTRIBUTE_ID, true); + }, POWER_THRESHOLD_ATTRIBUTE_ID, true); } - public void subscribeRmsVoltageSagPeriodPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_PERIOD_PHASE_C_ATTRIBUTE_ID); + public void subscribePowerThresholdAttribute( + PowerThresholdAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_THRESHOLD_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_SAG_PERIOD_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); + }, POWER_THRESHOLD_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readRmsVoltageSwellPeriodPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_PERIOD_PHASE_C_ATTRIBUTE_ID); + public void readPowerThresholdSourceAttribute( + PowerThresholdSourceAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_THRESHOLD_SOURCE_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_SWELL_PERIOD_PHASE_C_ATTRIBUTE_ID, true); + }, POWER_THRESHOLD_SOURCE_ATTRIBUTE_ID, true); } - public void subscribeRmsVoltageSwellPeriodPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_PERIOD_PHASE_C_ATTRIBUTE_ID); + public void subscribePowerThresholdSourceAttribute( + PowerThresholdSourceAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_THRESHOLD_SOURCE_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, RMS_VOLTAGE_SWELL_PERIOD_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); + }, POWER_THRESHOLD_SOURCE_ATTRIBUTE_ID, minInterval, maxInterval); } public void readGeneratedCommandListAttribute( diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index f78eaf9c83cd10..d7b2afa84de6df 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -8305,6 +8305,340 @@ public String toString() { return output.toString(); } } +public static class EnergyCalendarClusterTransitionStruct { + public Integer transitionTime; + public Optional priceTier; + public Optional friendlyCredit; + public Optional auxiliaryLoad; + private static final long TRANSITION_TIME_ID = 0L; + private static final long PRICE_TIER_ID = 1L; + private static final long FRIENDLY_CREDIT_ID = 2L; + private static final long AUXILIARY_LOAD_ID = 3L; + + public EnergyCalendarClusterTransitionStruct( + Integer transitionTime, + Optional priceTier, + Optional friendlyCredit, + Optional auxiliaryLoad + ) { + this.transitionTime = transitionTime; + this.priceTier = priceTier; + this.friendlyCredit = friendlyCredit; + this.auxiliaryLoad = auxiliaryLoad; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(TRANSITION_TIME_ID, new UIntType(transitionTime))); + values.add(new StructElement(PRICE_TIER_ID, priceTier.map((nonOptionalpriceTier) -> new UIntType(nonOptionalpriceTier)).orElse(new EmptyType()))); + values.add(new StructElement(FRIENDLY_CREDIT_ID, friendlyCredit.map((nonOptionalfriendlyCredit) -> new BooleanType(nonOptionalfriendlyCredit)).orElse(new EmptyType()))); + values.add(new StructElement(AUXILIARY_LOAD_ID, auxiliaryLoad.map((nonOptionalauxiliaryLoad) -> new UIntType(nonOptionalauxiliaryLoad)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static EnergyCalendarClusterTransitionStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer transitionTime = null; + Optional priceTier = Optional.empty(); + Optional friendlyCredit = Optional.empty(); + Optional auxiliaryLoad = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == TRANSITION_TIME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + transitionTime = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == PRICE_TIER_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + priceTier = Optional.of(castingValue.value(Long.class)); + } + } else if (element.contextTagNum() == FRIENDLY_CREDIT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Boolean) { + BooleanType castingValue = element.value(BooleanType.class); + friendlyCredit = Optional.of(castingValue.value(Boolean.class)); + } + } else if (element.contextTagNum() == AUXILIARY_LOAD_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + auxiliaryLoad = Optional.of(castingValue.value(Integer.class)); + } + } + } + return new EnergyCalendarClusterTransitionStruct( + transitionTime, + priceTier, + friendlyCredit, + auxiliaryLoad + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("EnergyCalendarClusterTransitionStruct {\n"); + output.append("\ttransitionTime: "); + output.append(transitionTime); + output.append("\n"); + output.append("\tpriceTier: "); + output.append(priceTier); + output.append("\n"); + output.append("\tfriendlyCredit: "); + output.append(friendlyCredit); + output.append("\n"); + output.append("\tauxiliaryLoad: "); + output.append(auxiliaryLoad); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class EnergyCalendarClusterDayStruct { + public Optional date; + public Optional daysOfWeek; + public ArrayList transitions; + public Optional calendarID; + private static final long DATE_ID = 0L; + private static final long DAYS_OF_WEEK_ID = 1L; + private static final long TRANSITIONS_ID = 2L; + private static final long CALENDAR_I_D_ID = 3L; + + public EnergyCalendarClusterDayStruct( + Optional date, + Optional daysOfWeek, + ArrayList transitions, + Optional calendarID + ) { + this.date = date; + this.daysOfWeek = daysOfWeek; + this.transitions = transitions; + this.calendarID = calendarID; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(DATE_ID, date.map((nonOptionaldate) -> new UIntType(nonOptionaldate)).orElse(new EmptyType()))); + values.add(new StructElement(DAYS_OF_WEEK_ID, daysOfWeek.map((nonOptionaldaysOfWeek) -> new UIntType(nonOptionaldaysOfWeek)).orElse(new EmptyType()))); + values.add(new StructElement(TRANSITIONS_ID, ArrayType.generateArrayType(transitions, (elementtransitions) -> elementtransitions.encodeTlv()))); + values.add(new StructElement(CALENDAR_I_D_ID, calendarID.map((nonOptionalcalendarID) -> new UIntType(nonOptionalcalendarID)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static EnergyCalendarClusterDayStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Optional date = Optional.empty(); + Optional daysOfWeek = Optional.empty(); + ArrayList transitions = null; + Optional calendarID = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == DATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + date = Optional.of(castingValue.value(Long.class)); + } + } else if (element.contextTagNum() == DAYS_OF_WEEK_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + daysOfWeek = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == TRANSITIONS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + transitions = castingValue.map((elementcastingValue) -> ChipStructs.EnergyCalendarClusterTransitionStruct.decodeTlv(elementcastingValue)); + } + } else if (element.contextTagNum() == CALENDAR_I_D_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + calendarID = Optional.of(castingValue.value(Long.class)); + } + } + } + return new EnergyCalendarClusterDayStruct( + date, + daysOfWeek, + transitions, + calendarID + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("EnergyCalendarClusterDayStruct {\n"); + output.append("\tdate: "); + output.append(date); + output.append("\n"); + output.append("\tdaysOfWeek: "); + output.append(daysOfWeek); + output.append("\n"); + output.append("\ttransitions: "); + output.append(transitions); + output.append("\n"); + output.append("\tcalendarID: "); + output.append(calendarID); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class EnergyCalendarClusterCalendarPeriodStruct { + public @Nullable Long startDate; + public ArrayList days; + private static final long START_DATE_ID = 0L; + private static final long DAYS_ID = 1L; + + public EnergyCalendarClusterCalendarPeriodStruct( + @Nullable Long startDate, + ArrayList days + ) { + this.startDate = startDate; + this.days = days; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(START_DATE_ID, startDate != null ? new UIntType(startDate) : new NullType())); + values.add(new StructElement(DAYS_ID, ArrayType.generateArrayType(days, (elementdays) -> elementdays.encodeTlv()))); + + return new StructType(values); + } + + public static EnergyCalendarClusterCalendarPeriodStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + @Nullable Long startDate = null; + ArrayList days = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == START_DATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + startDate = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == DAYS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + days = castingValue.map((elementcastingValue) -> ChipStructs.EnergyCalendarClusterDayStruct.decodeTlv(elementcastingValue)); + } + } + } + return new EnergyCalendarClusterCalendarPeriodStruct( + startDate, + days + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("EnergyCalendarClusterCalendarPeriodStruct {\n"); + output.append("\tstartDate: "); + output.append(startDate); + output.append("\n"); + output.append("\tdays: "); + output.append(days); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class EnergyCalendarClusterPeakPeriodStruct { + public Integer severity; + public Integer peakPeriod; + public @Nullable Long startTime; + public @Nullable Long endTime; + private static final long SEVERITY_ID = 0L; + private static final long PEAK_PERIOD_ID = 1L; + private static final long START_TIME_ID = 2L; + private static final long END_TIME_ID = 3L; + + public EnergyCalendarClusterPeakPeriodStruct( + Integer severity, + Integer peakPeriod, + @Nullable Long startTime, + @Nullable Long endTime + ) { + this.severity = severity; + this.peakPeriod = peakPeriod; + this.startTime = startTime; + this.endTime = endTime; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(SEVERITY_ID, new UIntType(severity))); + values.add(new StructElement(PEAK_PERIOD_ID, new UIntType(peakPeriod))); + values.add(new StructElement(START_TIME_ID, startTime != null ? new UIntType(startTime) : new NullType())); + values.add(new StructElement(END_TIME_ID, endTime != null ? new UIntType(endTime) : new NullType())); + + return new StructType(values); + } + + public static EnergyCalendarClusterPeakPeriodStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer severity = null; + Integer peakPeriod = null; + @Nullable Long startTime = null; + @Nullable Long endTime = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == SEVERITY_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + severity = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == PEAK_PERIOD_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + peakPeriod = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == START_TIME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + startTime = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == END_TIME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + endTime = castingValue.value(Long.class); + } + } + } + return new EnergyCalendarClusterPeakPeriodStruct( + severity, + peakPeriod, + startTime, + endTime + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("EnergyCalendarClusterPeakPeriodStruct {\n"); + output.append("\tseverity: "); + output.append(severity); + output.append("\n"); + output.append("\tpeakPeriod: "); + output.append(peakPeriod); + output.append("\n"); + output.append("\tstartTime: "); + output.append(startTime); + output.append("\n"); + output.append("\tendTime: "); + output.append(endTime); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class EnergyPreferenceClusterBalanceStruct { public Integer step; public Optional label; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index cc2cb937c66cad..a54296ef38333b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -241,6 +241,9 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == EnergyEvse.ID) { return new EnergyEvse(); } + if (clusterId == EnergyCalendar.ID) { + return new EnergyCalendar(); + } if (clusterId == EnergyPreference.ID) { return new EnergyPreference(); } @@ -385,6 +388,9 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == ElectricalMeasurement.ID) { return new ElectricalMeasurement(); } + if (clusterId == MeterIdentification.ID) { + return new MeterIdentification(); + } if (clusterId == UnitTesting.ID) { return new UnitTesting(); } @@ -10015,6 +10021,118 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } + public static class EnergyCalendar implements BaseCluster { + public static final long ID = 154L; + public long getID() { + return ID; + } + + public enum Attribute { + CalendarID(0L), + Name(1L), + ProviderID(2L), + EventID(3L), + StartDate(4L), + CalendarPeriods(5L), + SpecialDays(6L), + CurrentDay(7L), + NextDay(8L), + CurrentTransition(9L), + CurrentPeakPeriod(10L), + NextPeakPeriod(11L), + GeneratedCommandList(65528L), + AcceptedCommandList(65529L), + EventList(65530L), + AttributeList(65531L), + FeatureMap(65532L), + ClusterRevision(65533L),; + private final long id; + Attribute(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Attribute value(long id) throws NoSuchFieldError { + for (Attribute attribute : Attribute.values()) { + if (attribute.getID() == id) { + return attribute; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Event {; + private final long id; + Event(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Event value(long id) throws NoSuchFieldError { + for (Event event : Event.values()) { + if (event.getID() == id) { + return event; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Command {; + private final long id; + Command(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Command value(long id) throws NoSuchFieldError { + for (Command command : Command.values()) { + if (command.getID() == id) { + return command; + } + } + throw new NoSuchFieldError(); + } + }@Override + public String getAttributeName(long id) throws NoSuchFieldError { + return Attribute.value(id).toString(); + } + + @Override + public String getEventName(long id) throws NoSuchFieldError { + return Event.value(id).toString(); + } + + @Override + public String getCommandName(long id) throws NoSuchFieldError { + return Command.value(id).toString(); + } + + @Override + public long getAttributeID(String name) throws IllegalArgumentException { + return Attribute.valueOf(name).getID(); + } + + @Override + public long getEventID(String name) throws IllegalArgumentException { + return Event.valueOf(name).getID(); + } + + @Override + public long getCommandID(String name) throws IllegalArgumentException { + return Command.valueOf(name).getID(); + } + } public static class EnergyPreference implements BaseCluster { public static final long ID = 155L; public long getID() { @@ -17155,6 +17273,111 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } + public static class MeterIdentification implements BaseCluster { + public static final long ID = 2822L; + public long getID() { + return ID; + } + + public enum Attribute { + MeterType(0L), + UtilityName(1L), + PointOfDelivery(2L), + PowerThreshold(3L), + PowerThresholdSource(4L), + GeneratedCommandList(65528L), + AcceptedCommandList(65529L), + EventList(65530L), + AttributeList(65531L), + FeatureMap(65532L), + ClusterRevision(65533L),; + private final long id; + Attribute(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Attribute value(long id) throws NoSuchFieldError { + for (Attribute attribute : Attribute.values()) { + if (attribute.getID() == id) { + return attribute; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Event {; + private final long id; + Event(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Event value(long id) throws NoSuchFieldError { + for (Event event : Event.values()) { + if (event.getID() == id) { + return event; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Command {; + private final long id; + Command(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Command value(long id) throws NoSuchFieldError { + for (Command command : Command.values()) { + if (command.getID() == id) { + return command; + } + } + throw new NoSuchFieldError(); + } + }@Override + public String getAttributeName(long id) throws NoSuchFieldError { + return Attribute.value(id).toString(); + } + + @Override + public String getEventName(long id) throws NoSuchFieldError { + return Event.value(id).toString(); + } + + @Override + public String getCommandName(long id) throws NoSuchFieldError { + return Command.value(id).toString(); + } + + @Override + public long getAttributeID(String name) throws IllegalArgumentException { + return Attribute.valueOf(name).getID(); + } + + @Override + public long getEventID(String name) throws IllegalArgumentException { + return Event.valueOf(name).getID(); + } + + @Override + public long getCommandID(String name) throws IllegalArgumentException { + return Command.valueOf(name).getID(); + } + } public static class UnitTesting implements BaseCluster { public static final long ID = 4294048773L; public long getID() { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index 2573b42c0184f7..82c7b1a88dd443 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -11422,6 +11422,342 @@ public void onError(Exception ex) { } } + public static class DelegatedEnergyCalendarClusterCalendarIDAttributeCallback implements ChipClusters.EnergyCalendarCluster.CalendarIDAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyCalendarClusterNameAttributeCallback implements ChipClusters.EnergyCalendarCluster.NameAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable String value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "String"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyCalendarClusterProviderIDAttributeCallback implements ChipClusters.EnergyCalendarCluster.ProviderIDAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyCalendarClusterEventIDAttributeCallback implements ChipClusters.EnergyCalendarCluster.EventIDAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyCalendarClusterStartDateAttributeCallback implements ChipClusters.EnergyCalendarCluster.StartDateAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyCalendarClusterCalendarPeriodsAttributeCallback implements ChipClusters.EnergyCalendarCluster.CalendarPeriodsAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyCalendarClusterSpecialDaysAttributeCallback implements ChipClusters.EnergyCalendarCluster.SpecialDaysAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyCalendarClusterCurrentDayAttributeCallback implements ChipClusters.EnergyCalendarCluster.CurrentDayAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable ChipStructs.EnergyCalendarClusterDayStruct value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.EnergyCalendarClusterDayStruct"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyCalendarClusterNextDayAttributeCallback implements ChipClusters.EnergyCalendarCluster.NextDayAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable ChipStructs.EnergyCalendarClusterDayStruct value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.EnergyCalendarClusterDayStruct"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyCalendarClusterCurrentTransitionAttributeCallback implements ChipClusters.EnergyCalendarCluster.CurrentTransitionAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable ChipStructs.EnergyCalendarClusterTransitionStruct value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.EnergyCalendarClusterTransitionStruct"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyCalendarClusterCurrentPeakPeriodAttributeCallback implements ChipClusters.EnergyCalendarCluster.CurrentPeakPeriodAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable ChipStructs.EnergyCalendarClusterPeakPeriodStruct value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.EnergyCalendarClusterPeakPeriodStruct"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyCalendarClusterNextPeakPeriodAttributeCallback implements ChipClusters.EnergyCalendarCluster.NextPeakPeriodAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable ChipStructs.EnergyCalendarClusterPeakPeriodStruct value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.EnergyCalendarClusterPeakPeriodStruct"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyCalendarClusterGeneratedCommandListAttributeCallback implements ChipClusters.EnergyCalendarCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyCalendarClusterAcceptedCommandListAttributeCallback implements ChipClusters.EnergyCalendarCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyCalendarClusterEventListAttributeCallback implements ChipClusters.EnergyCalendarCluster.EventListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyCalendarClusterAttributeListAttributeCallback implements ChipClusters.EnergyCalendarCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedEnergyPreferenceClusterEnergyBalancesAttributeCallback implements ChipClusters.EnergyPreferenceCluster.EnergyBalancesAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -19918,6 +20254,195 @@ public void onError(Exception ex) { } } + public static class DelegatedMeterIdentificationClusterMeterTypeAttributeCallback implements ChipClusters.MeterIdentificationCluster.MeterTypeAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedMeterIdentificationClusterUtilityNameAttributeCallback implements ChipClusters.MeterIdentificationCluster.UtilityNameAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable String value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "String"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedMeterIdentificationClusterPointOfDeliveryAttributeCallback implements ChipClusters.MeterIdentificationCluster.PointOfDeliveryAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable String value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "String"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedMeterIdentificationClusterPowerThresholdAttributeCallback implements ChipClusters.MeterIdentificationCluster.PowerThresholdAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedMeterIdentificationClusterPowerThresholdSourceAttributeCallback implements ChipClusters.MeterIdentificationCluster.PowerThresholdSourceAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedMeterIdentificationClusterGeneratedCommandListAttributeCallback implements ChipClusters.MeterIdentificationCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedMeterIdentificationClusterAcceptedCommandListAttributeCallback implements ChipClusters.MeterIdentificationCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedMeterIdentificationClusterEventListAttributeCallback implements ChipClusters.MeterIdentificationCluster.EventListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedMeterIdentificationClusterAttributeListAttributeCallback implements ChipClusters.MeterIdentificationCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedUnitTestingClusterTestSpecificResponseCallback implements ChipClusters.UnitTestingCluster.TestSpecificResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -21721,6 +22246,10 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.EnergyEvseCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("energyEvse", energyEvseClusterInfo); + ClusterInfo energyCalendarClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.EnergyCalendarCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("energyCalendar", energyCalendarClusterInfo); + ClusterInfo energyPreferenceClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.EnergyPreferenceCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("energyPreference", energyPreferenceClusterInfo); @@ -21913,6 +22442,10 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.ElectricalMeasurementCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("electricalMeasurement", electricalMeasurementClusterInfo); + ClusterInfo meterIdentificationClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.MeterIdentificationCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("meterIdentification", meterIdentificationClusterInfo); + ClusterInfo unitTestingClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.UnitTestingCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("unitTesting", unitTestingClusterInfo); @@ -22000,6 +22533,7 @@ public void combineCommand(Map destination, Map destination, Map> getCommandMap() { commandMap.put("energyEvse", energyEvseClusterInteractionInfoMap); + Map energyCalendarClusterInteractionInfoMap = new LinkedHashMap<>(); + + commandMap.put("energyCalendar", energyCalendarClusterInteractionInfoMap); + Map energyPreferenceClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("energyPreference", energyPreferenceClusterInteractionInfoMap); @@ -28212,6 +28751,10 @@ public Map> getCommandMap() { commandMap.put("electricalMeasurement", electricalMeasurementClusterInteractionInfoMap); + Map meterIdentificationClusterInteractionInfoMap = new LinkedHashMap<>(); + + commandMap.put("meterIdentification", meterIdentificationClusterInteractionInfoMap); + Map unitTestingClusterInteractionInfoMap = new LinkedHashMap<>(); Map unitTestingtestCommandParams = new LinkedHashMap(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 18cc03aa13a99f..0ccc6259f3d741 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -10022,6 +10022,153 @@ private static Map readEnergyEvseInteractionInfo() { return result; } + private static Map readEnergyCalendarInteractionInfo() { + Map result = new LinkedHashMap<>();Map readEnergyCalendarCalendarIDCommandParams = new LinkedHashMap(); + InteractionInfo readEnergyCalendarCalendarIDAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyCalendarCluster) cluster).readCalendarIDAttribute( + (ChipClusters.EnergyCalendarCluster.CalendarIDAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyCalendarClusterCalendarIDAttributeCallback(), + readEnergyCalendarCalendarIDCommandParams + ); + result.put("readCalendarIDAttribute", readEnergyCalendarCalendarIDAttributeInteractionInfo); + Map readEnergyCalendarNameCommandParams = new LinkedHashMap(); + InteractionInfo readEnergyCalendarNameAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyCalendarCluster) cluster).readNameAttribute( + (ChipClusters.EnergyCalendarCluster.NameAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyCalendarClusterNameAttributeCallback(), + readEnergyCalendarNameCommandParams + ); + result.put("readNameAttribute", readEnergyCalendarNameAttributeInteractionInfo); + Map readEnergyCalendarProviderIDCommandParams = new LinkedHashMap(); + InteractionInfo readEnergyCalendarProviderIDAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyCalendarCluster) cluster).readProviderIDAttribute( + (ChipClusters.EnergyCalendarCluster.ProviderIDAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyCalendarClusterProviderIDAttributeCallback(), + readEnergyCalendarProviderIDCommandParams + ); + result.put("readProviderIDAttribute", readEnergyCalendarProviderIDAttributeInteractionInfo); + Map readEnergyCalendarEventIDCommandParams = new LinkedHashMap(); + InteractionInfo readEnergyCalendarEventIDAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyCalendarCluster) cluster).readEventIDAttribute( + (ChipClusters.EnergyCalendarCluster.EventIDAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyCalendarClusterEventIDAttributeCallback(), + readEnergyCalendarEventIDCommandParams + ); + result.put("readEventIDAttribute", readEnergyCalendarEventIDAttributeInteractionInfo); + Map readEnergyCalendarStartDateCommandParams = new LinkedHashMap(); + InteractionInfo readEnergyCalendarStartDateAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyCalendarCluster) cluster).readStartDateAttribute( + (ChipClusters.EnergyCalendarCluster.StartDateAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyCalendarClusterStartDateAttributeCallback(), + readEnergyCalendarStartDateCommandParams + ); + result.put("readStartDateAttribute", readEnergyCalendarStartDateAttributeInteractionInfo); + Map readEnergyCalendarCalendarPeriodsCommandParams = new LinkedHashMap(); + InteractionInfo readEnergyCalendarCalendarPeriodsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyCalendarCluster) cluster).readCalendarPeriodsAttribute( + (ChipClusters.EnergyCalendarCluster.CalendarPeriodsAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyCalendarClusterCalendarPeriodsAttributeCallback(), + readEnergyCalendarCalendarPeriodsCommandParams + ); + result.put("readCalendarPeriodsAttribute", readEnergyCalendarCalendarPeriodsAttributeInteractionInfo); + Map readEnergyCalendarSpecialDaysCommandParams = new LinkedHashMap(); + InteractionInfo readEnergyCalendarSpecialDaysAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyCalendarCluster) cluster).readSpecialDaysAttribute( + (ChipClusters.EnergyCalendarCluster.SpecialDaysAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyCalendarClusterSpecialDaysAttributeCallback(), + readEnergyCalendarSpecialDaysCommandParams + ); + result.put("readSpecialDaysAttribute", readEnergyCalendarSpecialDaysAttributeInteractionInfo); + Map readEnergyCalendarGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readEnergyCalendarGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyCalendarCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.EnergyCalendarCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyCalendarClusterGeneratedCommandListAttributeCallback(), + readEnergyCalendarGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readEnergyCalendarGeneratedCommandListAttributeInteractionInfo); + Map readEnergyCalendarAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readEnergyCalendarAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyCalendarCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.EnergyCalendarCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyCalendarClusterAcceptedCommandListAttributeCallback(), + readEnergyCalendarAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readEnergyCalendarAcceptedCommandListAttributeInteractionInfo); + Map readEnergyCalendarEventListCommandParams = new LinkedHashMap(); + InteractionInfo readEnergyCalendarEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyCalendarCluster) cluster).readEventListAttribute( + (ChipClusters.EnergyCalendarCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyCalendarClusterEventListAttributeCallback(), + readEnergyCalendarEventListCommandParams + ); + result.put("readEventListAttribute", readEnergyCalendarEventListAttributeInteractionInfo); + Map readEnergyCalendarAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readEnergyCalendarAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyCalendarCluster) cluster).readAttributeListAttribute( + (ChipClusters.EnergyCalendarCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyCalendarClusterAttributeListAttributeCallback(), + readEnergyCalendarAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readEnergyCalendarAttributeListAttributeInteractionInfo); + Map readEnergyCalendarFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readEnergyCalendarFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyCalendarCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readEnergyCalendarFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readEnergyCalendarFeatureMapAttributeInteractionInfo); + Map readEnergyCalendarClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readEnergyCalendarClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyCalendarCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readEnergyCalendarClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readEnergyCalendarClusterRevisionAttributeInteractionInfo); + + return result; + } private static Map readEnergyPreferenceInteractionInfo() { Map result = new LinkedHashMap<>();Map readEnergyPreferenceEnergyBalancesCommandParams = new LinkedHashMap(); InteractionInfo readEnergyPreferenceEnergyBalancesAttributeInteractionInfo = new InteractionInfo( @@ -19806,6 +19953,131 @@ private static Map readElectricalMeasurementInteraction return result; } + private static Map readMeterIdentificationInteractionInfo() { + Map result = new LinkedHashMap<>();Map readMeterIdentificationMeterTypeCommandParams = new LinkedHashMap(); + InteractionInfo readMeterIdentificationMeterTypeAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MeterIdentificationCluster) cluster).readMeterTypeAttribute( + (ChipClusters.MeterIdentificationCluster.MeterTypeAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMeterIdentificationClusterMeterTypeAttributeCallback(), + readMeterIdentificationMeterTypeCommandParams + ); + result.put("readMeterTypeAttribute", readMeterIdentificationMeterTypeAttributeInteractionInfo); + Map readMeterIdentificationUtilityNameCommandParams = new LinkedHashMap(); + InteractionInfo readMeterIdentificationUtilityNameAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MeterIdentificationCluster) cluster).readUtilityNameAttribute( + (ChipClusters.MeterIdentificationCluster.UtilityNameAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMeterIdentificationClusterUtilityNameAttributeCallback(), + readMeterIdentificationUtilityNameCommandParams + ); + result.put("readUtilityNameAttribute", readMeterIdentificationUtilityNameAttributeInteractionInfo); + Map readMeterIdentificationPointOfDeliveryCommandParams = new LinkedHashMap(); + InteractionInfo readMeterIdentificationPointOfDeliveryAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MeterIdentificationCluster) cluster).readPointOfDeliveryAttribute( + (ChipClusters.MeterIdentificationCluster.PointOfDeliveryAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMeterIdentificationClusterPointOfDeliveryAttributeCallback(), + readMeterIdentificationPointOfDeliveryCommandParams + ); + result.put("readPointOfDeliveryAttribute", readMeterIdentificationPointOfDeliveryAttributeInteractionInfo); + Map readMeterIdentificationPowerThresholdCommandParams = new LinkedHashMap(); + InteractionInfo readMeterIdentificationPowerThresholdAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MeterIdentificationCluster) cluster).readPowerThresholdAttribute( + (ChipClusters.MeterIdentificationCluster.PowerThresholdAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMeterIdentificationClusterPowerThresholdAttributeCallback(), + readMeterIdentificationPowerThresholdCommandParams + ); + result.put("readPowerThresholdAttribute", readMeterIdentificationPowerThresholdAttributeInteractionInfo); + Map readMeterIdentificationPowerThresholdSourceCommandParams = new LinkedHashMap(); + InteractionInfo readMeterIdentificationPowerThresholdSourceAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MeterIdentificationCluster) cluster).readPowerThresholdSourceAttribute( + (ChipClusters.MeterIdentificationCluster.PowerThresholdSourceAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMeterIdentificationClusterPowerThresholdSourceAttributeCallback(), + readMeterIdentificationPowerThresholdSourceCommandParams + ); + result.put("readPowerThresholdSourceAttribute", readMeterIdentificationPowerThresholdSourceAttributeInteractionInfo); + Map readMeterIdentificationGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readMeterIdentificationGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MeterIdentificationCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.MeterIdentificationCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMeterIdentificationClusterGeneratedCommandListAttributeCallback(), + readMeterIdentificationGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readMeterIdentificationGeneratedCommandListAttributeInteractionInfo); + Map readMeterIdentificationAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readMeterIdentificationAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MeterIdentificationCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.MeterIdentificationCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMeterIdentificationClusterAcceptedCommandListAttributeCallback(), + readMeterIdentificationAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readMeterIdentificationAcceptedCommandListAttributeInteractionInfo); + Map readMeterIdentificationEventListCommandParams = new LinkedHashMap(); + InteractionInfo readMeterIdentificationEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MeterIdentificationCluster) cluster).readEventListAttribute( + (ChipClusters.MeterIdentificationCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMeterIdentificationClusterEventListAttributeCallback(), + readMeterIdentificationEventListCommandParams + ); + result.put("readEventListAttribute", readMeterIdentificationEventListAttributeInteractionInfo); + Map readMeterIdentificationAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readMeterIdentificationAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MeterIdentificationCluster) cluster).readAttributeListAttribute( + (ChipClusters.MeterIdentificationCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMeterIdentificationClusterAttributeListAttributeCallback(), + readMeterIdentificationAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readMeterIdentificationAttributeListAttributeInteractionInfo); + Map readMeterIdentificationFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readMeterIdentificationFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MeterIdentificationCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readMeterIdentificationFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readMeterIdentificationFeatureMapAttributeInteractionInfo); + Map readMeterIdentificationClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readMeterIdentificationClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MeterIdentificationCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readMeterIdentificationClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readMeterIdentificationClusterRevisionAttributeInteractionInfo); + + return result; + } private static Map readUnitTestingInteractionInfo() { Map result = new LinkedHashMap<>();Map readUnitTestingBooleanCommandParams = new LinkedHashMap(); InteractionInfo readUnitTestingBooleanAttributeInteractionInfo = new InteractionInfo( @@ -20993,6 +21265,7 @@ public Map> getReadAttributeMap() { put("messages", readMessagesInteractionInfo()); put("deviceEnergyManagement", readDeviceEnergyManagementInteractionInfo()); put("energyEvse", readEnergyEvseInteractionInfo()); + put("energyCalendar", readEnergyCalendarInteractionInfo()); put("energyPreference", readEnergyPreferenceInteractionInfo()); put("powerTopology", readPowerTopologyInteractionInfo()); put("energyEvseMode", readEnergyEvseModeInteractionInfo()); @@ -21041,6 +21314,7 @@ public Map> getReadAttributeMap() { put("contentControl", readContentControlInteractionInfo()); put("contentAppObserver", readContentAppObserverInteractionInfo()); put("electricalMeasurement", readElectricalMeasurementInteractionInfo()); + put("meterIdentification", readMeterIdentificationInteractionInfo()); put("unitTesting", readUnitTestingInteractionInfo()); put("faultInjection", readFaultInjectionInteractionInfo()); put("sampleMei", readSampleMeiInteractionInfo());}}; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index bd73d50f14c538..dd23974d71a416 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -1312,6 +1312,8 @@ public Map> getWriteAttributeMap() { ); writeEnergyEvseInteractionInfo.put("writeApproximateEVEfficiencyAttribute", writeEnergyEvseApproximateEVEfficiencyAttributeInteractionInfo); writeAttributeMap.put("energyEvse", writeEnergyEvseInteractionInfo); + Map writeEnergyCalendarInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("energyCalendar", writeEnergyCalendarInteractionInfo); Map writeEnergyPreferenceInteractionInfo = new LinkedHashMap<>(); Map writeEnergyPreferenceCurrentEnergyBalanceCommandParams = new LinkedHashMap(); CommandParameterInfo energyPreferencecurrentEnergyBalanceCommandParameterInfo = @@ -3872,6 +3874,8 @@ public Map> getWriteAttributeMap() { ); writeElectricalMeasurementInteractionInfo.put("writeAcOverloadAlarmsMaskAttribute", writeElectricalMeasurementAcOverloadAlarmsMaskAttributeInteractionInfo); writeAttributeMap.put("electricalMeasurement", writeElectricalMeasurementInteractionInfo); + Map writeMeterIdentificationInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("meterIdentification", writeMeterIdentificationInteractionInfo); Map writeUnitTestingInteractionInfo = new LinkedHashMap<>(); Map writeUnitTestingBooleanCommandParams = new LinkedHashMap(); CommandParameterInfo unitTestingbooleanCommandParameterInfo = diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni index c5c5d5e1adbb0d..15f41f56641db1 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni @@ -64,6 +64,10 @@ structs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ElectricalPowerMeasurementClusterMeasurementAccuracyRangeStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ElectricalPowerMeasurementClusterMeasurementAccuracyStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ElectricalPowerMeasurementClusterMeasurementRangeStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyCalendarClusterCalendarPeriodStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyCalendarClusterDayStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyCalendarClusterPeakPeriodStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyCalendarClusterTransitionStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyEvseClusterChargingTargetStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyEvseModeClusterModeOptionStruct.kt", diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyCalendarClusterCalendarPeriodStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyCalendarClusterCalendarPeriodStruct.kt new file mode 100644 index 00000000000000..33496767f70b5f --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyCalendarClusterCalendarPeriodStruct.kt @@ -0,0 +1,81 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class EnergyCalendarClusterCalendarPeriodStruct( + val startDate: ULong?, + val days: List, +) { + override fun toString(): String = buildString { + append("EnergyCalendarClusterCalendarPeriodStruct {\n") + append("\tstartDate : $startDate\n") + append("\tdays : $days\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (startDate != null) { + put(ContextSpecificTag(TAG_START_DATE), startDate) + } else { + putNull(ContextSpecificTag(TAG_START_DATE)) + } + startArray(ContextSpecificTag(TAG_DAYS)) + for (item in days.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + endStructure() + } + } + + companion object { + private const val TAG_START_DATE = 0 + private const val TAG_DAYS = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyCalendarClusterCalendarPeriodStruct { + tlvReader.enterStructure(tlvTag) + val startDate = + if (!tlvReader.isNull()) { + tlvReader.getULong(ContextSpecificTag(TAG_START_DATE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_START_DATE)) + null + } + val days = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_DAYS)) + while (!tlvReader.isEndOfContainer()) { + add(EnergyCalendarClusterDayStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + + tlvReader.exitContainer() + + return EnergyCalendarClusterCalendarPeriodStruct(startDate, days) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyCalendarClusterDayStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyCalendarClusterDayStruct.kt new file mode 100644 index 00000000000000..0520e76669c8ea --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyCalendarClusterDayStruct.kt @@ -0,0 +1,106 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class EnergyCalendarClusterDayStruct( + val date: Optional, + val daysOfWeek: Optional, + val transitions: List, + val calendarID: Optional, +) { + override fun toString(): String = buildString { + append("EnergyCalendarClusterDayStruct {\n") + append("\tdate : $date\n") + append("\tdaysOfWeek : $daysOfWeek\n") + append("\ttransitions : $transitions\n") + append("\tcalendarID : $calendarID\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (date.isPresent) { + val optdate = date.get() + put(ContextSpecificTag(TAG_DATE), optdate) + } + if (daysOfWeek.isPresent) { + val optdaysOfWeek = daysOfWeek.get() + put(ContextSpecificTag(TAG_DAYS_OF_WEEK), optdaysOfWeek) + } + startArray(ContextSpecificTag(TAG_TRANSITIONS)) + for (item in transitions.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + if (calendarID.isPresent) { + val optcalendarID = calendarID.get() + put(ContextSpecificTag(TAG_CALENDAR_I_D), optcalendarID) + } + endStructure() + } + } + + companion object { + private const val TAG_DATE = 0 + private const val TAG_DAYS_OF_WEEK = 1 + private const val TAG_TRANSITIONS = 2 + private const val TAG_CALENDAR_I_D = 3 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyCalendarClusterDayStruct { + tlvReader.enterStructure(tlvTag) + val date = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_DATE))) { + Optional.of(tlvReader.getULong(ContextSpecificTag(TAG_DATE))) + } else { + Optional.empty() + } + val daysOfWeek = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_DAYS_OF_WEEK))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_DAYS_OF_WEEK))) + } else { + Optional.empty() + } + val transitions = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_TRANSITIONS)) + while (!tlvReader.isEndOfContainer()) { + add(EnergyCalendarClusterTransitionStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + val calendarID = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CALENDAR_I_D))) { + Optional.of(tlvReader.getULong(ContextSpecificTag(TAG_CALENDAR_I_D))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return EnergyCalendarClusterDayStruct(date, daysOfWeek, transitions, calendarID) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyCalendarClusterPeakPeriodStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyCalendarClusterPeakPeriodStruct.kt new file mode 100644 index 00000000000000..c14d78bf9cff5b --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyCalendarClusterPeakPeriodStruct.kt @@ -0,0 +1,89 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class EnergyCalendarClusterPeakPeriodStruct( + val severity: UInt, + val peakPeriod: UInt, + val startTime: ULong?, + val endTime: ULong?, +) { + override fun toString(): String = buildString { + append("EnergyCalendarClusterPeakPeriodStruct {\n") + append("\tseverity : $severity\n") + append("\tpeakPeriod : $peakPeriod\n") + append("\tstartTime : $startTime\n") + append("\tendTime : $endTime\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SEVERITY), severity) + put(ContextSpecificTag(TAG_PEAK_PERIOD), peakPeriod) + if (startTime != null) { + put(ContextSpecificTag(TAG_START_TIME), startTime) + } else { + putNull(ContextSpecificTag(TAG_START_TIME)) + } + if (endTime != null) { + put(ContextSpecificTag(TAG_END_TIME), endTime) + } else { + putNull(ContextSpecificTag(TAG_END_TIME)) + } + endStructure() + } + } + + companion object { + private const val TAG_SEVERITY = 0 + private const val TAG_PEAK_PERIOD = 1 + private const val TAG_START_TIME = 2 + private const val TAG_END_TIME = 3 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyCalendarClusterPeakPeriodStruct { + tlvReader.enterStructure(tlvTag) + val severity = tlvReader.getUInt(ContextSpecificTag(TAG_SEVERITY)) + val peakPeriod = tlvReader.getUInt(ContextSpecificTag(TAG_PEAK_PERIOD)) + val startTime = + if (!tlvReader.isNull()) { + tlvReader.getULong(ContextSpecificTag(TAG_START_TIME)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_START_TIME)) + null + } + val endTime = + if (!tlvReader.isNull()) { + tlvReader.getULong(ContextSpecificTag(TAG_END_TIME)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_END_TIME)) + null + } + + tlvReader.exitContainer() + + return EnergyCalendarClusterPeakPeriodStruct(severity, peakPeriod, startTime, endTime) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyCalendarClusterTransitionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyCalendarClusterTransitionStruct.kt new file mode 100644 index 00000000000000..42cb66acd89939 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyCalendarClusterTransitionStruct.kt @@ -0,0 +1,99 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class EnergyCalendarClusterTransitionStruct( + val transitionTime: UInt, + val priceTier: Optional, + val friendlyCredit: Optional, + val auxiliaryLoad: Optional, +) { + override fun toString(): String = buildString { + append("EnergyCalendarClusterTransitionStruct {\n") + append("\ttransitionTime : $transitionTime\n") + append("\tpriceTier : $priceTier\n") + append("\tfriendlyCredit : $friendlyCredit\n") + append("\tauxiliaryLoad : $auxiliaryLoad\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_TRANSITION_TIME), transitionTime) + if (priceTier.isPresent) { + val optpriceTier = priceTier.get() + put(ContextSpecificTag(TAG_PRICE_TIER), optpriceTier) + } + if (friendlyCredit.isPresent) { + val optfriendlyCredit = friendlyCredit.get() + put(ContextSpecificTag(TAG_FRIENDLY_CREDIT), optfriendlyCredit) + } + if (auxiliaryLoad.isPresent) { + val optauxiliaryLoad = auxiliaryLoad.get() + put(ContextSpecificTag(TAG_AUXILIARY_LOAD), optauxiliaryLoad) + } + endStructure() + } + } + + companion object { + private const val TAG_TRANSITION_TIME = 0 + private const val TAG_PRICE_TIER = 1 + private const val TAG_FRIENDLY_CREDIT = 2 + private const val TAG_AUXILIARY_LOAD = 3 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyCalendarClusterTransitionStruct { + tlvReader.enterStructure(tlvTag) + val transitionTime = tlvReader.getUInt(ContextSpecificTag(TAG_TRANSITION_TIME)) + val priceTier = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PRICE_TIER))) { + Optional.of(tlvReader.getULong(ContextSpecificTag(TAG_PRICE_TIER))) + } else { + Optional.empty() + } + val friendlyCredit = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_FRIENDLY_CREDIT))) { + Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_FRIENDLY_CREDIT))) + } else { + Optional.empty() + } + val auxiliaryLoad = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_AUXILIARY_LOAD))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_AUXILIARY_LOAD))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return EnergyCalendarClusterTransitionStruct( + transitionTime, + priceTier, + friendlyCredit, + auxiliaryLoad, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyCalendarCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyCalendarCluster.kt new file mode 100644 index 00000000000000..182eafbb889c9e --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyCalendarCluster.kt @@ -0,0 +1,1924 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package matter.controller.cluster.clusters + +import java.time.Duration +import java.util.logging.Level +import java.util.logging.Logger +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.transform +import matter.controller.MatterController +import matter.controller.ReadData +import matter.controller.ReadRequest +import matter.controller.SubscribeRequest +import matter.controller.SubscriptionState +import matter.controller.UIntSubscriptionState +import matter.controller.UShortSubscriptionState +import matter.controller.cluster.structs.* +import matter.controller.model.AttributePath +import matter.tlv.AnonymousTag +import matter.tlv.TlvReader + +class EnergyCalendarCluster( + private val controller: MatterController, + private val endpointId: UShort, +) { + class CalendarIDAttribute(val value: UInt?) + + sealed class CalendarIDAttributeSubscriptionState { + data class Success(val value: UInt?) : CalendarIDAttributeSubscriptionState() + + data class Error(val exception: Exception) : CalendarIDAttributeSubscriptionState() + + object SubscriptionEstablished : CalendarIDAttributeSubscriptionState() + } + + class NameAttribute(val value: String?) + + sealed class NameAttributeSubscriptionState { + data class Success(val value: String?) : NameAttributeSubscriptionState() + + data class Error(val exception: Exception) : NameAttributeSubscriptionState() + + object SubscriptionEstablished : NameAttributeSubscriptionState() + } + + class ProviderIDAttribute(val value: UInt?) + + sealed class ProviderIDAttributeSubscriptionState { + data class Success(val value: UInt?) : ProviderIDAttributeSubscriptionState() + + data class Error(val exception: Exception) : ProviderIDAttributeSubscriptionState() + + object SubscriptionEstablished : ProviderIDAttributeSubscriptionState() + } + + class EventIDAttribute(val value: UInt?) + + sealed class EventIDAttributeSubscriptionState { + data class Success(val value: UInt?) : EventIDAttributeSubscriptionState() + + data class Error(val exception: Exception) : EventIDAttributeSubscriptionState() + + object SubscriptionEstablished : EventIDAttributeSubscriptionState() + } + + class StartDateAttribute(val value: UInt?) + + sealed class StartDateAttributeSubscriptionState { + data class Success(val value: UInt?) : StartDateAttributeSubscriptionState() + + data class Error(val exception: Exception) : StartDateAttributeSubscriptionState() + + object SubscriptionEstablished : StartDateAttributeSubscriptionState() + } + + class CalendarPeriodsAttribute(val value: List?) + + sealed class CalendarPeriodsAttributeSubscriptionState { + data class Success(val value: List?) : + CalendarPeriodsAttributeSubscriptionState() + + data class Error(val exception: Exception) : CalendarPeriodsAttributeSubscriptionState() + + object SubscriptionEstablished : CalendarPeriodsAttributeSubscriptionState() + } + + class SpecialDaysAttribute(val value: List?) + + sealed class SpecialDaysAttributeSubscriptionState { + data class Success(val value: List?) : + SpecialDaysAttributeSubscriptionState() + + data class Error(val exception: Exception) : SpecialDaysAttributeSubscriptionState() + + object SubscriptionEstablished : SpecialDaysAttributeSubscriptionState() + } + + class CurrentDayAttribute(val value: EnergyCalendarClusterDayStruct?) + + sealed class CurrentDayAttributeSubscriptionState { + data class Success(val value: EnergyCalendarClusterDayStruct?) : + CurrentDayAttributeSubscriptionState() + + data class Error(val exception: Exception) : CurrentDayAttributeSubscriptionState() + + object SubscriptionEstablished : CurrentDayAttributeSubscriptionState() + } + + class NextDayAttribute(val value: EnergyCalendarClusterDayStruct?) + + sealed class NextDayAttributeSubscriptionState { + data class Success(val value: EnergyCalendarClusterDayStruct?) : + NextDayAttributeSubscriptionState() + + data class Error(val exception: Exception) : NextDayAttributeSubscriptionState() + + object SubscriptionEstablished : NextDayAttributeSubscriptionState() + } + + class CurrentTransitionAttribute(val value: EnergyCalendarClusterTransitionStruct?) + + sealed class CurrentTransitionAttributeSubscriptionState { + data class Success(val value: EnergyCalendarClusterTransitionStruct?) : + CurrentTransitionAttributeSubscriptionState() + + data class Error(val exception: Exception) : CurrentTransitionAttributeSubscriptionState() + + object SubscriptionEstablished : CurrentTransitionAttributeSubscriptionState() + } + + class CurrentPeakPeriodAttribute(val value: EnergyCalendarClusterPeakPeriodStruct?) + + sealed class CurrentPeakPeriodAttributeSubscriptionState { + data class Success(val value: EnergyCalendarClusterPeakPeriodStruct?) : + CurrentPeakPeriodAttributeSubscriptionState() + + data class Error(val exception: Exception) : CurrentPeakPeriodAttributeSubscriptionState() + + object SubscriptionEstablished : CurrentPeakPeriodAttributeSubscriptionState() + } + + class NextPeakPeriodAttribute(val value: EnergyCalendarClusterPeakPeriodStruct?) + + sealed class NextPeakPeriodAttributeSubscriptionState { + data class Success(val value: EnergyCalendarClusterPeakPeriodStruct?) : + NextPeakPeriodAttributeSubscriptionState() + + data class Error(val exception: Exception) : NextPeakPeriodAttributeSubscriptionState() + + object SubscriptionEstablished : NextPeakPeriodAttributeSubscriptionState() + } + + class GeneratedCommandListAttribute(val value: List) + + sealed class GeneratedCommandListAttributeSubscriptionState { + data class Success(val value: List) : GeneratedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : GeneratedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : GeneratedCommandListAttributeSubscriptionState() + } + + class AcceptedCommandListAttribute(val value: List) + + sealed class AcceptedCommandListAttributeSubscriptionState { + data class Success(val value: List) : AcceptedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AcceptedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : AcceptedCommandListAttributeSubscriptionState() + } + + class EventListAttribute(val value: List) + + sealed class EventListAttributeSubscriptionState { + data class Success(val value: List) : EventListAttributeSubscriptionState() + + data class Error(val exception: Exception) : EventListAttributeSubscriptionState() + + object SubscriptionEstablished : EventListAttributeSubscriptionState() + } + + class AttributeListAttribute(val value: List) + + sealed class AttributeListAttributeSubscriptionState { + data class Success(val value: List) : AttributeListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AttributeListAttributeSubscriptionState() + + object SubscriptionEstablished : AttributeListAttributeSubscriptionState() + } + + suspend fun readCalendarIDAttribute(): CalendarIDAttribute { + val ATTRIBUTE_ID: UInt = 0u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Calendarid attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (!tlvReader.isNull()) { + tlvReader.getUInt(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return CalendarIDAttribute(decodedValue) + } + + suspend fun subscribeCalendarIDAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 0u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + CalendarIDAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Calendarid attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (!tlvReader.isNull()) { + tlvReader.getUInt(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(CalendarIDAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(CalendarIDAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readNameAttribute(): NameAttribute { + val ATTRIBUTE_ID: UInt = 1u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Name attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: String? = + if (!tlvReader.isNull()) { + tlvReader.getString(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return NameAttribute(decodedValue) + } + + suspend fun subscribeNameAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 1u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + NameAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Name attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: String? = + if (!tlvReader.isNull()) { + tlvReader.getString(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(NameAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(NameAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readProviderIDAttribute(): ProviderIDAttribute { + val ATTRIBUTE_ID: UInt = 2u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Providerid attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (!tlvReader.isNull()) { + tlvReader.getUInt(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return ProviderIDAttribute(decodedValue) + } + + suspend fun subscribeProviderIDAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 2u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + ProviderIDAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Providerid attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (!tlvReader.isNull()) { + tlvReader.getUInt(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(ProviderIDAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(ProviderIDAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readEventIDAttribute(): EventIDAttribute { + val ATTRIBUTE_ID: UInt = 3u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Eventid attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (!tlvReader.isNull()) { + tlvReader.getUInt(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return EventIDAttribute(decodedValue) + } + + suspend fun subscribeEventIDAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 3u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + EventIDAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Eventid attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (!tlvReader.isNull()) { + tlvReader.getUInt(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(EventIDAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(EventIDAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readStartDateAttribute(): StartDateAttribute { + val ATTRIBUTE_ID: UInt = 4u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Startdate attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (!tlvReader.isNull()) { + tlvReader.getUInt(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return StartDateAttribute(decodedValue) + } + + suspend fun subscribeStartDateAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 4u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + StartDateAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Startdate attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (!tlvReader.isNull()) { + tlvReader.getUInt(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(StartDateAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(StartDateAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readCalendarPeriodsAttribute(): CalendarPeriodsAttribute { + val ATTRIBUTE_ID: UInt = 5u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Calendarperiods attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (!tlvReader.isNull()) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(EnergyCalendarClusterCalendarPeriodStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return CalendarPeriodsAttribute(decodedValue) + } + + suspend fun subscribeCalendarPeriodsAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 5u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + CalendarPeriodsAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Calendarperiods attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (!tlvReader.isNull()) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(EnergyCalendarClusterCalendarPeriodStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(CalendarPeriodsAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(CalendarPeriodsAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readSpecialDaysAttribute(): SpecialDaysAttribute { + val ATTRIBUTE_ID: UInt = 6u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Specialdays attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (!tlvReader.isNull()) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(EnergyCalendarClusterDayStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return SpecialDaysAttribute(decodedValue) + } + + suspend fun subscribeSpecialDaysAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 6u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + SpecialDaysAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Specialdays attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (!tlvReader.isNull()) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(EnergyCalendarClusterDayStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(SpecialDaysAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(SpecialDaysAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readCurrentDayAttribute(): CurrentDayAttribute { + val ATTRIBUTE_ID: UInt = 7u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Currentday attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: EnergyCalendarClusterDayStruct? = + if (!tlvReader.isNull()) { + EnergyCalendarClusterDayStruct.fromTlv(AnonymousTag, tlvReader) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return CurrentDayAttribute(decodedValue) + } + + suspend fun subscribeCurrentDayAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 7u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + CurrentDayAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Currentday attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: EnergyCalendarClusterDayStruct? = + if (!tlvReader.isNull()) { + EnergyCalendarClusterDayStruct.fromTlv(AnonymousTag, tlvReader) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(CurrentDayAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(CurrentDayAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readNextDayAttribute(): NextDayAttribute { + val ATTRIBUTE_ID: UInt = 8u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Nextday attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: EnergyCalendarClusterDayStruct? = + if (!tlvReader.isNull()) { + EnergyCalendarClusterDayStruct.fromTlv(AnonymousTag, tlvReader) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return NextDayAttribute(decodedValue) + } + + suspend fun subscribeNextDayAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 8u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + NextDayAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Nextday attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: EnergyCalendarClusterDayStruct? = + if (!tlvReader.isNull()) { + EnergyCalendarClusterDayStruct.fromTlv(AnonymousTag, tlvReader) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(NextDayAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(NextDayAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readCurrentTransitionAttribute(): CurrentTransitionAttribute { + val ATTRIBUTE_ID: UInt = 9u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Currenttransition attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: EnergyCalendarClusterTransitionStruct? = + if (!tlvReader.isNull()) { + EnergyCalendarClusterTransitionStruct.fromTlv(AnonymousTag, tlvReader) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return CurrentTransitionAttribute(decodedValue) + } + + suspend fun subscribeCurrentTransitionAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 9u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + CurrentTransitionAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Currenttransition attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: EnergyCalendarClusterTransitionStruct? = + if (!tlvReader.isNull()) { + EnergyCalendarClusterTransitionStruct.fromTlv(AnonymousTag, tlvReader) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(CurrentTransitionAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(CurrentTransitionAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readCurrentPeakPeriodAttribute(): CurrentPeakPeriodAttribute { + val ATTRIBUTE_ID: UInt = 10u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Currentpeakperiod attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: EnergyCalendarClusterPeakPeriodStruct? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + EnergyCalendarClusterPeakPeriodStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return CurrentPeakPeriodAttribute(decodedValue) + } + + suspend fun subscribeCurrentPeakPeriodAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 10u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + CurrentPeakPeriodAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Currentpeakperiod attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: EnergyCalendarClusterPeakPeriodStruct? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + EnergyCalendarClusterPeakPeriodStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(CurrentPeakPeriodAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(CurrentPeakPeriodAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readNextPeakPeriodAttribute(): NextPeakPeriodAttribute { + val ATTRIBUTE_ID: UInt = 11u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Nextpeakperiod attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: EnergyCalendarClusterPeakPeriodStruct? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + EnergyCalendarClusterPeakPeriodStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return NextPeakPeriodAttribute(decodedValue) + } + + suspend fun subscribeNextPeakPeriodAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 11u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + NextPeakPeriodAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Nextpeakperiod attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: EnergyCalendarClusterPeakPeriodStruct? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + EnergyCalendarClusterPeakPeriodStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(NextPeakPeriodAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(NextPeakPeriodAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65528u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Generatedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return GeneratedCommandListAttribute(decodedValue) + } + + suspend fun subscribeGeneratedCommandListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65528u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + GeneratedCommandListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Generatedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(GeneratedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(GeneratedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAcceptedCommandListAttribute(): AcceptedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65529u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Acceptedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AcceptedCommandListAttribute(decodedValue) + } + + suspend fun subscribeAcceptedCommandListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65529u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AcceptedCommandListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Acceptedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AcceptedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AcceptedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readEventListAttribute(): EventListAttribute { + val ATTRIBUTE_ID: UInt = 65530u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Eventlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return EventListAttribute(decodedValue) + } + + suspend fun subscribeEventListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65530u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + EventListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Eventlist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(EventListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(EventListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAttributeListAttribute(): AttributeListAttribute { + val ATTRIBUTE_ID: UInt = 65531u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Attributelist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AttributeListAttribute(decodedValue) + } + + suspend fun subscribeAttributeListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65531u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AttributeListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Attributelist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AttributeListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AttributeListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readFeatureMapAttribute(): UInt { + val ATTRIBUTE_ID: UInt = 65532u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Featuremap attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeFeatureMapAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65532u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UIntSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Featuremap attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + emit(UIntSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UIntSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readClusterRevisionAttribute(): UShort { + val ATTRIBUTE_ID: UInt = 65533u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Clusterrevision attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeClusterRevisionAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65533u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UShortSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Clusterrevision attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + emit(UShortSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UShortSubscriptionState.SubscriptionEstablished) + } + } + } + } + + companion object { + private val logger = Logger.getLogger(EnergyCalendarCluster::class.java.name) + const val CLUSTER_ID: UInt = 154u + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/MeterIdentificationCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/MeterIdentificationCluster.kt new file mode 100644 index 00000000000000..715819ccb189da --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/MeterIdentificationCluster.kt @@ -0,0 +1,1170 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package matter.controller.cluster.clusters + +import java.time.Duration +import java.util.logging.Level +import java.util.logging.Logger +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.transform +import matter.controller.MatterController +import matter.controller.ReadData +import matter.controller.ReadRequest +import matter.controller.SubscribeRequest +import matter.controller.SubscriptionState +import matter.controller.UIntSubscriptionState +import matter.controller.UShortSubscriptionState +import matter.controller.cluster.structs.* +import matter.controller.model.AttributePath +import matter.tlv.AnonymousTag +import matter.tlv.TlvReader + +class MeterIdentificationCluster( + private val controller: MatterController, + private val endpointId: UShort, +) { + class MeterTypeAttribute(val value: UByte?) + + sealed class MeterTypeAttributeSubscriptionState { + data class Success(val value: UByte?) : MeterTypeAttributeSubscriptionState() + + data class Error(val exception: Exception) : MeterTypeAttributeSubscriptionState() + + object SubscriptionEstablished : MeterTypeAttributeSubscriptionState() + } + + class UtilityNameAttribute(val value: String?) + + sealed class UtilityNameAttributeSubscriptionState { + data class Success(val value: String?) : UtilityNameAttributeSubscriptionState() + + data class Error(val exception: Exception) : UtilityNameAttributeSubscriptionState() + + object SubscriptionEstablished : UtilityNameAttributeSubscriptionState() + } + + class PointOfDeliveryAttribute(val value: String?) + + sealed class PointOfDeliveryAttributeSubscriptionState { + data class Success(val value: String?) : PointOfDeliveryAttributeSubscriptionState() + + data class Error(val exception: Exception) : PointOfDeliveryAttributeSubscriptionState() + + object SubscriptionEstablished : PointOfDeliveryAttributeSubscriptionState() + } + + class PowerThresholdAttribute(val value: Long?) + + sealed class PowerThresholdAttributeSubscriptionState { + data class Success(val value: Long?) : PowerThresholdAttributeSubscriptionState() + + data class Error(val exception: Exception) : PowerThresholdAttributeSubscriptionState() + + object SubscriptionEstablished : PowerThresholdAttributeSubscriptionState() + } + + class PowerThresholdSourceAttribute(val value: UByte?) + + sealed class PowerThresholdSourceAttributeSubscriptionState { + data class Success(val value: UByte?) : PowerThresholdSourceAttributeSubscriptionState() + + data class Error(val exception: Exception) : PowerThresholdSourceAttributeSubscriptionState() + + object SubscriptionEstablished : PowerThresholdSourceAttributeSubscriptionState() + } + + class GeneratedCommandListAttribute(val value: List) + + sealed class GeneratedCommandListAttributeSubscriptionState { + data class Success(val value: List) : GeneratedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : GeneratedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : GeneratedCommandListAttributeSubscriptionState() + } + + class AcceptedCommandListAttribute(val value: List) + + sealed class AcceptedCommandListAttributeSubscriptionState { + data class Success(val value: List) : AcceptedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AcceptedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : AcceptedCommandListAttributeSubscriptionState() + } + + class EventListAttribute(val value: List) + + sealed class EventListAttributeSubscriptionState { + data class Success(val value: List) : EventListAttributeSubscriptionState() + + data class Error(val exception: Exception) : EventListAttributeSubscriptionState() + + object SubscriptionEstablished : EventListAttributeSubscriptionState() + } + + class AttributeListAttribute(val value: List) + + sealed class AttributeListAttributeSubscriptionState { + data class Success(val value: List) : AttributeListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AttributeListAttributeSubscriptionState() + + object SubscriptionEstablished : AttributeListAttributeSubscriptionState() + } + + suspend fun readMeterTypeAttribute(): MeterTypeAttribute { + val ATTRIBUTE_ID: UInt = 0u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Metertype attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (!tlvReader.isNull()) { + tlvReader.getUByte(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return MeterTypeAttribute(decodedValue) + } + + suspend fun subscribeMeterTypeAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 0u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + MeterTypeAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Metertype attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (!tlvReader.isNull()) { + tlvReader.getUByte(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(MeterTypeAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(MeterTypeAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readUtilityNameAttribute(): UtilityNameAttribute { + val ATTRIBUTE_ID: UInt = 1u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Utilityname attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: String? = + if (!tlvReader.isNull()) { + tlvReader.getString(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return UtilityNameAttribute(decodedValue) + } + + suspend fun subscribeUtilityNameAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 1u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UtilityNameAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Utilityname attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: String? = + if (!tlvReader.isNull()) { + tlvReader.getString(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(UtilityNameAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UtilityNameAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readPointOfDeliveryAttribute(): PointOfDeliveryAttribute { + val ATTRIBUTE_ID: UInt = 2u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Pointofdelivery attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: String? = + if (!tlvReader.isNull()) { + tlvReader.getString(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return PointOfDeliveryAttribute(decodedValue) + } + + suspend fun subscribePointOfDeliveryAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 2u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + PointOfDeliveryAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Pointofdelivery attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: String? = + if (!tlvReader.isNull()) { + tlvReader.getString(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(PointOfDeliveryAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(PointOfDeliveryAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readPowerThresholdAttribute(): PowerThresholdAttribute { + val ATTRIBUTE_ID: UInt = 3u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Powerthreshold attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Long? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getLong(AnonymousTag) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return PowerThresholdAttribute(decodedValue) + } + + suspend fun subscribePowerThresholdAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 3u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + PowerThresholdAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Powerthreshold attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Long? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getLong(AnonymousTag) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(PowerThresholdAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(PowerThresholdAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readPowerThresholdSourceAttribute(): PowerThresholdSourceAttribute { + val ATTRIBUTE_ID: UInt = 4u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Powerthresholdsource attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return PowerThresholdSourceAttribute(decodedValue) + } + + suspend fun subscribePowerThresholdSourceAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 4u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + PowerThresholdSourceAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Powerthresholdsource attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(PowerThresholdSourceAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(PowerThresholdSourceAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65528u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Generatedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return GeneratedCommandListAttribute(decodedValue) + } + + suspend fun subscribeGeneratedCommandListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65528u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + GeneratedCommandListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Generatedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(GeneratedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(GeneratedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAcceptedCommandListAttribute(): AcceptedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65529u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Acceptedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AcceptedCommandListAttribute(decodedValue) + } + + suspend fun subscribeAcceptedCommandListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65529u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AcceptedCommandListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Acceptedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AcceptedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AcceptedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readEventListAttribute(): EventListAttribute { + val ATTRIBUTE_ID: UInt = 65530u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Eventlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return EventListAttribute(decodedValue) + } + + suspend fun subscribeEventListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65530u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + EventListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Eventlist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(EventListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(EventListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAttributeListAttribute(): AttributeListAttribute { + val ATTRIBUTE_ID: UInt = 65531u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Attributelist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AttributeListAttribute(decodedValue) + } + + suspend fun subscribeAttributeListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65531u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AttributeListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Attributelist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AttributeListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AttributeListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readFeatureMapAttribute(): UInt { + val ATTRIBUTE_ID: UInt = 65532u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Featuremap attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeFeatureMapAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65532u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UIntSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Featuremap attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + emit(UIntSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UIntSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readClusterRevisionAttribute(): UShort { + val ATTRIBUTE_ID: UInt = 65533u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Clusterrevision attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeClusterRevisionAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65533u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UShortSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Clusterrevision attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + emit(UShortSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UShortSubscriptionState.SubscriptionEstablished) + } + } + } + } + + companion object { + private val logger = Logger.getLogger(MeterIdentificationCluster::class.java.name) + const val CLUSTER_ID: UInt = 2822u + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/files.gni b/src/controller/java/generated/java/matter/controller/cluster/files.gni index 4485a760e2b427..5dcf78a8c3c8ad 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni @@ -64,6 +64,10 @@ matter_structs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ElectricalPowerMeasurementClusterMeasurementAccuracyRangeStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ElectricalPowerMeasurementClusterMeasurementAccuracyStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ElectricalPowerMeasurementClusterMeasurementRangeStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyCalendarClusterCalendarPeriodStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyCalendarClusterDayStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyCalendarClusterPeakPeriodStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyCalendarClusterTransitionStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyEvseClusterChargingTargetStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyEvseModeClusterModeOptionStruct.kt", @@ -267,6 +271,7 @@ matter_clusters_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ElectricalEnergyMeasurementCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ElectricalMeasurementCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ElectricalPowerMeasurementCluster.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyCalendarCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyEvseCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyEvseModeCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyPreferenceCluster.kt", @@ -294,6 +299,7 @@ matter_clusters_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/MediaInputCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/MediaPlaybackCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/MessagesCluster.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/MeterIdentificationCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/MicrowaveOvenControlCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/MicrowaveOvenModeCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ModeSelectCluster.kt", diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyCalendarClusterCalendarPeriodStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyCalendarClusterCalendarPeriodStruct.kt new file mode 100644 index 00000000000000..a18bcbe8891118 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyCalendarClusterCalendarPeriodStruct.kt @@ -0,0 +1,81 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class EnergyCalendarClusterCalendarPeriodStruct( + val startDate: UInt?, + val days: List, +) { + override fun toString(): String = buildString { + append("EnergyCalendarClusterCalendarPeriodStruct {\n") + append("\tstartDate : $startDate\n") + append("\tdays : $days\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (startDate != null) { + put(ContextSpecificTag(TAG_START_DATE), startDate) + } else { + putNull(ContextSpecificTag(TAG_START_DATE)) + } + startArray(ContextSpecificTag(TAG_DAYS)) + for (item in days.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + endStructure() + } + } + + companion object { + private const val TAG_START_DATE = 0 + private const val TAG_DAYS = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyCalendarClusterCalendarPeriodStruct { + tlvReader.enterStructure(tlvTag) + val startDate = + if (!tlvReader.isNull()) { + tlvReader.getUInt(ContextSpecificTag(TAG_START_DATE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_START_DATE)) + null + } + val days = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_DAYS)) + while (!tlvReader.isEndOfContainer()) { + add(EnergyCalendarClusterDayStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + + tlvReader.exitContainer() + + return EnergyCalendarClusterCalendarPeriodStruct(startDate, days) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyCalendarClusterDayStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyCalendarClusterDayStruct.kt new file mode 100644 index 00000000000000..a45936a14060d9 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyCalendarClusterDayStruct.kt @@ -0,0 +1,106 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.structs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class EnergyCalendarClusterDayStruct( + val date: Optional, + val daysOfWeek: Optional, + val transitions: List, + val calendarID: Optional, +) { + override fun toString(): String = buildString { + append("EnergyCalendarClusterDayStruct {\n") + append("\tdate : $date\n") + append("\tdaysOfWeek : $daysOfWeek\n") + append("\ttransitions : $transitions\n") + append("\tcalendarID : $calendarID\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (date.isPresent) { + val optdate = date.get() + put(ContextSpecificTag(TAG_DATE), optdate) + } + if (daysOfWeek.isPresent) { + val optdaysOfWeek = daysOfWeek.get() + put(ContextSpecificTag(TAG_DAYS_OF_WEEK), optdaysOfWeek) + } + startArray(ContextSpecificTag(TAG_TRANSITIONS)) + for (item in transitions.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + if (calendarID.isPresent) { + val optcalendarID = calendarID.get() + put(ContextSpecificTag(TAG_CALENDAR_I_D), optcalendarID) + } + endStructure() + } + } + + companion object { + private const val TAG_DATE = 0 + private const val TAG_DAYS_OF_WEEK = 1 + private const val TAG_TRANSITIONS = 2 + private const val TAG_CALENDAR_I_D = 3 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyCalendarClusterDayStruct { + tlvReader.enterStructure(tlvTag) + val date = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_DATE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_DATE))) + } else { + Optional.empty() + } + val daysOfWeek = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_DAYS_OF_WEEK))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_DAYS_OF_WEEK))) + } else { + Optional.empty() + } + val transitions = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_TRANSITIONS)) + while (!tlvReader.isEndOfContainer()) { + add(EnergyCalendarClusterTransitionStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + val calendarID = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CALENDAR_I_D))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_CALENDAR_I_D))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return EnergyCalendarClusterDayStruct(date, daysOfWeek, transitions, calendarID) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyCalendarClusterPeakPeriodStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyCalendarClusterPeakPeriodStruct.kt new file mode 100644 index 00000000000000..b12465d88c55f4 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyCalendarClusterPeakPeriodStruct.kt @@ -0,0 +1,89 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class EnergyCalendarClusterPeakPeriodStruct( + val severity: UByte, + val peakPeriod: UShort, + val startTime: UInt?, + val endTime: UInt?, +) { + override fun toString(): String = buildString { + append("EnergyCalendarClusterPeakPeriodStruct {\n") + append("\tseverity : $severity\n") + append("\tpeakPeriod : $peakPeriod\n") + append("\tstartTime : $startTime\n") + append("\tendTime : $endTime\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SEVERITY), severity) + put(ContextSpecificTag(TAG_PEAK_PERIOD), peakPeriod) + if (startTime != null) { + put(ContextSpecificTag(TAG_START_TIME), startTime) + } else { + putNull(ContextSpecificTag(TAG_START_TIME)) + } + if (endTime != null) { + put(ContextSpecificTag(TAG_END_TIME), endTime) + } else { + putNull(ContextSpecificTag(TAG_END_TIME)) + } + endStructure() + } + } + + companion object { + private const val TAG_SEVERITY = 0 + private const val TAG_PEAK_PERIOD = 1 + private const val TAG_START_TIME = 2 + private const val TAG_END_TIME = 3 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyCalendarClusterPeakPeriodStruct { + tlvReader.enterStructure(tlvTag) + val severity = tlvReader.getUByte(ContextSpecificTag(TAG_SEVERITY)) + val peakPeriod = tlvReader.getUShort(ContextSpecificTag(TAG_PEAK_PERIOD)) + val startTime = + if (!tlvReader.isNull()) { + tlvReader.getUInt(ContextSpecificTag(TAG_START_TIME)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_START_TIME)) + null + } + val endTime = + if (!tlvReader.isNull()) { + tlvReader.getUInt(ContextSpecificTag(TAG_END_TIME)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_END_TIME)) + null + } + + tlvReader.exitContainer() + + return EnergyCalendarClusterPeakPeriodStruct(severity, peakPeriod, startTime, endTime) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyCalendarClusterTransitionStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyCalendarClusterTransitionStruct.kt new file mode 100644 index 00000000000000..57a0db6559ee93 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyCalendarClusterTransitionStruct.kt @@ -0,0 +1,99 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.structs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class EnergyCalendarClusterTransitionStruct( + val transitionTime: UShort, + val priceTier: Optional, + val friendlyCredit: Optional, + val auxiliaryLoad: Optional, +) { + override fun toString(): String = buildString { + append("EnergyCalendarClusterTransitionStruct {\n") + append("\ttransitionTime : $transitionTime\n") + append("\tpriceTier : $priceTier\n") + append("\tfriendlyCredit : $friendlyCredit\n") + append("\tauxiliaryLoad : $auxiliaryLoad\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_TRANSITION_TIME), transitionTime) + if (priceTier.isPresent) { + val optpriceTier = priceTier.get() + put(ContextSpecificTag(TAG_PRICE_TIER), optpriceTier) + } + if (friendlyCredit.isPresent) { + val optfriendlyCredit = friendlyCredit.get() + put(ContextSpecificTag(TAG_FRIENDLY_CREDIT), optfriendlyCredit) + } + if (auxiliaryLoad.isPresent) { + val optauxiliaryLoad = auxiliaryLoad.get() + put(ContextSpecificTag(TAG_AUXILIARY_LOAD), optauxiliaryLoad) + } + endStructure() + } + } + + companion object { + private const val TAG_TRANSITION_TIME = 0 + private const val TAG_PRICE_TIER = 1 + private const val TAG_FRIENDLY_CREDIT = 2 + private const val TAG_AUXILIARY_LOAD = 3 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyCalendarClusterTransitionStruct { + tlvReader.enterStructure(tlvTag) + val transitionTime = tlvReader.getUShort(ContextSpecificTag(TAG_TRANSITION_TIME)) + val priceTier = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PRICE_TIER))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_PRICE_TIER))) + } else { + Optional.empty() + } + val friendlyCredit = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_FRIENDLY_CREDIT))) { + Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_FRIENDLY_CREDIT))) + } else { + Optional.empty() + } + val auxiliaryLoad = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_AUXILIARY_LOAD))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_AUXILIARY_LOAD))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return EnergyCalendarClusterTransitionStruct( + transitionTime, + priceTier, + friendlyCredit, + auxiliaryLoad, + ) + } + } +} diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 4cebe9ea5a1829..672765c4a4e756 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -24831,6 +24831,1334 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::EnergyCalendar::Id: { + using namespace app::Clusters::EnergyCalendar; + switch (aPath.mAttributeId) + { + case Attributes::CalendarID::Id: { + using TypeInfo = Attributes::CalendarID::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::Name::Id: { + using TypeInfo = Attributes::Name::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 + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value(), value)); + } + return value; + } + case Attributes::ProviderID::Id: { + using TypeInfo = Attributes::ProviderID::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::EventID::Id: { + using TypeInfo = Attributes::EventID::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::StartDate::Id: { + using TypeInfo = Attributes::StartDate::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::CalendarPeriods::Id: { + using TypeInfo = Attributes::CalendarPeriods::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 + { + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_1 = cppValue.Value().begin(); + while (iter_value_1.Next()) + { + auto & entry_1 = iter_value_1.GetValue(); + jobject newElement_1; + jobject newElement_1_startDate; + if (entry_1.startDate.IsNull()) + { + newElement_1_startDate = nullptr; + } + else + { + std::string newElement_1_startDateClassName = "java/lang/Long"; + std::string newElement_1_startDateCtorSignature = "(J)V"; + jlong jninewElement_1_startDate = static_cast(entry_1.startDate.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_1_startDateClassName.c_str(), newElement_1_startDateCtorSignature.c_str(), + jninewElement_1_startDate, newElement_1_startDate); + } + jobject newElement_1_days; + chip::JniReferences::GetInstance().CreateArrayList(newElement_1_days); + + auto iter_newElement_1_days_3 = entry_1.days.begin(); + while (iter_newElement_1_days_3.Next()) + { + auto & entry_3 = iter_newElement_1_days_3.GetValue(); + jobject newElement_3; + jobject newElement_3_date; + if (!entry_3.date.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_3_date); + } + else + { + jobject newElement_3_dateInsideOptional; + std::string newElement_3_dateInsideOptionalClassName = "java/lang/Long"; + std::string newElement_3_dateInsideOptionalCtorSignature = "(J)V"; + jlong jninewElement_3_dateInsideOptional = static_cast(entry_3.date.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_3_dateInsideOptionalClassName.c_str(), + newElement_3_dateInsideOptionalCtorSignature.c_str(), jninewElement_3_dateInsideOptional, + newElement_3_dateInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_3_dateInsideOptional, newElement_3_date); + } + jobject newElement_3_daysOfWeek; + if (!entry_3.daysOfWeek.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_3_daysOfWeek); + } + else + { + jobject newElement_3_daysOfWeekInsideOptional; + std::string newElement_3_daysOfWeekInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_3_daysOfWeekInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_3_daysOfWeekInsideOptional = static_cast(entry_3.daysOfWeek.Value().Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_3_daysOfWeekInsideOptionalClassName.c_str(), + newElement_3_daysOfWeekInsideOptionalCtorSignature.c_str(), + jninewElement_3_daysOfWeekInsideOptional, newElement_3_daysOfWeekInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_3_daysOfWeekInsideOptional, + newElement_3_daysOfWeek); + } + jobject newElement_3_transitions; + chip::JniReferences::GetInstance().CreateArrayList(newElement_3_transitions); + + auto iter_newElement_3_transitions_5 = entry_3.transitions.begin(); + while (iter_newElement_3_transitions_5.Next()) + { + auto & entry_5 = iter_newElement_3_transitions_5.GetValue(); + jobject newElement_5; + jobject newElement_5_transitionTime; + std::string newElement_5_transitionTimeClassName = "java/lang/Integer"; + std::string newElement_5_transitionTimeCtorSignature = "(I)V"; + jint jninewElement_5_transitionTime = static_cast(entry_5.transitionTime); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_5_transitionTimeClassName.c_str(), newElement_5_transitionTimeCtorSignature.c_str(), + jninewElement_5_transitionTime, newElement_5_transitionTime); + jobject newElement_5_priceTier; + if (!entry_5.priceTier.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_5_priceTier); + } + else + { + jobject newElement_5_priceTierInsideOptional; + std::string newElement_5_priceTierInsideOptionalClassName = "java/lang/Long"; + std::string newElement_5_priceTierInsideOptionalCtorSignature = "(J)V"; + jlong jninewElement_5_priceTierInsideOptional = static_cast(entry_5.priceTier.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_5_priceTierInsideOptionalClassName.c_str(), + newElement_5_priceTierInsideOptionalCtorSignature.c_str(), + jninewElement_5_priceTierInsideOptional, newElement_5_priceTierInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_5_priceTierInsideOptional, + newElement_5_priceTier); + } + jobject newElement_5_friendlyCredit; + if (!entry_5.friendlyCredit.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_5_friendlyCredit); + } + else + { + jobject newElement_5_friendlyCreditInsideOptional; + std::string newElement_5_friendlyCreditInsideOptionalClassName = "java/lang/Boolean"; + std::string newElement_5_friendlyCreditInsideOptionalCtorSignature = "(Z)V"; + jboolean jninewElement_5_friendlyCreditInsideOptional = + static_cast(entry_5.friendlyCredit.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_5_friendlyCreditInsideOptionalClassName.c_str(), + newElement_5_friendlyCreditInsideOptionalCtorSignature.c_str(), + jninewElement_5_friendlyCreditInsideOptional, newElement_5_friendlyCreditInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_5_friendlyCreditInsideOptional, + newElement_5_friendlyCredit); + } + jobject newElement_5_auxiliaryLoad; + if (!entry_5.auxiliaryLoad.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_5_auxiliaryLoad); + } + else + { + jobject newElement_5_auxiliaryLoadInsideOptional; + std::string newElement_5_auxiliaryLoadInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_5_auxiliaryLoadInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_5_auxiliaryLoadInsideOptional = + static_cast(entry_5.auxiliaryLoad.Value().Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_5_auxiliaryLoadInsideOptionalClassName.c_str(), + newElement_5_auxiliaryLoadInsideOptionalCtorSignature.c_str(), + jninewElement_5_auxiliaryLoadInsideOptional, newElement_5_auxiliaryLoadInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_5_auxiliaryLoadInsideOptional, + newElement_5_auxiliaryLoad); + } + + jclass transitionStructStructClass_6; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EnergyCalendarClusterTransitionStruct", + transitionStructStructClass_6); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EnergyCalendarClusterTransitionStruct"); + return nullptr; + } + + jmethodID transitionStructStructCtor_6; + err = chip::JniReferences::GetInstance().FindMethod( + env, transitionStructStructClass_6, "", + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &transitionStructStructCtor_6); + if (err != CHIP_NO_ERROR || transitionStructStructCtor_6 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$EnergyCalendarClusterTransitionStruct constructor"); + return nullptr; + } + + newElement_5 = env->NewObject(transitionStructStructClass_6, transitionStructStructCtor_6, + newElement_5_transitionTime, newElement_5_priceTier, + newElement_5_friendlyCredit, newElement_5_auxiliaryLoad); + chip::JniReferences::GetInstance().AddToList(newElement_3_transitions, newElement_5); + } + jobject newElement_3_calendarID; + if (!entry_3.calendarID.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_3_calendarID); + } + else + { + jobject newElement_3_calendarIDInsideOptional; + std::string newElement_3_calendarIDInsideOptionalClassName = "java/lang/Long"; + std::string newElement_3_calendarIDInsideOptionalCtorSignature = "(J)V"; + jlong jninewElement_3_calendarIDInsideOptional = static_cast(entry_3.calendarID.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_3_calendarIDInsideOptionalClassName.c_str(), + newElement_3_calendarIDInsideOptionalCtorSignature.c_str(), + jninewElement_3_calendarIDInsideOptional, newElement_3_calendarIDInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_3_calendarIDInsideOptional, + newElement_3_calendarID); + } + + jclass dayStructStructClass_4; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EnergyCalendarClusterDayStruct", dayStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EnergyCalendarClusterDayStruct"); + return nullptr; + } + + jmethodID dayStructStructCtor_4; + err = chip::JniReferences::GetInstance().FindMethod( + env, dayStructStructClass_4, "", + "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/ArrayList;Ljava/util/Optional;)V", + &dayStructStructCtor_4); + if (err != CHIP_NO_ERROR || dayStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$EnergyCalendarClusterDayStruct constructor"); + return nullptr; + } + + newElement_3 = env->NewObject(dayStructStructClass_4, dayStructStructCtor_4, newElement_3_date, + newElement_3_daysOfWeek, newElement_3_transitions, newElement_3_calendarID); + chip::JniReferences::GetInstance().AddToList(newElement_1_days, newElement_3); + } + + jclass calendarPeriodStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EnergyCalendarClusterCalendarPeriodStruct", + calendarPeriodStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EnergyCalendarClusterCalendarPeriodStruct"); + return nullptr; + } + + jmethodID calendarPeriodStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, calendarPeriodStructStructClass_2, "", + "(Ljava/lang/Long;Ljava/util/ArrayList;)V", + &calendarPeriodStructStructCtor_2); + if (err != CHIP_NO_ERROR || calendarPeriodStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$EnergyCalendarClusterCalendarPeriodStruct constructor"); + return nullptr; + } + + newElement_1 = env->NewObject(calendarPeriodStructStructClass_2, calendarPeriodStructStructCtor_2, + newElement_1_startDate, newElement_1_days); + chip::JniReferences::GetInstance().AddToList(value, newElement_1); + } + } + return value; + } + case Attributes::SpecialDays::Id: { + using TypeInfo = Attributes::SpecialDays::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 + { + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_1 = cppValue.Value().begin(); + while (iter_value_1.Next()) + { + auto & entry_1 = iter_value_1.GetValue(); + jobject newElement_1; + jobject newElement_1_date; + if (!entry_1.date.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_1_date); + } + else + { + jobject newElement_1_dateInsideOptional; + std::string newElement_1_dateInsideOptionalClassName = "java/lang/Long"; + std::string newElement_1_dateInsideOptionalCtorSignature = "(J)V"; + jlong jninewElement_1_dateInsideOptional = static_cast(entry_1.date.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_1_dateInsideOptionalClassName.c_str(), newElement_1_dateInsideOptionalCtorSignature.c_str(), + jninewElement_1_dateInsideOptional, newElement_1_dateInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_1_dateInsideOptional, newElement_1_date); + } + jobject newElement_1_daysOfWeek; + if (!entry_1.daysOfWeek.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_1_daysOfWeek); + } + else + { + jobject newElement_1_daysOfWeekInsideOptional; + std::string newElement_1_daysOfWeekInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_1_daysOfWeekInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_1_daysOfWeekInsideOptional = static_cast(entry_1.daysOfWeek.Value().Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_1_daysOfWeekInsideOptionalClassName.c_str(), + newElement_1_daysOfWeekInsideOptionalCtorSignature.c_str(), jninewElement_1_daysOfWeekInsideOptional, + newElement_1_daysOfWeekInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_1_daysOfWeekInsideOptional, + newElement_1_daysOfWeek); + } + jobject newElement_1_transitions; + chip::JniReferences::GetInstance().CreateArrayList(newElement_1_transitions); + + auto iter_newElement_1_transitions_3 = entry_1.transitions.begin(); + while (iter_newElement_1_transitions_3.Next()) + { + auto & entry_3 = iter_newElement_1_transitions_3.GetValue(); + jobject newElement_3; + jobject newElement_3_transitionTime; + std::string newElement_3_transitionTimeClassName = "java/lang/Integer"; + std::string newElement_3_transitionTimeCtorSignature = "(I)V"; + jint jninewElement_3_transitionTime = static_cast(entry_3.transitionTime); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_3_transitionTimeClassName.c_str(), newElement_3_transitionTimeCtorSignature.c_str(), + jninewElement_3_transitionTime, newElement_3_transitionTime); + jobject newElement_3_priceTier; + if (!entry_3.priceTier.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_3_priceTier); + } + else + { + jobject newElement_3_priceTierInsideOptional; + std::string newElement_3_priceTierInsideOptionalClassName = "java/lang/Long"; + std::string newElement_3_priceTierInsideOptionalCtorSignature = "(J)V"; + jlong jninewElement_3_priceTierInsideOptional = static_cast(entry_3.priceTier.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_3_priceTierInsideOptionalClassName.c_str(), + newElement_3_priceTierInsideOptionalCtorSignature.c_str(), jninewElement_3_priceTierInsideOptional, + newElement_3_priceTierInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_3_priceTierInsideOptional, + newElement_3_priceTier); + } + jobject newElement_3_friendlyCredit; + if (!entry_3.friendlyCredit.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_3_friendlyCredit); + } + else + { + jobject newElement_3_friendlyCreditInsideOptional; + std::string newElement_3_friendlyCreditInsideOptionalClassName = "java/lang/Boolean"; + std::string newElement_3_friendlyCreditInsideOptionalCtorSignature = "(Z)V"; + jboolean jninewElement_3_friendlyCreditInsideOptional = + static_cast(entry_3.friendlyCredit.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_3_friendlyCreditInsideOptionalClassName.c_str(), + newElement_3_friendlyCreditInsideOptionalCtorSignature.c_str(), + jninewElement_3_friendlyCreditInsideOptional, newElement_3_friendlyCreditInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_3_friendlyCreditInsideOptional, + newElement_3_friendlyCredit); + } + jobject newElement_3_auxiliaryLoad; + if (!entry_3.auxiliaryLoad.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_3_auxiliaryLoad); + } + else + { + jobject newElement_3_auxiliaryLoadInsideOptional; + std::string newElement_3_auxiliaryLoadInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_3_auxiliaryLoadInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_3_auxiliaryLoadInsideOptional = + static_cast(entry_3.auxiliaryLoad.Value().Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_3_auxiliaryLoadInsideOptionalClassName.c_str(), + newElement_3_auxiliaryLoadInsideOptionalCtorSignature.c_str(), + jninewElement_3_auxiliaryLoadInsideOptional, newElement_3_auxiliaryLoadInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_3_auxiliaryLoadInsideOptional, + newElement_3_auxiliaryLoad); + } + + jclass transitionStructStructClass_4; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EnergyCalendarClusterTransitionStruct", + transitionStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EnergyCalendarClusterTransitionStruct"); + return nullptr; + } + + jmethodID transitionStructStructCtor_4; + err = chip::JniReferences::GetInstance().FindMethod( + env, transitionStructStructClass_4, "", + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &transitionStructStructCtor_4); + if (err != CHIP_NO_ERROR || transitionStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$EnergyCalendarClusterTransitionStruct constructor"); + return nullptr; + } + + newElement_3 = + env->NewObject(transitionStructStructClass_4, transitionStructStructCtor_4, newElement_3_transitionTime, + newElement_3_priceTier, newElement_3_friendlyCredit, newElement_3_auxiliaryLoad); + chip::JniReferences::GetInstance().AddToList(newElement_1_transitions, newElement_3); + } + jobject newElement_1_calendarID; + if (!entry_1.calendarID.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_1_calendarID); + } + else + { + jobject newElement_1_calendarIDInsideOptional; + std::string newElement_1_calendarIDInsideOptionalClassName = "java/lang/Long"; + std::string newElement_1_calendarIDInsideOptionalCtorSignature = "(J)V"; + jlong jninewElement_1_calendarIDInsideOptional = static_cast(entry_1.calendarID.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_1_calendarIDInsideOptionalClassName.c_str(), + newElement_1_calendarIDInsideOptionalCtorSignature.c_str(), jninewElement_1_calendarIDInsideOptional, + newElement_1_calendarIDInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_1_calendarIDInsideOptional, + newElement_1_calendarID); + } + + jclass dayStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EnergyCalendarClusterDayStruct", dayStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EnergyCalendarClusterDayStruct"); + return nullptr; + } + + jmethodID dayStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod( + env, dayStructStructClass_2, "", + "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/ArrayList;Ljava/util/Optional;)V", + &dayStructStructCtor_2); + if (err != CHIP_NO_ERROR || dayStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$EnergyCalendarClusterDayStruct constructor"); + return nullptr; + } + + newElement_1 = env->NewObject(dayStructStructClass_2, dayStructStructCtor_2, newElement_1_date, + newElement_1_daysOfWeek, newElement_1_transitions, newElement_1_calendarID); + chip::JniReferences::GetInstance().AddToList(value, newElement_1); + } + } + return value; + } + case Attributes::CurrentDay::Id: { + using TypeInfo = Attributes::CurrentDay::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 + { + jobject value_date; + if (!cppValue.Value().date.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_date); + } + else + { + jobject value_dateInsideOptional; + std::string value_dateInsideOptionalClassName = "java/lang/Long"; + std::string value_dateInsideOptionalCtorSignature = "(J)V"; + jlong jnivalue_dateInsideOptional = static_cast(cppValue.Value().date.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_dateInsideOptionalClassName.c_str(), value_dateInsideOptionalCtorSignature.c_str(), + jnivalue_dateInsideOptional, value_dateInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_dateInsideOptional, value_date); + } + jobject value_daysOfWeek; + if (!cppValue.Value().daysOfWeek.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_daysOfWeek); + } + else + { + jobject value_daysOfWeekInsideOptional; + std::string value_daysOfWeekInsideOptionalClassName = "java/lang/Integer"; + std::string value_daysOfWeekInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_daysOfWeekInsideOptional = static_cast(cppValue.Value().daysOfWeek.Value().Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_daysOfWeekInsideOptionalClassName.c_str(), value_daysOfWeekInsideOptionalCtorSignature.c_str(), + jnivalue_daysOfWeekInsideOptional, value_daysOfWeekInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_daysOfWeekInsideOptional, value_daysOfWeek); + } + jobject value_transitions; + chip::JniReferences::GetInstance().CreateArrayList(value_transitions); + + auto iter_value_transitions_2 = cppValue.Value().transitions.begin(); + while (iter_value_transitions_2.Next()) + { + auto & entry_2 = iter_value_transitions_2.GetValue(); + jobject newElement_2; + jobject newElement_2_transitionTime; + std::string newElement_2_transitionTimeClassName = "java/lang/Integer"; + std::string newElement_2_transitionTimeCtorSignature = "(I)V"; + jint jninewElement_2_transitionTime = static_cast(entry_2.transitionTime); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_transitionTimeClassName.c_str(), newElement_2_transitionTimeCtorSignature.c_str(), + jninewElement_2_transitionTime, newElement_2_transitionTime); + jobject newElement_2_priceTier; + if (!entry_2.priceTier.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_priceTier); + } + else + { + jobject newElement_2_priceTierInsideOptional; + std::string newElement_2_priceTierInsideOptionalClassName = "java/lang/Long"; + std::string newElement_2_priceTierInsideOptionalCtorSignature = "(J)V"; + jlong jninewElement_2_priceTierInsideOptional = static_cast(entry_2.priceTier.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_priceTierInsideOptionalClassName.c_str(), + newElement_2_priceTierInsideOptionalCtorSignature.c_str(), jninewElement_2_priceTierInsideOptional, + newElement_2_priceTierInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_2_priceTierInsideOptional, + newElement_2_priceTier); + } + jobject newElement_2_friendlyCredit; + if (!entry_2.friendlyCredit.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_friendlyCredit); + } + else + { + jobject newElement_2_friendlyCreditInsideOptional; + std::string newElement_2_friendlyCreditInsideOptionalClassName = "java/lang/Boolean"; + std::string newElement_2_friendlyCreditInsideOptionalCtorSignature = "(Z)V"; + jboolean jninewElement_2_friendlyCreditInsideOptional = + static_cast(entry_2.friendlyCredit.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_friendlyCreditInsideOptionalClassName.c_str(), + newElement_2_friendlyCreditInsideOptionalCtorSignature.c_str(), + jninewElement_2_friendlyCreditInsideOptional, newElement_2_friendlyCreditInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_2_friendlyCreditInsideOptional, + newElement_2_friendlyCredit); + } + jobject newElement_2_auxiliaryLoad; + if (!entry_2.auxiliaryLoad.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_auxiliaryLoad); + } + else + { + jobject newElement_2_auxiliaryLoadInsideOptional; + std::string newElement_2_auxiliaryLoadInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_2_auxiliaryLoadInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_2_auxiliaryLoadInsideOptional = static_cast(entry_2.auxiliaryLoad.Value().Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_auxiliaryLoadInsideOptionalClassName.c_str(), + newElement_2_auxiliaryLoadInsideOptionalCtorSignature.c_str(), + jninewElement_2_auxiliaryLoadInsideOptional, newElement_2_auxiliaryLoadInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_2_auxiliaryLoadInsideOptional, + newElement_2_auxiliaryLoad); + } + + jclass transitionStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EnergyCalendarClusterTransitionStruct", + transitionStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EnergyCalendarClusterTransitionStruct"); + return nullptr; + } + + jmethodID transitionStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod( + env, transitionStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &transitionStructStructCtor_3); + if (err != CHIP_NO_ERROR || transitionStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$EnergyCalendarClusterTransitionStruct constructor"); + return nullptr; + } + + newElement_2 = + env->NewObject(transitionStructStructClass_3, transitionStructStructCtor_3, newElement_2_transitionTime, + newElement_2_priceTier, newElement_2_friendlyCredit, newElement_2_auxiliaryLoad); + chip::JniReferences::GetInstance().AddToList(value_transitions, newElement_2); + } + jobject value_calendarID; + if (!cppValue.Value().calendarID.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_calendarID); + } + else + { + jobject value_calendarIDInsideOptional; + std::string value_calendarIDInsideOptionalClassName = "java/lang/Long"; + std::string value_calendarIDInsideOptionalCtorSignature = "(J)V"; + jlong jnivalue_calendarIDInsideOptional = static_cast(cppValue.Value().calendarID.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_calendarIDInsideOptionalClassName.c_str(), value_calendarIDInsideOptionalCtorSignature.c_str(), + jnivalue_calendarIDInsideOptional, value_calendarIDInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_calendarIDInsideOptional, value_calendarID); + } + + jclass dayStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EnergyCalendarClusterDayStruct", dayStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EnergyCalendarClusterDayStruct"); + return nullptr; + } + + jmethodID dayStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, dayStructStructClass_1, "", + "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/ArrayList;Ljava/util/Optional;)V", &dayStructStructCtor_1); + if (err != CHIP_NO_ERROR || dayStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$EnergyCalendarClusterDayStruct constructor"); + return nullptr; + } + + value = env->NewObject(dayStructStructClass_1, dayStructStructCtor_1, value_date, value_daysOfWeek, + value_transitions, value_calendarID); + } + return value; + } + case Attributes::NextDay::Id: { + using TypeInfo = Attributes::NextDay::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 + { + jobject value_date; + if (!cppValue.Value().date.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_date); + } + else + { + jobject value_dateInsideOptional; + std::string value_dateInsideOptionalClassName = "java/lang/Long"; + std::string value_dateInsideOptionalCtorSignature = "(J)V"; + jlong jnivalue_dateInsideOptional = static_cast(cppValue.Value().date.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_dateInsideOptionalClassName.c_str(), value_dateInsideOptionalCtorSignature.c_str(), + jnivalue_dateInsideOptional, value_dateInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_dateInsideOptional, value_date); + } + jobject value_daysOfWeek; + if (!cppValue.Value().daysOfWeek.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_daysOfWeek); + } + else + { + jobject value_daysOfWeekInsideOptional; + std::string value_daysOfWeekInsideOptionalClassName = "java/lang/Integer"; + std::string value_daysOfWeekInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_daysOfWeekInsideOptional = static_cast(cppValue.Value().daysOfWeek.Value().Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_daysOfWeekInsideOptionalClassName.c_str(), value_daysOfWeekInsideOptionalCtorSignature.c_str(), + jnivalue_daysOfWeekInsideOptional, value_daysOfWeekInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_daysOfWeekInsideOptional, value_daysOfWeek); + } + jobject value_transitions; + chip::JniReferences::GetInstance().CreateArrayList(value_transitions); + + auto iter_value_transitions_2 = cppValue.Value().transitions.begin(); + while (iter_value_transitions_2.Next()) + { + auto & entry_2 = iter_value_transitions_2.GetValue(); + jobject newElement_2; + jobject newElement_2_transitionTime; + std::string newElement_2_transitionTimeClassName = "java/lang/Integer"; + std::string newElement_2_transitionTimeCtorSignature = "(I)V"; + jint jninewElement_2_transitionTime = static_cast(entry_2.transitionTime); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_transitionTimeClassName.c_str(), newElement_2_transitionTimeCtorSignature.c_str(), + jninewElement_2_transitionTime, newElement_2_transitionTime); + jobject newElement_2_priceTier; + if (!entry_2.priceTier.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_priceTier); + } + else + { + jobject newElement_2_priceTierInsideOptional; + std::string newElement_2_priceTierInsideOptionalClassName = "java/lang/Long"; + std::string newElement_2_priceTierInsideOptionalCtorSignature = "(J)V"; + jlong jninewElement_2_priceTierInsideOptional = static_cast(entry_2.priceTier.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_priceTierInsideOptionalClassName.c_str(), + newElement_2_priceTierInsideOptionalCtorSignature.c_str(), jninewElement_2_priceTierInsideOptional, + newElement_2_priceTierInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_2_priceTierInsideOptional, + newElement_2_priceTier); + } + jobject newElement_2_friendlyCredit; + if (!entry_2.friendlyCredit.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_friendlyCredit); + } + else + { + jobject newElement_2_friendlyCreditInsideOptional; + std::string newElement_2_friendlyCreditInsideOptionalClassName = "java/lang/Boolean"; + std::string newElement_2_friendlyCreditInsideOptionalCtorSignature = "(Z)V"; + jboolean jninewElement_2_friendlyCreditInsideOptional = + static_cast(entry_2.friendlyCredit.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_friendlyCreditInsideOptionalClassName.c_str(), + newElement_2_friendlyCreditInsideOptionalCtorSignature.c_str(), + jninewElement_2_friendlyCreditInsideOptional, newElement_2_friendlyCreditInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_2_friendlyCreditInsideOptional, + newElement_2_friendlyCredit); + } + jobject newElement_2_auxiliaryLoad; + if (!entry_2.auxiliaryLoad.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_auxiliaryLoad); + } + else + { + jobject newElement_2_auxiliaryLoadInsideOptional; + std::string newElement_2_auxiliaryLoadInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_2_auxiliaryLoadInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_2_auxiliaryLoadInsideOptional = static_cast(entry_2.auxiliaryLoad.Value().Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_auxiliaryLoadInsideOptionalClassName.c_str(), + newElement_2_auxiliaryLoadInsideOptionalCtorSignature.c_str(), + jninewElement_2_auxiliaryLoadInsideOptional, newElement_2_auxiliaryLoadInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_2_auxiliaryLoadInsideOptional, + newElement_2_auxiliaryLoad); + } + + jclass transitionStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EnergyCalendarClusterTransitionStruct", + transitionStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EnergyCalendarClusterTransitionStruct"); + return nullptr; + } + + jmethodID transitionStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod( + env, transitionStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &transitionStructStructCtor_3); + if (err != CHIP_NO_ERROR || transitionStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$EnergyCalendarClusterTransitionStruct constructor"); + return nullptr; + } + + newElement_2 = + env->NewObject(transitionStructStructClass_3, transitionStructStructCtor_3, newElement_2_transitionTime, + newElement_2_priceTier, newElement_2_friendlyCredit, newElement_2_auxiliaryLoad); + chip::JniReferences::GetInstance().AddToList(value_transitions, newElement_2); + } + jobject value_calendarID; + if (!cppValue.Value().calendarID.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_calendarID); + } + else + { + jobject value_calendarIDInsideOptional; + std::string value_calendarIDInsideOptionalClassName = "java/lang/Long"; + std::string value_calendarIDInsideOptionalCtorSignature = "(J)V"; + jlong jnivalue_calendarIDInsideOptional = static_cast(cppValue.Value().calendarID.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_calendarIDInsideOptionalClassName.c_str(), value_calendarIDInsideOptionalCtorSignature.c_str(), + jnivalue_calendarIDInsideOptional, value_calendarIDInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_calendarIDInsideOptional, value_calendarID); + } + + jclass dayStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EnergyCalendarClusterDayStruct", dayStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EnergyCalendarClusterDayStruct"); + return nullptr; + } + + jmethodID dayStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, dayStructStructClass_1, "", + "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/ArrayList;Ljava/util/Optional;)V", &dayStructStructCtor_1); + if (err != CHIP_NO_ERROR || dayStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$EnergyCalendarClusterDayStruct constructor"); + return nullptr; + } + + value = env->NewObject(dayStructStructClass_1, dayStructStructCtor_1, value_date, value_daysOfWeek, + value_transitions, value_calendarID); + } + return value; + } + case Attributes::CurrentTransition::Id: { + using TypeInfo = Attributes::CurrentTransition::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 + { + jobject value_transitionTime; + std::string value_transitionTimeClassName = "java/lang/Integer"; + std::string value_transitionTimeCtorSignature = "(I)V"; + jint jnivalue_transitionTime = static_cast(cppValue.Value().transitionTime); + chip::JniReferences::GetInstance().CreateBoxedObject(value_transitionTimeClassName.c_str(), + value_transitionTimeCtorSignature.c_str(), + jnivalue_transitionTime, value_transitionTime); + jobject value_priceTier; + if (!cppValue.Value().priceTier.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_priceTier); + } + else + { + jobject value_priceTierInsideOptional; + std::string value_priceTierInsideOptionalClassName = "java/lang/Long"; + std::string value_priceTierInsideOptionalCtorSignature = "(J)V"; + jlong jnivalue_priceTierInsideOptional = static_cast(cppValue.Value().priceTier.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_priceTierInsideOptionalClassName.c_str(), value_priceTierInsideOptionalCtorSignature.c_str(), + jnivalue_priceTierInsideOptional, value_priceTierInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_priceTierInsideOptional, value_priceTier); + } + jobject value_friendlyCredit; + if (!cppValue.Value().friendlyCredit.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_friendlyCredit); + } + else + { + jobject value_friendlyCreditInsideOptional; + std::string value_friendlyCreditInsideOptionalClassName = "java/lang/Boolean"; + std::string value_friendlyCreditInsideOptionalCtorSignature = "(Z)V"; + jboolean jnivalue_friendlyCreditInsideOptional = static_cast(cppValue.Value().friendlyCredit.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_friendlyCreditInsideOptionalClassName.c_str(), + value_friendlyCreditInsideOptionalCtorSignature.c_str(), jnivalue_friendlyCreditInsideOptional, + value_friendlyCreditInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_friendlyCreditInsideOptional, value_friendlyCredit); + } + jobject value_auxiliaryLoad; + if (!cppValue.Value().auxiliaryLoad.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_auxiliaryLoad); + } + else + { + jobject value_auxiliaryLoadInsideOptional; + std::string value_auxiliaryLoadInsideOptionalClassName = "java/lang/Integer"; + std::string value_auxiliaryLoadInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_auxiliaryLoadInsideOptional = static_cast(cppValue.Value().auxiliaryLoad.Value().Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_auxiliaryLoadInsideOptionalClassName.c_str(), value_auxiliaryLoadInsideOptionalCtorSignature.c_str(), + jnivalue_auxiliaryLoadInsideOptional, value_auxiliaryLoadInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_auxiliaryLoadInsideOptional, value_auxiliaryLoad); + } + + jclass transitionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EnergyCalendarClusterTransitionStruct", transitionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EnergyCalendarClusterTransitionStruct"); + return nullptr; + } + + jmethodID transitionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, transitionStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &transitionStructStructCtor_1); + if (err != CHIP_NO_ERROR || transitionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$EnergyCalendarClusterTransitionStruct constructor"); + return nullptr; + } + + value = env->NewObject(transitionStructStructClass_1, transitionStructStructCtor_1, value_transitionTime, + value_priceTier, value_friendlyCredit, value_auxiliaryLoad); + } + return value; + } + case Attributes::CurrentPeakPeriod::Id: { + using TypeInfo = Attributes::CurrentPeakPeriod::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 + { + jobject value_severity; + std::string value_severityClassName = "java/lang/Integer"; + std::string value_severityCtorSignature = "(I)V"; + jint jnivalue_severity = static_cast(cppValue.Value().severity); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_severityClassName.c_str(), value_severityCtorSignature.c_str(), jnivalue_severity, value_severity); + jobject value_peakPeriod; + std::string value_peakPeriodClassName = "java/lang/Integer"; + std::string value_peakPeriodCtorSignature = "(I)V"; + jint jnivalue_peakPeriod = static_cast(cppValue.Value().peakPeriod); + chip::JniReferences::GetInstance().CreateBoxedObject(value_peakPeriodClassName.c_str(), + value_peakPeriodCtorSignature.c_str(), + jnivalue_peakPeriod, value_peakPeriod); + jobject value_startTime; + if (cppValue.Value().startTime.IsNull()) + { + value_startTime = nullptr; + } + else + { + std::string value_startTimeClassName = "java/lang/Long"; + std::string value_startTimeCtorSignature = "(J)V"; + jlong jnivalue_startTime = static_cast(cppValue.Value().startTime.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(value_startTimeClassName.c_str(), + value_startTimeCtorSignature.c_str(), + jnivalue_startTime, value_startTime); + } + jobject value_endTime; + if (cppValue.Value().endTime.IsNull()) + { + value_endTime = nullptr; + } + else + { + std::string value_endTimeClassName = "java/lang/Long"; + std::string value_endTimeCtorSignature = "(J)V"; + jlong jnivalue_endTime = static_cast(cppValue.Value().endTime.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_endTimeClassName.c_str(), value_endTimeCtorSignature.c_str(), jnivalue_endTime, value_endTime); + } + + jclass peakPeriodStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EnergyCalendarClusterPeakPeriodStruct", peakPeriodStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EnergyCalendarClusterPeakPeriodStruct"); + return nullptr; + } + + jmethodID peakPeriodStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, peakPeriodStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;)V", &peakPeriodStructStructCtor_1); + if (err != CHIP_NO_ERROR || peakPeriodStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$EnergyCalendarClusterPeakPeriodStruct constructor"); + return nullptr; + } + + value = env->NewObject(peakPeriodStructStructClass_1, peakPeriodStructStructCtor_1, value_severity, + value_peakPeriod, value_startTime, value_endTime); + } + return value; + } + case Attributes::NextPeakPeriod::Id: { + using TypeInfo = Attributes::NextPeakPeriod::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 + { + jobject value_severity; + std::string value_severityClassName = "java/lang/Integer"; + std::string value_severityCtorSignature = "(I)V"; + jint jnivalue_severity = static_cast(cppValue.Value().severity); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_severityClassName.c_str(), value_severityCtorSignature.c_str(), jnivalue_severity, value_severity); + jobject value_peakPeriod; + std::string value_peakPeriodClassName = "java/lang/Integer"; + std::string value_peakPeriodCtorSignature = "(I)V"; + jint jnivalue_peakPeriod = static_cast(cppValue.Value().peakPeriod); + chip::JniReferences::GetInstance().CreateBoxedObject(value_peakPeriodClassName.c_str(), + value_peakPeriodCtorSignature.c_str(), + jnivalue_peakPeriod, value_peakPeriod); + jobject value_startTime; + if (cppValue.Value().startTime.IsNull()) + { + value_startTime = nullptr; + } + else + { + std::string value_startTimeClassName = "java/lang/Long"; + std::string value_startTimeCtorSignature = "(J)V"; + jlong jnivalue_startTime = static_cast(cppValue.Value().startTime.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(value_startTimeClassName.c_str(), + value_startTimeCtorSignature.c_str(), + jnivalue_startTime, value_startTime); + } + jobject value_endTime; + if (cppValue.Value().endTime.IsNull()) + { + value_endTime = nullptr; + } + else + { + std::string value_endTimeClassName = "java/lang/Long"; + std::string value_endTimeCtorSignature = "(J)V"; + jlong jnivalue_endTime = static_cast(cppValue.Value().endTime.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_endTimeClassName.c_str(), value_endTimeCtorSignature.c_str(), jnivalue_endTime, value_endTime); + } + + jclass peakPeriodStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EnergyCalendarClusterPeakPeriodStruct", peakPeriodStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EnergyCalendarClusterPeakPeriodStruct"); + return nullptr; + } + + jmethodID peakPeriodStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, peakPeriodStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;)V", &peakPeriodStructStructCtor_1); + if (err != CHIP_NO_ERROR || peakPeriodStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$EnergyCalendarClusterPeakPeriodStruct constructor"); + return nullptr; + } + + value = env->NewObject(peakPeriodStructStructClass_1, peakPeriodStructStructCtor_1, value_severity, + value_peakPeriod, value_startTime, value_endTime); + } + 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::EnergyPreference::Id: { using namespace app::Clusters::EnergyPreference; switch (aPath.mAttributeId) @@ -44281,6 +45609,255 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::MeterIdentification::Id: { + using namespace app::Clusters::MeterIdentification; + switch (aPath.mAttributeId) + { + case Attributes::MeterType::Id: { + using TypeInfo = Attributes::MeterType::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::UtilityName::Id: { + using TypeInfo = Attributes::UtilityName::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 + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value(), value)); + } + return value; + } + case Attributes::PointOfDelivery::Id: { + using TypeInfo = Attributes::PointOfDelivery::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 + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value(), value)); + } + return value; + } + case Attributes::PowerThreshold::Id: { + using TypeInfo = Attributes::PowerThreshold::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::PowerThresholdSource::Id: { + using TypeInfo = Attributes::PowerThresholdSource::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::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::UnitTesting::Id: { using namespace app::Clusters::UnitTesting; switch (aPath.mAttributeId) diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 4db00a7efd0f57..552d476fad368d 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -6056,6 +6056,16 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::EnergyCalendar::Id: { + using namespace app::Clusters::EnergyCalendar; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::EnergyPreference::Id: { using namespace app::Clusters::EnergyPreference; switch (aPath.mEventId) @@ -7930,6 +7940,16 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::MeterIdentification::Id: { + using namespace app::Clusters::MeterIdentification; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::UnitTesting::Id: { using namespace app::Clusters::UnitTesting; switch (aPath.mEventId) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 37ead8e634611a..5a039ae822a4c0 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -7170,6 +7170,122 @@ class ChipClusters: }, }, } + _ENERGY_CALENDAR_CLUSTER_INFO = { + "clusterName": "EnergyCalendar", + "clusterId": 0x0000009A, + "commands": { + }, + "attributes": { + 0x00000000: { + "attributeName": "CalendarID", + "attributeId": 0x00000000, + "type": "int", + "reportable": True, + }, + 0x00000001: { + "attributeName": "Name", + "attributeId": 0x00000001, + "type": "str", + "reportable": True, + }, + 0x00000002: { + "attributeName": "ProviderID", + "attributeId": 0x00000002, + "type": "int", + "reportable": True, + }, + 0x00000003: { + "attributeName": "EventID", + "attributeId": 0x00000003, + "type": "int", + "reportable": True, + }, + 0x00000004: { + "attributeName": "StartDate", + "attributeId": 0x00000004, + "type": "int", + "reportable": True, + }, + 0x00000005: { + "attributeName": "CalendarPeriods", + "attributeId": 0x00000005, + "type": "", + "reportable": True, + }, + 0x00000006: { + "attributeName": "SpecialDays", + "attributeId": 0x00000006, + "type": "", + "reportable": True, + }, + 0x00000007: { + "attributeName": "CurrentDay", + "attributeId": 0x00000007, + "type": "", + "reportable": True, + }, + 0x00000008: { + "attributeName": "NextDay", + "attributeId": 0x00000008, + "type": "", + "reportable": True, + }, + 0x00000009: { + "attributeName": "CurrentTransition", + "attributeId": 0x00000009, + "type": "", + "reportable": True, + }, + 0x0000000A: { + "attributeName": "CurrentPeakPeriod", + "attributeId": 0x0000000A, + "type": "", + "reportable": True, + }, + 0x0000000B: { + "attributeName": "NextPeakPeriod", + "attributeId": 0x0000000B, + "type": "", + "reportable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } _ENERGY_PREFERENCE_CLUSTER_INFO = { "clusterName": "EnergyPreference", "clusterId": 0x0000009B, @@ -13923,6 +14039,80 @@ class ChipClusters: }, }, } + _METER_IDENTIFICATION_CLUSTER_INFO = { + "clusterName": "MeterIdentification", + "clusterId": 0x00000B06, + "commands": { + }, + "attributes": { + 0x00000000: { + "attributeName": "MeterType", + "attributeId": 0x00000000, + "type": "int", + "reportable": True, + }, + 0x00000001: { + "attributeName": "UtilityName", + "attributeId": 0x00000001, + "type": "str", + "reportable": True, + }, + 0x00000002: { + "attributeName": "PointOfDelivery", + "attributeId": 0x00000002, + "type": "str", + "reportable": True, + }, + 0x00000003: { + "attributeName": "PowerThreshold", + "attributeId": 0x00000003, + "type": "int", + "reportable": True, + }, + 0x00000004: { + "attributeName": "PowerThresholdSource", + "attributeId": 0x00000004, + "type": "int", + "reportable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } _UNIT_TESTING_CLUSTER_INFO = { "clusterName": "UnitTesting", "clusterId": 0xFFF1FC05, @@ -14944,6 +15134,7 @@ class ChipClusters: 0x00000097: _MESSAGES_CLUSTER_INFO, 0x00000098: _DEVICE_ENERGY_MANAGEMENT_CLUSTER_INFO, 0x00000099: _ENERGY_EVSE_CLUSTER_INFO, + 0x0000009A: _ENERGY_CALENDAR_CLUSTER_INFO, 0x0000009B: _ENERGY_PREFERENCE_CLUSTER_INFO, 0x0000009C: _POWER_TOPOLOGY_CLUSTER_INFO, 0x0000009D: _ENERGY_EVSE_MODE_CLUSTER_INFO, @@ -14992,6 +15183,7 @@ class ChipClusters: 0x0000050F: _CONTENT_CONTROL_CLUSTER_INFO, 0x00000510: _CONTENT_APP_OBSERVER_CLUSTER_INFO, 0x00000B04: _ELECTRICAL_MEASUREMENT_CLUSTER_INFO, + 0x00000B06: _METER_IDENTIFICATION_CLUSTER_INFO, 0xFFF1FC05: _UNIT_TESTING_CLUSTER_INFO, 0xFFF1FC06: _FAULT_INJECTION_CLUSTER_INFO, 0xFFF1FC20: _SAMPLE_MEI_CLUSTER_INFO, @@ -15069,6 +15261,7 @@ class ChipClusters: "Messages": _MESSAGES_CLUSTER_INFO, "DeviceEnergyManagement": _DEVICE_ENERGY_MANAGEMENT_CLUSTER_INFO, "EnergyEvse": _ENERGY_EVSE_CLUSTER_INFO, + "EnergyCalendar": _ENERGY_CALENDAR_CLUSTER_INFO, "EnergyPreference": _ENERGY_PREFERENCE_CLUSTER_INFO, "PowerTopology": _POWER_TOPOLOGY_CLUSTER_INFO, "EnergyEvseMode": _ENERGY_EVSE_MODE_CLUSTER_INFO, @@ -15117,6 +15310,7 @@ class ChipClusters: "ContentControl": _CONTENT_CONTROL_CLUSTER_INFO, "ContentAppObserver": _CONTENT_APP_OBSERVER_CLUSTER_INFO, "ElectricalMeasurement": _ELECTRICAL_MEASUREMENT_CLUSTER_INFO, + "MeterIdentification": _METER_IDENTIFICATION_CLUSTER_INFO, "UnitTesting": _UNIT_TESTING_CLUSTER_INFO, "FaultInjection": _FAULT_INJECTION_CLUSTER_INFO, "SampleMei": _SAMPLE_MEI_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 4c17fd99af2d21..af816bb2effc16 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -25807,6 +25807,446 @@ def descriptor(cls) -> ClusterObjectDescriptor: uid: 'bytes' = b"" +@dataclass +class EnergyCalendar(Cluster): + id: typing.ClassVar[int] = 0x0000009A + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="calendarID", Tag=0x00000000, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="name", Tag=0x00000001, Type=typing.Union[Nullable, str]), + ClusterObjectFieldDescriptor(Label="providerID", Tag=0x00000002, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="eventID", Tag=0x00000003, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="startDate", Tag=0x00000004, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="calendarPeriods", Tag=0x00000005, Type=typing.Union[Nullable, typing.List[EnergyCalendar.Structs.CalendarPeriodStruct]]), + ClusterObjectFieldDescriptor(Label="specialDays", Tag=0x00000006, Type=typing.Union[Nullable, typing.List[EnergyCalendar.Structs.DayStruct]]), + ClusterObjectFieldDescriptor(Label="currentDay", Tag=0x00000007, Type=typing.Union[Nullable, EnergyCalendar.Structs.DayStruct]), + ClusterObjectFieldDescriptor(Label="nextDay", Tag=0x00000008, Type=typing.Union[Nullable, EnergyCalendar.Structs.DayStruct]), + ClusterObjectFieldDescriptor(Label="currentTransition", Tag=0x00000009, Type=typing.Union[Nullable, EnergyCalendar.Structs.TransitionStruct]), + ClusterObjectFieldDescriptor(Label="currentPeakPeriod", Tag=0x0000000A, Type=typing.Union[None, Nullable, EnergyCalendar.Structs.PeakPeriodStruct]), + ClusterObjectFieldDescriptor(Label="nextPeakPeriod", Tag=0x0000000B, Type=typing.Union[None, Nullable, EnergyCalendar.Structs.PeakPeriodStruct]), + 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), + ]) + + calendarID: 'typing.Union[Nullable, uint]' = None + name: 'typing.Union[Nullable, str]' = None + providerID: 'typing.Union[Nullable, uint]' = None + eventID: 'typing.Union[Nullable, uint]' = None + startDate: 'typing.Union[Nullable, uint]' = None + calendarPeriods: 'typing.Union[Nullable, typing.List[EnergyCalendar.Structs.CalendarPeriodStruct]]' = None + specialDays: 'typing.Union[Nullable, typing.List[EnergyCalendar.Structs.DayStruct]]' = None + currentDay: 'typing.Union[Nullable, EnergyCalendar.Structs.DayStruct]' = None + nextDay: 'typing.Union[Nullable, EnergyCalendar.Structs.DayStruct]' = None + currentTransition: 'typing.Union[Nullable, EnergyCalendar.Structs.TransitionStruct]' = None + currentPeakPeriod: 'typing.Union[None, Nullable, EnergyCalendar.Structs.PeakPeriodStruct]' = None + nextPeakPeriod: 'typing.Union[None, Nullable, EnergyCalendar.Structs.PeakPeriodStruct]' = 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 PeakPeriodSeverityEnum(MatterIntEnum): + kUnused = 0x00 + kLow = 0x01 + kMedium = 0x02 + kHigh = 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 AuxiliaryLoadBitmap(IntFlag): + kAuxiliarySwitch1 = 0x1 + kAuxiliarySwitch2 = 0x2 + kAuxiliarySwitch3 = 0x4 + kAuxiliarySwitch4 = 0x8 + kAuxiliarySwitch5 = 0x10 + kAuxiliarySwitch6 = 0x20 + kAuxiliarySwitch7 = 0x40 + kAuxiliarySwitch8 = 0x80 + + class Feature(IntFlag): + kPricingTier = 0x1 + kFriendlyCredit = 0x2 + kAuxiliaryLoad = 0x4 + kPeakPeriod = 0x8 + + class TransitionDayOfWeekBitmap(IntFlag): + kSunday = 0x1 + kMonday = 0x2 + kTuesday = 0x4 + kWednesday = 0x8 + kThursday = 0x10 + kFriday = 0x20 + kSaturday = 0x40 + + class Structs: + @dataclass + class TransitionStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="transitionTime", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="priceTier", Tag=1, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="friendlyCredit", Tag=2, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="auxiliaryLoad", Tag=3, Type=typing.Optional[uint]), + ]) + + transitionTime: 'uint' = 0 + priceTier: 'typing.Optional[uint]' = None + friendlyCredit: 'typing.Optional[bool]' = None + auxiliaryLoad: 'typing.Optional[uint]' = None + + @dataclass + class DayStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="date", Tag=0, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="daysOfWeek", Tag=1, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="transitions", Tag=2, Type=typing.List[EnergyCalendar.Structs.TransitionStruct]), + ClusterObjectFieldDescriptor(Label="calendarID", Tag=3, Type=typing.Optional[uint]), + ]) + + date: 'typing.Optional[uint]' = None + daysOfWeek: 'typing.Optional[uint]' = None + transitions: 'typing.List[EnergyCalendar.Structs.TransitionStruct]' = field(default_factory=lambda: []) + calendarID: 'typing.Optional[uint]' = None + + @dataclass + class CalendarPeriodStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="startDate", Tag=0, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="days", Tag=1, Type=typing.List[EnergyCalendar.Structs.DayStruct]), + ]) + + startDate: 'typing.Union[Nullable, uint]' = NullValue + days: 'typing.List[EnergyCalendar.Structs.DayStruct]' = field(default_factory=lambda: []) + + @dataclass + class PeakPeriodStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="severity", Tag=0, Type=EnergyCalendar.Enums.PeakPeriodSeverityEnum), + ClusterObjectFieldDescriptor(Label="peakPeriod", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="startTime", Tag=2, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="endTime", Tag=3, Type=typing.Union[Nullable, uint]), + ]) + + severity: 'EnergyCalendar.Enums.PeakPeriodSeverityEnum' = 0 + peakPeriod: 'uint' = 0 + startTime: 'typing.Union[Nullable, uint]' = NullValue + endTime: 'typing.Union[Nullable, uint]' = NullValue + + class Attributes: + @dataclass + class CalendarID(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000009A + + @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 Name(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000009A + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, str]) + + value: 'typing.Union[Nullable, str]' = NullValue + + @dataclass + class ProviderID(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000009A + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, uint]) + + value: 'typing.Union[Nullable, uint]' = NullValue + + @dataclass + class EventID(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000009A + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, uint]) + + value: 'typing.Union[Nullable, uint]' = NullValue + + @dataclass + class StartDate(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000009A + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000004 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, uint]) + + value: 'typing.Union[Nullable, uint]' = NullValue + + @dataclass + class CalendarPeriods(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000009A + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000005 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, typing.List[EnergyCalendar.Structs.CalendarPeriodStruct]]) + + value: 'typing.Union[Nullable, typing.List[EnergyCalendar.Structs.CalendarPeriodStruct]]' = NullValue + + @dataclass + class SpecialDays(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000009A + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000006 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, typing.List[EnergyCalendar.Structs.DayStruct]]) + + value: 'typing.Union[Nullable, typing.List[EnergyCalendar.Structs.DayStruct]]' = NullValue + + @dataclass + class CurrentDay(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000009A + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000007 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, EnergyCalendar.Structs.DayStruct]) + + value: 'typing.Union[Nullable, EnergyCalendar.Structs.DayStruct]' = NullValue + + @dataclass + class NextDay(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000009A + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000008 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, EnergyCalendar.Structs.DayStruct]) + + value: 'typing.Union[Nullable, EnergyCalendar.Structs.DayStruct]' = NullValue + + @dataclass + class CurrentTransition(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000009A + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000009 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, EnergyCalendar.Structs.TransitionStruct]) + + value: 'typing.Union[Nullable, EnergyCalendar.Structs.TransitionStruct]' = NullValue + + @dataclass + class CurrentPeakPeriod(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000009A + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000000A + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, EnergyCalendar.Structs.PeakPeriodStruct]) + + value: 'typing.Union[None, Nullable, EnergyCalendar.Structs.PeakPeriodStruct]' = None + + @dataclass + class NextPeakPeriod(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000009A + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000000B + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, EnergyCalendar.Structs.PeakPeriodStruct]) + + value: 'typing.Union[None, Nullable, EnergyCalendar.Structs.PeakPeriodStruct]' = None + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000009A + + @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 0x0000009A + + @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 0x0000009A + + @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 0x0000009A + + @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 0x0000009A + + @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 0x0000009A + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass class EnergyPreference(Cluster): id: typing.ClassVar[int] = 0x0000009B @@ -48498,6 +48938,242 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = 0 +@dataclass +class MeterIdentification(Cluster): + id: typing.ClassVar[int] = 0x00000B06 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="meterType", Tag=0x00000000, Type=typing.Union[Nullable, MeterIdentification.Enums.MeterTypeEnum]), + ClusterObjectFieldDescriptor(Label="utilityName", Tag=0x00000001, Type=typing.Union[Nullable, str]), + ClusterObjectFieldDescriptor(Label="pointOfDelivery", Tag=0x00000002, Type=typing.Union[Nullable, str]), + ClusterObjectFieldDescriptor(Label="powerThreshold", Tag=0x00000003, Type=typing.Union[None, Nullable, int]), + ClusterObjectFieldDescriptor(Label="powerThresholdSource", Tag=0x00000004, Type=typing.Union[None, Nullable, MeterIdentification.Enums.PowerThresholdSourceEnum]), + 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), + ]) + + meterType: 'typing.Union[Nullable, MeterIdentification.Enums.MeterTypeEnum]' = None + utilityName: 'typing.Union[Nullable, str]' = None + pointOfDelivery: 'typing.Union[Nullable, str]' = None + powerThreshold: 'typing.Union[None, Nullable, int]' = None + powerThresholdSource: 'typing.Union[None, Nullable, MeterIdentification.Enums.PowerThresholdSourceEnum]' = 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 MeterTypeEnum(MatterIntEnum): + kUtility = 0x00 + kPrivate = 0x01 + kGeneric = 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 PowerThresholdSourceEnum(MatterIntEnum): + kContract = 0x00 + kRegulator = 0x01 + kEquipment = 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 Feature(IntFlag): + kPowerThreshold = 0x1 + + class Attributes: + @dataclass + class MeterType(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000B06 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, MeterIdentification.Enums.MeterTypeEnum]) + + value: 'typing.Union[Nullable, MeterIdentification.Enums.MeterTypeEnum]' = NullValue + + @dataclass + class UtilityName(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000B06 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, str]) + + value: 'typing.Union[Nullable, str]' = NullValue + + @dataclass + class PointOfDelivery(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000B06 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, str]) + + value: 'typing.Union[Nullable, str]' = NullValue + + @dataclass + class PowerThreshold(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000B06 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, int]) + + value: 'typing.Union[None, Nullable, int]' = None + + @dataclass + class PowerThresholdSource(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000B06 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000004 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, MeterIdentification.Enums.PowerThresholdSourceEnum]) + + value: 'typing.Union[None, Nullable, MeterIdentification.Enums.PowerThresholdSourceEnum]' = None + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000B06 + + @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 0x00000B06 + + @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 0x00000B06 + + @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 0x00000B06 + + @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 0x00000B06 + + @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 0x00000B06 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass class UnitTesting(Cluster): id: typing.ClassVar[int] = 0xFFF1FC05 diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index 4200cb1dccd108..9d49ac3ea51a5e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -3284,6 +3284,69 @@ static BOOL AttributeIsSpecifiedInEnergyEVSECluster(AttributeId aAttributeId) } } } +static BOOL AttributeIsSpecifiedInEnergyCalendarCluster(AttributeId aAttributeId) +{ + using namespace Clusters::EnergyCalendar; + switch (aAttributeId) { + case Attributes::CalendarID::Id: { + return YES; + } + case Attributes::Name::Id: { + return YES; + } + case Attributes::ProviderID::Id: { + return YES; + } + case Attributes::EventID::Id: { + return YES; + } + case Attributes::StartDate::Id: { + return YES; + } + case Attributes::CalendarPeriods::Id: { + return YES; + } + case Attributes::SpecialDays::Id: { + return YES; + } + case Attributes::CurrentDay::Id: { + return YES; + } + case Attributes::NextDay::Id: { + return YES; + } + case Attributes::CurrentTransition::Id: { + return YES; + } + case Attributes::CurrentPeakPeriod::Id: { + return YES; + } + case Attributes::NextPeakPeriod::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 AttributeIsSpecifiedInEnergyPreferenceCluster(AttributeId aAttributeId) { using namespace Clusters::EnergyPreference; @@ -6356,6 +6419,48 @@ static BOOL AttributeIsSpecifiedInElectricalMeasurementCluster(AttributeId aAttr } } } +static BOOL AttributeIsSpecifiedInMeterIdentificationCluster(AttributeId aAttributeId) +{ + using namespace Clusters::MeterIdentification; + switch (aAttributeId) { + case Attributes::MeterType::Id: { + return YES; + } + case Attributes::UtilityName::Id: { + return YES; + } + case Attributes::PointOfDelivery::Id: { + return YES; + } + case Attributes::PowerThreshold::Id: { + return YES; + } + case Attributes::PowerThresholdSource::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 AttributeIsSpecifiedInUnitTestingCluster(AttributeId aAttributeId) { using namespace Clusters::UnitTesting; @@ -6870,6 +6975,9 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::EnergyEvse::Id: { return AttributeIsSpecifiedInEnergyEVSECluster(aAttributeId); } + case Clusters::EnergyCalendar::Id: { + return AttributeIsSpecifiedInEnergyCalendarCluster(aAttributeId); + } case Clusters::EnergyPreference::Id: { return AttributeIsSpecifiedInEnergyPreferenceCluster(aAttributeId); } @@ -7014,6 +7122,9 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::ElectricalMeasurement::Id: { return AttributeIsSpecifiedInElectricalMeasurementCluster(aAttributeId); } + case Clusters::MeterIdentification::Id: { + return AttributeIsSpecifiedInMeterIdentificationCluster(aAttributeId); + } case Clusters::UnitTesting::Id: { return AttributeIsSpecifiedInUnitTestingCluster(aAttributeId); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 1feae62ea18928..3a4e29fbeb38f3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -9435,6 +9435,482 @@ static id _Nullable DecodeAttributeValueForEnergyEVSECluster(AttributeId aAttrib *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } +static id _Nullable DecodeAttributeValueForEnergyCalendarCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::EnergyCalendar; + switch (aAttributeId) { + case Attributes::CalendarID::Id: { + using TypeInfo = Attributes::CalendarID::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::Name::Id: { + using TypeInfo = Attributes::Name::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = AsString(cppValue.Value()); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } + return value; + } + case Attributes::ProviderID::Id: { + using TypeInfo = Attributes::ProviderID::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::EventID::Id: { + using TypeInfo = Attributes::EventID::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::StartDate::Id: { + using TypeInfo = Attributes::StartDate::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::CalendarPeriods::Id: { + using TypeInfo = Attributes::CalendarPeriods::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = cppValue.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + MTREnergyCalendarClusterCalendarPeriodStruct * newElement_1; + newElement_1 = [MTREnergyCalendarClusterCalendarPeriodStruct new]; + if (entry_1.startDate.IsNull()) { + newElement_1.startDate = nil; + } else { + newElement_1.startDate = [NSNumber numberWithUnsignedInt:entry_1.startDate.Value()]; + } + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + auto iter_3 = entry_1.days.begin(); + while (iter_3.Next()) { + auto & entry_3 = iter_3.GetValue(); + MTREnergyCalendarClusterDayStruct * newElement_3; + newElement_3 = [MTREnergyCalendarClusterDayStruct new]; + if (entry_3.date.HasValue()) { + newElement_3.date = [NSNumber numberWithUnsignedInt:entry_3.date.Value()]; + } else { + newElement_3.date = nil; + } + if (entry_3.daysOfWeek.HasValue()) { + newElement_3.daysOfWeek = [NSNumber numberWithUnsignedChar:entry_3.daysOfWeek.Value().Raw()]; + } else { + newElement_3.daysOfWeek = nil; + } + { // Scope for our temporary variables + auto * array_5 = [NSMutableArray new]; + auto iter_5 = entry_3.transitions.begin(); + while (iter_5.Next()) { + auto & entry_5 = iter_5.GetValue(); + MTREnergyCalendarClusterTransitionStruct * newElement_5; + newElement_5 = [MTREnergyCalendarClusterTransitionStruct new]; + newElement_5.transitionTime = [NSNumber numberWithUnsignedShort:entry_5.transitionTime]; + if (entry_5.priceTier.HasValue()) { + newElement_5.priceTier = [NSNumber numberWithUnsignedInt:entry_5.priceTier.Value()]; + } else { + newElement_5.priceTier = nil; + } + if (entry_5.friendlyCredit.HasValue()) { + newElement_5.friendlyCredit = [NSNumber numberWithBool:entry_5.friendlyCredit.Value()]; + } else { + newElement_5.friendlyCredit = nil; + } + if (entry_5.auxiliaryLoad.HasValue()) { + newElement_5.auxiliaryLoad = [NSNumber numberWithUnsignedChar:entry_5.auxiliaryLoad.Value().Raw()]; + } else { + newElement_5.auxiliaryLoad = nil; + } + [array_5 addObject:newElement_5]; + } + CHIP_ERROR err = iter_5.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_3.transitions = array_5; + } + if (entry_3.calendarID.HasValue()) { + newElement_3.calendarID = [NSNumber numberWithUnsignedInt:entry_3.calendarID.Value()]; + } else { + newElement_3.calendarID = nil; + } + [array_3 addObject:newElement_3]; + } + CHIP_ERROR err = iter_3.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_1.days = array_3; + } + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_1; + } + } + return value; + } + case Attributes::SpecialDays::Id: { + using TypeInfo = Attributes::SpecialDays::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = cppValue.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + MTREnergyCalendarClusterDayStruct * newElement_1; + newElement_1 = [MTREnergyCalendarClusterDayStruct new]; + if (entry_1.date.HasValue()) { + newElement_1.date = [NSNumber numberWithUnsignedInt:entry_1.date.Value()]; + } else { + newElement_1.date = nil; + } + if (entry_1.daysOfWeek.HasValue()) { + newElement_1.daysOfWeek = [NSNumber numberWithUnsignedChar:entry_1.daysOfWeek.Value().Raw()]; + } else { + newElement_1.daysOfWeek = nil; + } + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + auto iter_3 = entry_1.transitions.begin(); + while (iter_3.Next()) { + auto & entry_3 = iter_3.GetValue(); + MTREnergyCalendarClusterTransitionStruct * newElement_3; + newElement_3 = [MTREnergyCalendarClusterTransitionStruct new]; + newElement_3.transitionTime = [NSNumber numberWithUnsignedShort:entry_3.transitionTime]; + if (entry_3.priceTier.HasValue()) { + newElement_3.priceTier = [NSNumber numberWithUnsignedInt:entry_3.priceTier.Value()]; + } else { + newElement_3.priceTier = nil; + } + if (entry_3.friendlyCredit.HasValue()) { + newElement_3.friendlyCredit = [NSNumber numberWithBool:entry_3.friendlyCredit.Value()]; + } else { + newElement_3.friendlyCredit = nil; + } + if (entry_3.auxiliaryLoad.HasValue()) { + newElement_3.auxiliaryLoad = [NSNumber numberWithUnsignedChar:entry_3.auxiliaryLoad.Value().Raw()]; + } else { + newElement_3.auxiliaryLoad = nil; + } + [array_3 addObject:newElement_3]; + } + CHIP_ERROR err = iter_3.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_1.transitions = array_3; + } + if (entry_1.calendarID.HasValue()) { + newElement_1.calendarID = [NSNumber numberWithUnsignedInt:entry_1.calendarID.Value()]; + } else { + newElement_1.calendarID = nil; + } + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_1; + } + } + return value; + } + case Attributes::CurrentDay::Id: { + using TypeInfo = Attributes::CurrentDay::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTREnergyCalendarClusterDayStruct * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTREnergyCalendarClusterDayStruct new]; + if (cppValue.Value().date.HasValue()) { + value.date = [NSNumber numberWithUnsignedInt:cppValue.Value().date.Value()]; + } else { + value.date = nil; + } + if (cppValue.Value().daysOfWeek.HasValue()) { + value.daysOfWeek = [NSNumber numberWithUnsignedChar:cppValue.Value().daysOfWeek.Value().Raw()]; + } else { + value.daysOfWeek = nil; + } + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = cppValue.Value().transitions.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + MTREnergyCalendarClusterTransitionStruct * newElement_2; + newElement_2 = [MTREnergyCalendarClusterTransitionStruct new]; + newElement_2.transitionTime = [NSNumber numberWithUnsignedShort:entry_2.transitionTime]; + if (entry_2.priceTier.HasValue()) { + newElement_2.priceTier = [NSNumber numberWithUnsignedInt:entry_2.priceTier.Value()]; + } else { + newElement_2.priceTier = nil; + } + if (entry_2.friendlyCredit.HasValue()) { + newElement_2.friendlyCredit = [NSNumber numberWithBool:entry_2.friendlyCredit.Value()]; + } else { + newElement_2.friendlyCredit = nil; + } + if (entry_2.auxiliaryLoad.HasValue()) { + newElement_2.auxiliaryLoad = [NSNumber numberWithUnsignedChar:entry_2.auxiliaryLoad.Value().Raw()]; + } else { + newElement_2.auxiliaryLoad = nil; + } + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value.transitions = array_2; + } + if (cppValue.Value().calendarID.HasValue()) { + value.calendarID = [NSNumber numberWithUnsignedInt:cppValue.Value().calendarID.Value()]; + } else { + value.calendarID = nil; + } + } + return value; + } + case Attributes::NextDay::Id: { + using TypeInfo = Attributes::NextDay::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTREnergyCalendarClusterDayStruct * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTREnergyCalendarClusterDayStruct new]; + if (cppValue.Value().date.HasValue()) { + value.date = [NSNumber numberWithUnsignedInt:cppValue.Value().date.Value()]; + } else { + value.date = nil; + } + if (cppValue.Value().daysOfWeek.HasValue()) { + value.daysOfWeek = [NSNumber numberWithUnsignedChar:cppValue.Value().daysOfWeek.Value().Raw()]; + } else { + value.daysOfWeek = nil; + } + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = cppValue.Value().transitions.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + MTREnergyCalendarClusterTransitionStruct * newElement_2; + newElement_2 = [MTREnergyCalendarClusterTransitionStruct new]; + newElement_2.transitionTime = [NSNumber numberWithUnsignedShort:entry_2.transitionTime]; + if (entry_2.priceTier.HasValue()) { + newElement_2.priceTier = [NSNumber numberWithUnsignedInt:entry_2.priceTier.Value()]; + } else { + newElement_2.priceTier = nil; + } + if (entry_2.friendlyCredit.HasValue()) { + newElement_2.friendlyCredit = [NSNumber numberWithBool:entry_2.friendlyCredit.Value()]; + } else { + newElement_2.friendlyCredit = nil; + } + if (entry_2.auxiliaryLoad.HasValue()) { + newElement_2.auxiliaryLoad = [NSNumber numberWithUnsignedChar:entry_2.auxiliaryLoad.Value().Raw()]; + } else { + newElement_2.auxiliaryLoad = nil; + } + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value.transitions = array_2; + } + if (cppValue.Value().calendarID.HasValue()) { + value.calendarID = [NSNumber numberWithUnsignedInt:cppValue.Value().calendarID.Value()]; + } else { + value.calendarID = nil; + } + } + return value; + } + case Attributes::CurrentTransition::Id: { + using TypeInfo = Attributes::CurrentTransition::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTREnergyCalendarClusterTransitionStruct * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTREnergyCalendarClusterTransitionStruct new]; + value.transitionTime = [NSNumber numberWithUnsignedShort:cppValue.Value().transitionTime]; + if (cppValue.Value().priceTier.HasValue()) { + value.priceTier = [NSNumber numberWithUnsignedInt:cppValue.Value().priceTier.Value()]; + } else { + value.priceTier = nil; + } + if (cppValue.Value().friendlyCredit.HasValue()) { + value.friendlyCredit = [NSNumber numberWithBool:cppValue.Value().friendlyCredit.Value()]; + } else { + value.friendlyCredit = nil; + } + if (cppValue.Value().auxiliaryLoad.HasValue()) { + value.auxiliaryLoad = [NSNumber numberWithUnsignedChar:cppValue.Value().auxiliaryLoad.Value().Raw()]; + } else { + value.auxiliaryLoad = nil; + } + } + return value; + } + case Attributes::CurrentPeakPeriod::Id: { + using TypeInfo = Attributes::CurrentPeakPeriod::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTREnergyCalendarClusterPeakPeriodStruct * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTREnergyCalendarClusterPeakPeriodStruct new]; + value.severity = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value().severity)]; + value.peakPeriod = [NSNumber numberWithUnsignedShort:cppValue.Value().peakPeriod]; + if (cppValue.Value().startTime.IsNull()) { + value.startTime = nil; + } else { + value.startTime = [NSNumber numberWithUnsignedInt:cppValue.Value().startTime.Value()]; + } + if (cppValue.Value().endTime.IsNull()) { + value.endTime = nil; + } else { + value.endTime = [NSNumber numberWithUnsignedInt:cppValue.Value().endTime.Value()]; + } + } + return value; + } + case Attributes::NextPeakPeriod::Id: { + using TypeInfo = Attributes::NextPeakPeriod::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTREnergyCalendarClusterPeakPeriodStruct * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTREnergyCalendarClusterPeakPeriodStruct new]; + value.severity = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value().severity)]; + value.peakPeriod = [NSNumber numberWithUnsignedShort:cppValue.Value().peakPeriod]; + if (cppValue.Value().startTime.IsNull()) { + value.startTime = nil; + } else { + value.startTime = [NSNumber numberWithUnsignedInt:cppValue.Value().startTime.Value()]; + } + if (cppValue.Value().endTime.IsNull()) { + value.endTime = nil; + } else { + value.endTime = [NSNumber numberWithUnsignedInt:cppValue.Value().endTime.Value()]; + } + } + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} static id _Nullable DecodeAttributeValueForEnergyPreferenceCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::EnergyPreference; @@ -18259,6 +18735,103 @@ static id _Nullable DecodeAttributeValueForElectricalMeasurementCluster(Attribut *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } +static id _Nullable DecodeAttributeValueForMeterIdentificationCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::MeterIdentification; + switch (aAttributeId) { + case Attributes::MeterType::Id: { + using TypeInfo = Attributes::MeterType::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::UtilityName::Id: { + using TypeInfo = Attributes::UtilityName::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = AsString(cppValue.Value()); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } + return value; + } + case Attributes::PointOfDelivery::Id: { + using TypeInfo = Attributes::PointOfDelivery::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = AsString(cppValue.Value()); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } + return value; + } + case Attributes::PowerThreshold::Id: { + using TypeInfo = Attributes::PowerThreshold::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 numberWithLongLong:cppValue.Value()]; + } + return value; + } + case Attributes::PowerThresholdSource::Id: { + using TypeInfo = Attributes::PowerThresholdSource::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; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::UnitTesting; @@ -19916,6 +20489,9 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::EnergyEvse::Id: { return DecodeAttributeValueForEnergyEVSECluster(aPath.mAttributeId, aReader, aError); } + case Clusters::EnergyCalendar::Id: { + return DecodeAttributeValueForEnergyCalendarCluster(aPath.mAttributeId, aReader, aError); + } case Clusters::EnergyPreference::Id: { return DecodeAttributeValueForEnergyPreferenceCluster(aPath.mAttributeId, aReader, aError); } @@ -20060,6 +20636,9 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::ElectricalMeasurement::Id: { return DecodeAttributeValueForElectricalMeasurementCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::MeterIdentification::Id: { + return DecodeAttributeValueForMeterIdentificationCluster(aPath.mAttributeId, aReader, aError); + } case Clusters::UnitTesting::Id: { return DecodeAttributeValueForUnitTestingCluster(aPath.mAttributeId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 1513b8c0f54540..282e0869ffc617 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -8154,6 +8154,139 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster Energy Calendar + * + * + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRBaseClusterEnergyCalendar : MTRGenericBaseCluster + +- (void)readAttributeCalendarIDWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeCalendarIDWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeCalendarIDWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeNameWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeNameWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeNameWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeProviderIDWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeProviderIDWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeProviderIDWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeEventIDWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeEventIDWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeEventIDWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeStartDateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeStartDateWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeStartDateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeCalendarPeriodsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeCalendarPeriodsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeCalendarPeriodsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSpecialDaysWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSpecialDaysWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSpecialDaysWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeCurrentDayWithCompletion:(void (^)(MTREnergyCalendarClusterDayStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeCurrentDayWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTREnergyCalendarClusterDayStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeCurrentDayWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTREnergyCalendarClusterDayStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeNextDayWithCompletion:(void (^)(MTREnergyCalendarClusterDayStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeNextDayWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTREnergyCalendarClusterDayStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeNextDayWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTREnergyCalendarClusterDayStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeCurrentTransitionWithCompletion:(void (^)(MTREnergyCalendarClusterTransitionStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeCurrentTransitionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTREnergyCalendarClusterTransitionStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeCurrentTransitionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTREnergyCalendarClusterTransitionStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeCurrentPeakPeriodWithCompletion:(void (^)(MTREnergyCalendarClusterPeakPeriodStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeCurrentPeakPeriodWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTREnergyCalendarClusterPeakPeriodStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeCurrentPeakPeriodWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTREnergyCalendarClusterPeakPeriodStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeNextPeakPeriodWithCompletion:(void (^)(MTREnergyCalendarClusterPeakPeriodStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeNextPeakPeriodWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTREnergyCalendarClusterPeakPeriodStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeNextPeakPeriodWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTREnergyCalendarClusterPeakPeriodStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRBaseClusterEnergyCalendar (Availability) + +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster Energy Preference * @@ -15713,6 +15846,97 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @end +/** + * Cluster Meter Identification + * + * + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRBaseClusterMeterIdentification : MTRGenericBaseCluster + +- (void)readAttributeMeterTypeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMeterTypeWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMeterTypeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeUtilityNameWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeUtilityNameWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeUtilityNameWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributePointOfDeliveryWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributePointOfDeliveryWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributePointOfDeliveryWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributePowerThresholdWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributePowerThresholdWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributePowerThresholdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributePowerThresholdSourceWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributePowerThresholdSourceWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributePowerThresholdSourceWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRBaseClusterMeterIdentification (Availability) + +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster Unit Testing * @@ -18459,6 +18683,41 @@ typedef NS_OPTIONS(uint8_t, MTREnergyEVSETargetDayOfWeekBitmap) { MTREnergyEVSETargetDayOfWeekBitmapSaturday MTR_PROVISIONALLY_AVAILABLE = 0x40, } MTR_PROVISIONALLY_AVAILABLE; +typedef NS_ENUM(uint8_t, MTREnergyCalendarPeakPeriodSeverity) { + MTREnergyCalendarPeakPeriodSeverityUnused MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTREnergyCalendarPeakPeriodSeverityLow MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTREnergyCalendarPeakPeriodSeverityMedium MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTREnergyCalendarPeakPeriodSeverityHigh MTR_PROVISIONALLY_AVAILABLE = 0x03, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_OPTIONS(uint8_t, MTREnergyCalendarAuxiliaryLoadBitmap) { + MTREnergyCalendarAuxiliaryLoadBitmapAuxiliarySwitch1 MTR_PROVISIONALLY_AVAILABLE = 0x1, + MTREnergyCalendarAuxiliaryLoadBitmapAuxiliarySwitch2 MTR_PROVISIONALLY_AVAILABLE = 0x2, + MTREnergyCalendarAuxiliaryLoadBitmapAuxiliarySwitch3 MTR_PROVISIONALLY_AVAILABLE = 0x4, + MTREnergyCalendarAuxiliaryLoadBitmapAuxiliarySwitch4 MTR_PROVISIONALLY_AVAILABLE = 0x8, + MTREnergyCalendarAuxiliaryLoadBitmapAuxiliarySwitch5 MTR_PROVISIONALLY_AVAILABLE = 0x10, + MTREnergyCalendarAuxiliaryLoadBitmapAuxiliarySwitch6 MTR_PROVISIONALLY_AVAILABLE = 0x20, + MTREnergyCalendarAuxiliaryLoadBitmapAuxiliarySwitch7 MTR_PROVISIONALLY_AVAILABLE = 0x40, + MTREnergyCalendarAuxiliaryLoadBitmapAuxiliarySwitch8 MTR_PROVISIONALLY_AVAILABLE = 0x80, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_OPTIONS(uint32_t, MTREnergyCalendarFeature) { + MTREnergyCalendarFeaturePricingTier MTR_PROVISIONALLY_AVAILABLE = 0x1, + MTREnergyCalendarFeatureFriendlyCredit MTR_PROVISIONALLY_AVAILABLE = 0x2, + MTREnergyCalendarFeatureAuxiliaryLoad MTR_PROVISIONALLY_AVAILABLE = 0x4, + MTREnergyCalendarFeaturePeakPeriod MTR_PROVISIONALLY_AVAILABLE = 0x8, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_OPTIONS(uint8_t, MTREnergyCalendarTransitionDayOfWeekBitmap) { + MTREnergyCalendarTransitionDayOfWeekBitmapSunday MTR_PROVISIONALLY_AVAILABLE = 0x1, + MTREnergyCalendarTransitionDayOfWeekBitmapMonday MTR_PROVISIONALLY_AVAILABLE = 0x2, + MTREnergyCalendarTransitionDayOfWeekBitmapTuesday MTR_PROVISIONALLY_AVAILABLE = 0x4, + MTREnergyCalendarTransitionDayOfWeekBitmapWednesday MTR_PROVISIONALLY_AVAILABLE = 0x8, + MTREnergyCalendarTransitionDayOfWeekBitmapThursday MTR_PROVISIONALLY_AVAILABLE = 0x10, + MTREnergyCalendarTransitionDayOfWeekBitmapFriday MTR_PROVISIONALLY_AVAILABLE = 0x20, + MTREnergyCalendarTransitionDayOfWeekBitmapSaturday MTR_PROVISIONALLY_AVAILABLE = 0x40, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTREnergyPreferenceEnergyPriority) { MTREnergyPreferenceEnergyPriorityComfort MTR_PROVISIONALLY_AVAILABLE = 0x00, MTREnergyPreferenceEnergyPrioritySpeed MTR_PROVISIONALLY_AVAILABLE = 0x01, @@ -20548,6 +20807,22 @@ typedef NS_ENUM(uint8_t, MTRContentAppObserverStatus) { MTRContentAppObserverStatusUnexpectedData MTR_PROVISIONALLY_AVAILABLE = 0x01, } MTR_PROVISIONALLY_AVAILABLE; +typedef NS_ENUM(uint8_t, MTRMeterIdentificationMeterType) { + MTRMeterIdentificationMeterTypeUtility MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRMeterIdentificationMeterTypePrivate MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRMeterIdentificationMeterTypeGeneric MTR_PROVISIONALLY_AVAILABLE = 0x02, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRMeterIdentificationPowerThresholdSource) { + MTRMeterIdentificationPowerThresholdSourceContract MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRMeterIdentificationPowerThresholdSourceRegulator MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRMeterIdentificationPowerThresholdSourceEquipment MTR_PROVISIONALLY_AVAILABLE = 0x02, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_OPTIONS(uint32_t, MTRMeterIdentificationFeature) { + MTRMeterIdentificationFeaturePowerThreshold MTR_PROVISIONALLY_AVAILABLE = 0x1, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRUnitTestingSimple) { MTRUnitTestingSimpleUnspecified MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00, MTRUnitTestingSimpleValueA MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x01, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 694f35228a4701..8f6ca6b7d0d7ba 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -54171,6 +54171,658 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end +@implementation MTRBaseClusterEnergyCalendar + +- (void)readAttributeCalendarIDWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::CalendarID::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeCalendarIDWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyCalendar::Attributes::CalendarID::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeCalendarIDWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::CalendarID::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeNameWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::Name::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeNameWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyCalendar::Attributes::Name::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeNameWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::Name::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeProviderIDWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::ProviderID::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeProviderIDWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyCalendar::Attributes::ProviderID::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeProviderIDWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::ProviderID::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeEventIDWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::EventID::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeEventIDWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyCalendar::Attributes::EventID::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeEventIDWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::EventID::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeStartDateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::StartDate::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeStartDateWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyCalendar::Attributes::StartDate::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeStartDateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::StartDate::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeCalendarPeriodsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::CalendarPeriods::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeCalendarPeriodsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyCalendar::Attributes::CalendarPeriods::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeCalendarPeriodsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::CalendarPeriods::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSpecialDaysWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::SpecialDays::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeSpecialDaysWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyCalendar::Attributes::SpecialDays::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSpecialDaysWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::SpecialDays::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeCurrentDayWithCompletion:(void (^)(MTREnergyCalendarClusterDayStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::CurrentDay::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeCurrentDayWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTREnergyCalendarClusterDayStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyCalendar::Attributes::CurrentDay::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeCurrentDayWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTREnergyCalendarClusterDayStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::CurrentDay::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeNextDayWithCompletion:(void (^)(MTREnergyCalendarClusterDayStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::NextDay::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeNextDayWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTREnergyCalendarClusterDayStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyCalendar::Attributes::NextDay::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeNextDayWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTREnergyCalendarClusterDayStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::NextDay::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeCurrentTransitionWithCompletion:(void (^)(MTREnergyCalendarClusterTransitionStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::CurrentTransition::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeCurrentTransitionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTREnergyCalendarClusterTransitionStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyCalendar::Attributes::CurrentTransition::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeCurrentTransitionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTREnergyCalendarClusterTransitionStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::CurrentTransition::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeCurrentPeakPeriodWithCompletion:(void (^)(MTREnergyCalendarClusterPeakPeriodStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::CurrentPeakPeriod::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeCurrentPeakPeriodWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTREnergyCalendarClusterPeakPeriodStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyCalendar::Attributes::CurrentPeakPeriod::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeCurrentPeakPeriodWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTREnergyCalendarClusterPeakPeriodStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::CurrentPeakPeriod::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeNextPeakPeriodWithCompletion:(void (^)(MTREnergyCalendarClusterPeakPeriodStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::NextPeakPeriod::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeNextPeakPeriodWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTREnergyCalendarClusterPeakPeriodStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyCalendar::Attributes::NextPeakPeriod::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeNextPeakPeriodWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTREnergyCalendarClusterPeakPeriodStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyCalendar::Attributes::NextPeakPeriod::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 = EnergyCalendar::Attributes::GeneratedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + 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 = EnergyCalendar::Attributes::GeneratedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + 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 = EnergyCalendar::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 = EnergyCalendar::Attributes::AcceptedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + 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 = EnergyCalendar::Attributes::AcceptedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + 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 = EnergyCalendar::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 = EnergyCalendar::Attributes::EventList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + 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 = EnergyCalendar::Attributes::EventList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + 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 = EnergyCalendar::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 = EnergyCalendar::Attributes::AttributeList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + 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 = EnergyCalendar::Attributes::AttributeList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + 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 = EnergyCalendar::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 = EnergyCalendar::Attributes::FeatureMap::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + 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 = EnergyCalendar::Attributes::FeatureMap::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + 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 = EnergyCalendar::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 = EnergyCalendar::Attributes::ClusterRevision::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + 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 = EnergyCalendar::Attributes::ClusterRevision::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + 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 = EnergyCalendar::Attributes::ClusterRevision::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +@end + @implementation MTRBaseClusterEnergyPreference - (void)readAttributeEnergyBalancesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -113928,6 +114580,406 @@ - (nullable instancetype)initWithDevice:(MTRBaseDevice *)device @end +@implementation MTRBaseClusterMeterIdentification + +- (void)readAttributeMeterTypeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::MeterType::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMeterTypeWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MeterIdentification::Attributes::MeterType::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMeterTypeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::MeterType::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeUtilityNameWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::UtilityName::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeUtilityNameWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MeterIdentification::Attributes::UtilityName::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeUtilityNameWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::UtilityName::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributePointOfDeliveryWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::PointOfDelivery::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributePointOfDeliveryWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MeterIdentification::Attributes::PointOfDelivery::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributePointOfDeliveryWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::PointOfDelivery::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributePowerThresholdWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::PowerThreshold::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributePowerThresholdWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MeterIdentification::Attributes::PowerThreshold::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributePowerThresholdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::PowerThreshold::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributePowerThresholdSourceWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::PowerThresholdSource::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributePowerThresholdSourceWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MeterIdentification::Attributes::PowerThresholdSource::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributePowerThresholdSourceWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MeterIdentification::Attributes::PowerThresholdSource::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 = MeterIdentification::Attributes::GeneratedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + 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 = MeterIdentification::Attributes::GeneratedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + 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 = MeterIdentification::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 = MeterIdentification::Attributes::AcceptedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + 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 = MeterIdentification::Attributes::AcceptedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + 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 = MeterIdentification::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 = MeterIdentification::Attributes::EventList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + 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 = MeterIdentification::Attributes::EventList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + 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 = MeterIdentification::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 = MeterIdentification::Attributes::AttributeList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + 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 = MeterIdentification::Attributes::AttributeList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + 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 = MeterIdentification::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 = MeterIdentification::Attributes::FeatureMap::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + 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 = MeterIdentification::Attributes::FeatureMap::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + 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 = MeterIdentification::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 = MeterIdentification::Attributes::ClusterRevision::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + 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 = MeterIdentification::Attributes::ClusterRevision::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + 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 = MeterIdentification::Attributes::ClusterRevision::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +@end + @implementation MTRBaseClusterUnitTesting - (void)testWithCompletion:(MTRStatusCompletion)completion diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index b6c6dc2aba2dc2..e10f56fea9d045 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -155,6 +155,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeMessagesID MTR_PROVISIONALLY_AVAILABLE = 0x00000097, MTRClusterIDTypeDeviceEnergyManagementID MTR_PROVISIONALLY_AVAILABLE = 0x00000098, MTRClusterIDTypeEnergyEVSEID MTR_PROVISIONALLY_AVAILABLE = 0x00000099, + MTRClusterIDTypeEnergyCalendarID MTR_PROVISIONALLY_AVAILABLE = 0x0000009A, MTRClusterIDTypeEnergyPreferenceID MTR_PROVISIONALLY_AVAILABLE = 0x0000009B, MTRClusterIDTypePowerTopologyID MTR_PROVISIONALLY_AVAILABLE = 0x0000009C, MTRClusterIDTypeEnergyEVSEModeID MTR_PROVISIONALLY_AVAILABLE = 0x0000009D, @@ -203,6 +204,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeContentControlID MTR_PROVISIONALLY_AVAILABLE = 0x0000050F, MTRClusterIDTypeContentAppObserverID MTR_PROVISIONALLY_AVAILABLE = 0x00000510, MTRClusterIDTypeElectricalMeasurementID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000B04, + MTRClusterIDTypeMeterIdentificationID MTR_PROVISIONALLY_AVAILABLE = 0x00000B06, MTRClusterIDTypeUnitTestingID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0xFFF1FC05, MTRClusterIDTypeSampleMEIID MTR_PROVISIONALLY_AVAILABLE = 0xFFF1FC20, }; @@ -2697,6 +2699,26 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterEnergyEVSEAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, MTRAttributeIDTypeClusterEnergyEVSEAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster EnergyCalendar attributes + MTRAttributeIDTypeClusterEnergyCalendarAttributeCalendarIDID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterEnergyCalendarAttributeNameID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterEnergyCalendarAttributeProviderIDID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterEnergyCalendarAttributeEventIDID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRAttributeIDTypeClusterEnergyCalendarAttributeStartDateID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + MTRAttributeIDTypeClusterEnergyCalendarAttributeCalendarPeriodsID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, + MTRAttributeIDTypeClusterEnergyCalendarAttributeSpecialDaysID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, + MTRAttributeIDTypeClusterEnergyCalendarAttributeCurrentDayID MTR_PROVISIONALLY_AVAILABLE = 0x00000007, + MTRAttributeIDTypeClusterEnergyCalendarAttributeNextDayID MTR_PROVISIONALLY_AVAILABLE = 0x00000008, + MTRAttributeIDTypeClusterEnergyCalendarAttributeCurrentTransitionID MTR_PROVISIONALLY_AVAILABLE = 0x00000009, + MTRAttributeIDTypeClusterEnergyCalendarAttributeCurrentPeakPeriodID MTR_PROVISIONALLY_AVAILABLE = 0x0000000A, + MTRAttributeIDTypeClusterEnergyCalendarAttributeNextPeakPeriodID MTR_PROVISIONALLY_AVAILABLE = 0x0000000B, + MTRAttributeIDTypeClusterEnergyCalendarAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterEnergyCalendarAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterEnergyCalendarAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, + MTRAttributeIDTypeClusterEnergyCalendarAttributeAttributeListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterEnergyCalendarAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterEnergyCalendarAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster EnergyPreference attributes MTRAttributeIDTypeClusterEnergyPreferenceAttributeEnergyBalancesID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRAttributeIDTypeClusterEnergyPreferenceAttributeCurrentEnergyBalanceID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, @@ -5394,6 +5416,19 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterElectricalMeasurementAttributeFeatureMapID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeFeatureMapID, MTRAttributeIDTypeClusterElectricalMeasurementAttributeClusterRevisionID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster MeterIdentification attributes + MTRAttributeIDTypeClusterMeterIdentificationAttributeMeterTypeID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterMeterIdentificationAttributeUtilityNameID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterMeterIdentificationAttributePointOfDeliveryID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterMeterIdentificationAttributePowerThresholdID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRAttributeIDTypeClusterMeterIdentificationAttributePowerThresholdSourceID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + MTRAttributeIDTypeClusterMeterIdentificationAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterMeterIdentificationAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterMeterIdentificationAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, + MTRAttributeIDTypeClusterMeterIdentificationAttributeAttributeListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterMeterIdentificationAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterMeterIdentificationAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster TestCluster deprecated attribute names MTRClusterTestClusterAttributeBooleanID MTR_DEPRECATED("Please use MTRAttributeIDTypeClusterUnitTestingAttributeBooleanID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index c320e8c06e8dea..9c8589c25cca0b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -231,6 +231,9 @@ case MTRClusterIDTypeEnergyEVSEID: result = @"EnergyEVSE"; break; + case MTRClusterIDTypeEnergyCalendarID: + result = @"EnergyCalendar"; + break; case MTRClusterIDTypeEnergyPreferenceID: result = @"EnergyPreference"; break; @@ -375,6 +378,9 @@ case MTRClusterIDTypeElectricalMeasurementID: result = @"ElectricalMeasurement"; break; + case MTRClusterIDTypeMeterIdentificationID: + result = @"MeterIdentification"; + break; case MTRClusterIDTypeUnitTestingID: result = @"UnitTesting"; break; @@ -4610,6 +4616,88 @@ break; } + case MTRClusterIDTypeEnergyCalendarID: + + switch (attributeID) { + + // Cluster EnergyCalendar attributes + case MTRAttributeIDTypeClusterEnergyCalendarAttributeCalendarIDID: + result = @"CalendarID"; + break; + + case MTRAttributeIDTypeClusterEnergyCalendarAttributeNameID: + result = @"Name"; + break; + + case MTRAttributeIDTypeClusterEnergyCalendarAttributeProviderIDID: + result = @"ProviderID"; + break; + + case MTRAttributeIDTypeClusterEnergyCalendarAttributeEventIDID: + result = @"EventID"; + break; + + case MTRAttributeIDTypeClusterEnergyCalendarAttributeStartDateID: + result = @"StartDate"; + break; + + case MTRAttributeIDTypeClusterEnergyCalendarAttributeCalendarPeriodsID: + result = @"CalendarPeriods"; + break; + + case MTRAttributeIDTypeClusterEnergyCalendarAttributeSpecialDaysID: + result = @"SpecialDays"; + break; + + case MTRAttributeIDTypeClusterEnergyCalendarAttributeCurrentDayID: + result = @"CurrentDay"; + break; + + case MTRAttributeIDTypeClusterEnergyCalendarAttributeNextDayID: + result = @"NextDay"; + break; + + case MTRAttributeIDTypeClusterEnergyCalendarAttributeCurrentTransitionID: + result = @"CurrentTransition"; + break; + + case MTRAttributeIDTypeClusterEnergyCalendarAttributeCurrentPeakPeriodID: + result = @"CurrentPeakPeriod"; + break; + + case MTRAttributeIDTypeClusterEnergyCalendarAttributeNextPeakPeriodID: + result = @"NextPeakPeriod"; + break; + + case MTRAttributeIDTypeClusterEnergyCalendarAttributeGeneratedCommandListID: + result = @"GeneratedCommandList"; + break; + + case MTRAttributeIDTypeClusterEnergyCalendarAttributeAcceptedCommandListID: + result = @"AcceptedCommandList"; + break; + + case MTRAttributeIDTypeClusterEnergyCalendarAttributeEventListID: + result = @"EventList"; + break; + + case MTRAttributeIDTypeClusterEnergyCalendarAttributeAttributeListID: + result = @"AttributeList"; + break; + + case MTRAttributeIDTypeClusterEnergyCalendarAttributeFeatureMapID: + result = @"FeatureMap"; + break; + + case MTRAttributeIDTypeClusterEnergyCalendarAttributeClusterRevisionID: + result = @"ClusterRevision"; + break; + + default: + result = [NSString stringWithFormat:@"", attributeID]; + break; + } + case MTRClusterIDTypeEnergyPreferenceID: switch (attributeID) { @@ -8610,6 +8698,60 @@ break; } + case MTRClusterIDTypeMeterIdentificationID: + + switch (attributeID) { + + // Cluster MeterIdentification attributes + case MTRAttributeIDTypeClusterMeterIdentificationAttributeMeterTypeID: + result = @"MeterType"; + break; + + case MTRAttributeIDTypeClusterMeterIdentificationAttributeUtilityNameID: + result = @"UtilityName"; + break; + + case MTRAttributeIDTypeClusterMeterIdentificationAttributePointOfDeliveryID: + result = @"PointOfDelivery"; + break; + + case MTRAttributeIDTypeClusterMeterIdentificationAttributePowerThresholdID: + result = @"PowerThreshold"; + break; + + case MTRAttributeIDTypeClusterMeterIdentificationAttributePowerThresholdSourceID: + result = @"PowerThresholdSource"; + break; + + case MTRAttributeIDTypeClusterMeterIdentificationAttributeGeneratedCommandListID: + result = @"GeneratedCommandList"; + break; + + case MTRAttributeIDTypeClusterMeterIdentificationAttributeAcceptedCommandListID: + result = @"AcceptedCommandList"; + break; + + case MTRAttributeIDTypeClusterMeterIdentificationAttributeEventListID: + result = @"EventList"; + break; + + case MTRAttributeIDTypeClusterMeterIdentificationAttributeAttributeListID: + result = @"AttributeList"; + break; + + case MTRAttributeIDTypeClusterMeterIdentificationAttributeFeatureMapID: + result = @"FeatureMap"; + break; + + case MTRAttributeIDTypeClusterMeterIdentificationAttributeClusterRevisionID: + result = @"ClusterRevision"; + break; + + default: + result = [NSString stringWithFormat:@"", attributeID]; + break; + } + case MTRClusterIDTypeUnitTestingID: switch (attributeID) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index c47d2bf28caa4c..67e2a618d7852b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -3828,6 +3828,66 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster Energy Calendar + * + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRClusterEnergyCalendar : MTRGenericCluster + +- (NSDictionary * _Nullable)readAttributeCalendarIDWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeNameWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeProviderIDWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeEventIDWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeStartDateWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeCalendarPeriodsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSpecialDaysWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeCurrentDayWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeNextDayWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeCurrentTransitionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeCurrentPeakPeriodWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeNextPeakPeriodWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRClusterEnergyCalendar (Availability) + +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster Energy Preference * This cluster provides an interface to specify preferences for how devices should consume energy. @@ -7202,6 +7262,52 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @end +/** + * Cluster Meter Identification + * + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRClusterMeterIdentification : MTRGenericCluster + +- (NSDictionary * _Nullable)readAttributeMeterTypeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeUtilityNameWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributePointOfDeliveryWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributePowerThresholdWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributePowerThresholdSourceWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRClusterMeterIdentification (Availability) + +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster Unit Testing * The Test Cluster is meant to validate the generated code diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index f04fd07262ea1f..e11701d366b347 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -10328,6 +10328,100 @@ - (void)writeAttributeApproximateEVEfficiencyWithValue:(NSDictionary * _Nullable)readAttributeCalendarIDWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyCalendarID) attributeID:@(MTRAttributeIDTypeClusterEnergyCalendarAttributeCalendarIDID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeNameWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyCalendarID) attributeID:@(MTRAttributeIDTypeClusterEnergyCalendarAttributeNameID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeProviderIDWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyCalendarID) attributeID:@(MTRAttributeIDTypeClusterEnergyCalendarAttributeProviderIDID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeEventIDWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyCalendarID) attributeID:@(MTRAttributeIDTypeClusterEnergyCalendarAttributeEventIDID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeStartDateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyCalendarID) attributeID:@(MTRAttributeIDTypeClusterEnergyCalendarAttributeStartDateID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeCalendarPeriodsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyCalendarID) attributeID:@(MTRAttributeIDTypeClusterEnergyCalendarAttributeCalendarPeriodsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeSpecialDaysWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyCalendarID) attributeID:@(MTRAttributeIDTypeClusterEnergyCalendarAttributeSpecialDaysID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeCurrentDayWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyCalendarID) attributeID:@(MTRAttributeIDTypeClusterEnergyCalendarAttributeCurrentDayID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeNextDayWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyCalendarID) attributeID:@(MTRAttributeIDTypeClusterEnergyCalendarAttributeNextDayID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeCurrentTransitionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyCalendarID) attributeID:@(MTRAttributeIDTypeClusterEnergyCalendarAttributeCurrentTransitionID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeCurrentPeakPeriodWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyCalendarID) attributeID:@(MTRAttributeIDTypeClusterEnergyCalendarAttributeCurrentPeakPeriodID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeNextPeakPeriodWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyCalendarID) attributeID:@(MTRAttributeIDTypeClusterEnergyCalendarAttributeNextPeakPeriodID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyCalendarID) attributeID:@(MTRAttributeIDTypeClusterEnergyCalendarAttributeGeneratedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyCalendarID) attributeID:@(MTRAttributeIDTypeClusterEnergyCalendarAttributeAcceptedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyCalendarID) attributeID:@(MTRAttributeIDTypeClusterEnergyCalendarAttributeEventListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyCalendarID) attributeID:@(MTRAttributeIDTypeClusterEnergyCalendarAttributeAttributeListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyCalendarID) attributeID:@(MTRAttributeIDTypeClusterEnergyCalendarAttributeFeatureMapID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyCalendarID) attributeID:@(MTRAttributeIDTypeClusterEnergyCalendarAttributeClusterRevisionID) params:params]; +} + +@end + @implementation MTRClusterEnergyPreference - (NSDictionary * _Nullable)readAttributeEnergyBalancesWithParams:(MTRReadParams * _Nullable)params @@ -20606,6 +20700,65 @@ - (void)getMeasurementProfileCommandWithParams:(MTRElectricalMeasurementClusterG } @end +@implementation MTRClusterMeterIdentification + +- (NSDictionary * _Nullable)readAttributeMeterTypeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeMeterIdentificationID) attributeID:@(MTRAttributeIDTypeClusterMeterIdentificationAttributeMeterTypeID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeUtilityNameWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeMeterIdentificationID) attributeID:@(MTRAttributeIDTypeClusterMeterIdentificationAttributeUtilityNameID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributePointOfDeliveryWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeMeterIdentificationID) attributeID:@(MTRAttributeIDTypeClusterMeterIdentificationAttributePointOfDeliveryID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributePowerThresholdWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeMeterIdentificationID) attributeID:@(MTRAttributeIDTypeClusterMeterIdentificationAttributePowerThresholdID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributePowerThresholdSourceWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeMeterIdentificationID) attributeID:@(MTRAttributeIDTypeClusterMeterIdentificationAttributePowerThresholdSourceID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeMeterIdentificationID) attributeID:@(MTRAttributeIDTypeClusterMeterIdentificationAttributeGeneratedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeMeterIdentificationID) attributeID:@(MTRAttributeIDTypeClusterMeterIdentificationAttributeAcceptedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeMeterIdentificationID) attributeID:@(MTRAttributeIDTypeClusterMeterIdentificationAttributeEventListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeMeterIdentificationID) attributeID:@(MTRAttributeIDTypeClusterMeterIdentificationAttributeAttributeListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeMeterIdentificationID) attributeID:@(MTRAttributeIDTypeClusterMeterIdentificationAttributeFeatureMapID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeMeterIdentificationID) attributeID:@(MTRAttributeIDTypeClusterMeterIdentificationAttributeClusterRevisionID) params:params]; +} + +@end + @implementation MTRClusterUnitTesting - (void)testWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)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 1b96c8c41201d5..9920c3d74dddd2 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm @@ -665,6 +665,15 @@ static BOOL CommandNeedsTimedInvokeInEnergyEVSECluster(AttributeId aAttributeId) } } } +static BOOL CommandNeedsTimedInvokeInEnergyCalendarCluster(AttributeId aAttributeId) +{ + using namespace Clusters::EnergyCalendar; + switch (aAttributeId) { + default: { + return NO; + } + } +} static BOOL CommandNeedsTimedInvokeInEnergyPreferenceCluster(AttributeId aAttributeId) { using namespace Clusters::EnergyPreference; @@ -1145,6 +1154,15 @@ static BOOL CommandNeedsTimedInvokeInElectricalMeasurementCluster(AttributeId aA } } } +static BOOL CommandNeedsTimedInvokeInMeterIdentificationCluster(AttributeId aAttributeId) +{ + using namespace Clusters::MeterIdentification; + switch (aAttributeId) { + default: { + return NO; + } + } +} static BOOL CommandNeedsTimedInvokeInUnitTestingCluster(AttributeId aAttributeId) { using namespace Clusters::UnitTesting; @@ -1377,6 +1395,9 @@ BOOL MTRCommandNeedsTimedInvoke(NSNumber * _Nonnull aClusterID, NSNumber * _Nonn case Clusters::EnergyEvse::Id: { return CommandNeedsTimedInvokeInEnergyEVSECluster(commandID); } + case Clusters::EnergyCalendar::Id: { + return CommandNeedsTimedInvokeInEnergyCalendarCluster(commandID); + } case Clusters::EnergyPreference::Id: { return CommandNeedsTimedInvokeInEnergyPreferenceCluster(commandID); } @@ -1521,6 +1542,9 @@ BOOL MTRCommandNeedsTimedInvoke(NSNumber * _Nonnull aClusterID, NSNumber * _Nonn case Clusters::ElectricalMeasurement::Id: { return CommandNeedsTimedInvokeInElectricalMeasurementCluster(commandID); } + case Clusters::MeterIdentification::Id: { + return CommandNeedsTimedInvokeInMeterIdentificationCluster(commandID); + } case Clusters::UnitTesting::Id: { return CommandNeedsTimedInvokeInUnitTestingCluster(commandID); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 8de4f7c5966b50..92122ea9daeedb 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -3240,6 +3240,18 @@ static id _Nullable DecodeEventPayloadForEnergyEVSECluster(EventId aEventId, TLV *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } +static id _Nullable DecodeEventPayloadForEnergyCalendarCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::EnergyCalendar; + switch (aEventId) { + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} static id _Nullable DecodeEventPayloadForEnergyPreferenceCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::EnergyPreference; @@ -4428,6 +4440,18 @@ static id _Nullable DecodeEventPayloadForElectricalMeasurementCluster(EventId aE *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } +static id _Nullable DecodeEventPayloadForMeterIdentificationCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::MeterIdentification; + switch (aEventId) { + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} static id _Nullable DecodeEventPayloadForUnitTestingCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::UnitTesting; @@ -4814,6 +4838,9 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::EnergyEvse::Id: { return DecodeEventPayloadForEnergyEVSECluster(aPath.mEventId, aReader, aError); } + case Clusters::EnergyCalendar::Id: { + return DecodeEventPayloadForEnergyCalendarCluster(aPath.mEventId, aReader, aError); + } case Clusters::EnergyPreference::Id: { return DecodeEventPayloadForEnergyPreferenceCluster(aPath.mEventId, aReader, aError); } @@ -4958,6 +4985,9 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::ElectricalMeasurement::Id: { return DecodeEventPayloadForElectricalMeasurementCluster(aPath.mEventId, aReader, aError); } + case Clusters::MeterIdentification::Id: { + return DecodeEventPayloadForMeterIdentificationCluster(aPath.mEventId, aReader, aError); + } case Clusters::UnitTesting::Id: { return DecodeEventPayloadForUnitTestingCluster(aPath.mEventId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 8ea03ce1fd2a9d..bb0644ad0d3c99 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -1426,6 +1426,36 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSData * _Nonnull uid MTR_PROVISIONALLY_AVAILABLE; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTREnergyCalendarClusterTransitionStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull transitionTime MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable priceTier MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable friendlyCredit MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable auxiliaryLoad MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTREnergyCalendarClusterDayStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nullable date MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable daysOfWeek MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nonnull transitions MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable calendarID MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTREnergyCalendarClusterCalendarPeriodStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nullable startDate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nonnull days MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTREnergyCalendarClusterPeakPeriodStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull severity MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull peakPeriod MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable startTime MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable endTime MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTREnergyPreferenceClusterBalanceStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull step MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 1ff604e5469e36..b5d1b9a327f768 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -5888,6 +5888,144 @@ - (NSString *)description @end +@implementation MTREnergyCalendarClusterTransitionStruct +- (instancetype)init +{ + if (self = [super init]) { + + _transitionTime = @(0); + + _priceTier = nil; + + _friendlyCredit = nil; + + _auxiliaryLoad = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTREnergyCalendarClusterTransitionStruct alloc] init]; + + other.transitionTime = self.transitionTime; + other.priceTier = self.priceTier; + other.friendlyCredit = self.friendlyCredit; + other.auxiliaryLoad = self.auxiliaryLoad; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: transitionTime:%@; priceTier:%@; friendlyCredit:%@; auxiliaryLoad:%@; >", NSStringFromClass([self class]), _transitionTime, _priceTier, _friendlyCredit, _auxiliaryLoad]; + return descriptionString; +} + +@end + +@implementation MTREnergyCalendarClusterDayStruct +- (instancetype)init +{ + if (self = [super init]) { + + _date = nil; + + _daysOfWeek = nil; + + _transitions = [NSArray array]; + + _calendarID = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTREnergyCalendarClusterDayStruct alloc] init]; + + other.date = self.date; + other.daysOfWeek = self.daysOfWeek; + other.transitions = self.transitions; + other.calendarID = self.calendarID; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: date:%@; daysOfWeek:%@; transitions:%@; calendarID:%@; >", NSStringFromClass([self class]), _date, _daysOfWeek, _transitions, _calendarID]; + return descriptionString; +} + +@end + +@implementation MTREnergyCalendarClusterCalendarPeriodStruct +- (instancetype)init +{ + if (self = [super init]) { + + _startDate = nil; + + _days = [NSArray array]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTREnergyCalendarClusterCalendarPeriodStruct alloc] init]; + + other.startDate = self.startDate; + other.days = self.days; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: startDate:%@; days:%@; >", NSStringFromClass([self class]), _startDate, _days]; + return descriptionString; +} + +@end + +@implementation MTREnergyCalendarClusterPeakPeriodStruct +- (instancetype)init +{ + if (self = [super init]) { + + _severity = @(0); + + _peakPeriod = @(0); + + _startTime = nil; + + _endTime = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTREnergyCalendarClusterPeakPeriodStruct alloc] init]; + + other.severity = self.severity; + other.peakPeriod = self.peakPeriod; + other.startTime = self.startTime; + other.endTime = self.endTime; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: severity:%@; peakPeriod:%@; startTime:%@; endTime:%@; >", NSStringFromClass([self class]), _severity, _peakPeriod, _startTime, _endTime]; + return descriptionString; +} + +@end + @implementation MTREnergyPreferenceClusterBalanceStruct - (instancetype)init { 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 c16c4d688e2744..67f3ed79fc6375 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 @@ -15537,6 +15537,543 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu } // namespace Attributes } // namespace EnergyEvse +namespace EnergyCalendar { +namespace Attributes { + +namespace CalendarID { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (Traits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty) +{ + if (value.IsNull()) + { + return SetNull(endpoint, markDirty); + } + + return Set(endpoint, value.Value(), markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace CalendarID + +namespace Name { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + if (value.IsNull()) + { + ChipLogError(Zcl, "Null Nullable passed to EnergyCalendar::Name::Get"); + return Protocols::InteractionModel::Status::Failure; + } + + uint8_t zclString[12 + 1]; + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + value.SetNull(); + return Protocols::InteractionModel::Status::Success; + } + auto & span = value.Value(); + + VerifyOrReturnError(span.size() == 12, Protocols::InteractionModel::Status::InvalidDataType); + memcpy(span.data(), &zclString[1], 12); + span.reduce_size(length); + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty) +{ + + static_assert(12 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 12, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[12 + 1]; + auto length = static_cast(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + + static_assert(12 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 12, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[12 + 1]; + auto length = static_cast(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty) +{ + uint8_t zclString[1] = { 0xFF }; + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint) +{ + uint8_t zclString[1] = { 0xFF }; + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty) +{ + if (value.IsNull()) + { + return SetNull(endpoint, markDirty); + } + + return Set(endpoint, value.Value(), markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace Name + +namespace ProviderID { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (Traits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty) +{ + if (value.IsNull()) + { + return SetNull(endpoint, markDirty); + } + + return Set(endpoint, value.Value(), markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace ProviderID + +namespace EventID { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (Traits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty) +{ + if (value.IsNull()) + { + return SetNull(endpoint, markDirty); + } + + return Set(endpoint, value.Value(), markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace EventID + +namespace StartDate { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (Traits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty) +{ + if (value.IsNull()) + { + return SetNull(endpoint, markDirty); + } + + return Set(endpoint, value.Value(), markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace StartDate + +namespace FeatureMap { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::EnergyCalendar::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace EnergyCalendar + namespace EnergyPreference { namespace Attributes { @@ -35610,49 +36147,289 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpa namespace LinkLocalAddress { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::MutableByteSpan & value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::MutableByteSpan & value) +{ + uint8_t zclString[16 + 1]; + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::WakeOnLan::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + + VerifyOrReturnError(value.size() == 16, Protocols::InteractionModel::Status::InvalidDataType); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(length); + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::ByteSpan value, MarkAttributeDirty markDirty) +{ + + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[16 + 1]; + auto length = static_cast(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::WakeOnLan::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[16 + 1]; + auto length = static_cast(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::WakeOnLan::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace LinkLocalAddress + +namespace FeatureMap { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::WakeOnLan::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WakeOnLan::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WakeOnLan::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::WakeOnLan::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WakeOnLan::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WakeOnLan::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace WakeOnLan + +namespace Channel { +namespace Attributes { + +namespace FeatureMap { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Channel::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::Channel::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::Channel::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Channel::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::Channel::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::Channel::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace Channel + +namespace TargetNavigator { +namespace Attributes { + +namespace CurrentTarget { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value) { - uint8_t zclString[16 + 1]; + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::WakeOnLan::Id, Id, zclString, sizeof(zclString)); + emberAfReadAttribute(endpoint, Clusters::TargetNavigator::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return Protocols::InteractionModel::Status::ConstraintError; } - - VerifyOrReturnError(value.size() == 16, Protocols::InteractionModel::Status::InvalidDataType); - memcpy(value.data(), &zclString[1], 16); - value.reduce_size(length); + *value = Traits::StorageToWorking(temp); return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::ByteSpan value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) { - - static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[16 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::WakeOnLan::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE, markDirty); + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::TargetNavigator::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::ByteSpan value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value) { - - static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[16 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::WakeOnLan::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::TargetNavigator::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -} // namespace LinkLocalAddress +} // namespace CurrentTarget namespace FeatureMap { @@ -35662,7 +36439,7 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * va Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::WakeOnLan::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::TargetNavigator::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -35682,7 +36459,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::WakeOnLan::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::TargetNavigator::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) @@ -35695,7 +36472,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::WakeOnLan::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::TargetNavigator::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace FeatureMap @@ -35708,7 +36485,7 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::WakeOnLan::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::TargetNavigator::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -35728,7 +36505,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::WakeOnLan::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::TargetNavigator::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) @@ -35741,25 +36518,26 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::WakeOnLan::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::TargetNavigator::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace WakeOnLan +} // namespace TargetNavigator -namespace Channel { +namespace MediaPlayback { namespace Attributes { -namespace FeatureMap { +namespace CurrentState { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::app::Clusters::MediaPlayback::PlaybackStateEnum * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Channel::Id, Id, readable, sizeof(temp)); + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -35769,9 +36547,10 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::MediaPlayback::PlaybackStateEnum value, + MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -35779,12 +36558,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Channel::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::MediaPlayback::PlaybackStateEnum value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -35792,71 +36571,196 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Channel::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } -} // namespace FeatureMap +} // namespace CurrentState -namespace ClusterRevision { +namespace StartTime { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Channel::Id, Id, readable, sizeof(temp)); + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint64_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return Protocols::InteractionModel::Status::ConstraintError; } - *value = Traits::StorageToWorking(temp); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_EPOCH_US_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint64_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_EPOCH_US_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_EPOCH_US_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_EPOCH_US_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty) +{ + if (value.IsNull()) + { + return SetNull(endpoint, markDirty); + } + + return Set(endpoint, value.Value(), markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace StartTime + +namespace Duration { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (Traits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint64_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return Protocols::InteractionModel::Status::ConstraintError; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Channel::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint64_t value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return Protocols::InteractionModel::Status::ConstraintError; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Channel::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } -} // namespace ClusterRevision +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty) +{ + if (value.IsNull()) + { + return SetNull(endpoint, markDirty); + } + + return Set(endpoint, value.Value(), markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } -} // namespace Attributes -} // namespace Channel + return Set(endpoint, value.Value()); +} -namespace TargetNavigator { -namespace Attributes { +} // namespace Duration -namespace CurrentTarget { +namespace PlaybackSpeed { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, float * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::TargetNavigator::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -35866,9 +36770,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, float value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -35876,12 +36780,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::TargetNavigator::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, float value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -35889,114 +36793,192 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::TargetNavigator::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } -} // namespace CurrentTarget +} // namespace PlaybackSpeed -namespace FeatureMap { +namespace SeekRangeEnd { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::TargetNavigator::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return Protocols::InteractionModel::Status::ConstraintError; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint64_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return Protocols::InteractionModel::Status::ConstraintError; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::TargetNavigator::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint64_t value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return Protocols::InteractionModel::Status::ConstraintError; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::TargetNavigator::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } -} // namespace FeatureMap +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE, markDirty); +} -namespace ClusterRevision { +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); +} -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + if (value.IsNull()) + { + return SetNull(endpoint, markDirty); + } + + return Set(endpoint, value.Value(), markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace SeekRangeEnd + +namespace SeekRangeStart { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::TargetNavigator::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return Protocols::InteractionModel::Status::ConstraintError; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint64_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return Protocols::InteractionModel::Status::ConstraintError; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::TargetNavigator::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint64_t value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return Protocols::InteractionModel::Status::ConstraintError; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::TargetNavigator::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } -} // namespace ClusterRevision +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE, markDirty); +} -} // namespace Attributes -} // namespace TargetNavigator +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); +} -namespace MediaPlayback { -namespace Attributes { +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty) +{ + if (value.IsNull()) + { + return SetNull(endpoint, markDirty); + } -namespace CurrentState { + return Set(endpoint, value.Value(), markDirty); +} -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::app::Clusters::MediaPlayback::PlaybackStateEnum * value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { - using Traits = NumericAttributeTraits; + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace SeekRangeStart + +namespace FeatureMap { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -36010,10 +36992,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::app::Cl return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::MediaPlayback::PlaybackStateEnum value, - MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -36021,12 +37002,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Cl Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::MediaPlayback::PlaybackStateEnum value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -36034,196 +37015,215 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Cl Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } -} // namespace CurrentState +} // namespace FeatureMap -namespace StartTime { +namespace ClusterRevision { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (Traits::IsNullValue(temp)) - { - value.SetNull(); - } - else + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { - value.SetNonNull() = Traits::StorageToWorking(temp); + return Protocols::InteractionModel::Status::ConstraintError; } + *value = Traits::StorageToWorking(temp); return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint64_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_EPOCH_US_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint64_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_EPOCH_US_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_EPOCH_US_ATTRIBUTE_TYPE, markDirty); -} +} // namespace ClusterRevision -Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_EPOCH_US_ATTRIBUTE_TYPE); -} +} // namespace Attributes +} // namespace MediaPlayback + +namespace MediaInput { +namespace Attributes { + +namespace CurrentInput { -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, - MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value) { - if (value.IsNull()) + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::MediaInput::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { - return SetNull(endpoint, markDirty); + return Protocols::InteractionModel::Status::ConstraintError; } - - return Set(endpoint, value.Value(), markDirty); + *value = Traits::StorageToWorking(temp); + return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) { - if (value.IsNull()) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { - return SetNull(endpoint); + return Protocols::InteractionModel::Status::ConstraintError; } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::MediaInput::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE, markDirty); +} - return Set(endpoint, value.Value()); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::MediaInput::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -} // namespace StartTime +} // namespace CurrentInput -namespace Duration { +namespace FeatureMap { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::MediaInput::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (Traits::IsNullValue(temp)) - { - value.SetNull(); - } - else + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { - value.SetNonNull() = Traits::StorageToWorking(temp); + return Protocols::InteractionModel::Status::ConstraintError; } + *value = Traits::StorageToWorking(temp); return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint64_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::MediaInput::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint64_t value) +Protocols::InteractionModel::Status 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 Protocols::InteractionModel::Status::ConstraintError; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::MediaInput::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } -Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE, markDirty); -} +} // namespace FeatureMap -Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint) +namespace ClusterRevision { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::MediaInput::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, - MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - if (value.IsNull()) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { - return SetNull(endpoint, markDirty); + return Protocols::InteractionModel::Status::ConstraintError; } - - return Set(endpoint, value.Value(), markDirty); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::MediaInput::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - if (value.IsNull()) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { - return SetNull(endpoint); + return Protocols::InteractionModel::Status::ConstraintError; } - - return Set(endpoint, value.Value()); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::MediaInput::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace Duration +} // namespace ClusterRevision -namespace PlaybackSpeed { +} // namespace Attributes +} // namespace MediaInput -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, float * value) +namespace LowPower { +namespace Attributes { + +namespace FeatureMap { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LowPower::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -36233,9 +37233,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, float * value return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, float value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -36243,12 +37243,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, float value, Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::LowPower::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, float value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -36256,186 +37256,209 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, float value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::LowPower::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } -} // namespace PlaybackSpeed +} // namespace FeatureMap -namespace SeekRangeEnd { +namespace ClusterRevision { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LowPower::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (Traits::IsNullValue(temp)) - { - value.SetNull(); - } - else + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { - value.SetNonNull() = Traits::StorageToWorking(temp); + return Protocols::InteractionModel::Status::ConstraintError; } + *value = Traits::StorageToWorking(temp); return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint64_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::LowPower::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint64_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::LowPower::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE, markDirty); -} +} // namespace ClusterRevision -Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint) +} // namespace Attributes +} // namespace LowPower + +namespace KeypadInput { +namespace Attributes { + +namespace FeatureMap { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) { - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::KeypadInput::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, - MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) { - if (value.IsNull()) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { - return SetNull(endpoint, markDirty); + return Protocols::InteractionModel::Status::ConstraintError; } - - return Set(endpoint, value.Value(), markDirty); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::KeypadInput::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) { - if (value.IsNull()) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { - return SetNull(endpoint); + return Protocols::InteractionModel::Status::ConstraintError; } - - return Set(endpoint, value.Value()); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::KeypadInput::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } -} // namespace SeekRangeEnd +} // namespace FeatureMap -namespace SeekRangeStart { +namespace ClusterRevision { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::KeypadInput::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (Traits::IsNullValue(temp)) - { - value.SetNull(); - } - else + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { - value.SetNonNull() = Traits::StorageToWorking(temp); + return Protocols::InteractionModel::Status::ConstraintError; } + *value = Traits::StorageToWorking(temp); return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint64_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::KeypadInput::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint64_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::KeypadInput::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE, markDirty); -} +} // namespace ClusterRevision -Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint) +} // namespace Attributes +} // namespace KeypadInput + +namespace ContentLauncher { +namespace Attributes { + +namespace SupportedStreamingProtocols { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, + chip::BitMask * value) { - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::ContentLauncher::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask value, MarkAttributeDirty markDirty) { - if (value.IsNull()) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { - return SetNull(endpoint, markDirty); + return Protocols::InteractionModel::Status::ConstraintError; } - - return Set(endpoint, value.Value(), markDirty); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::ContentLauncher::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask value) { - if (value.IsNull()) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { - return SetNull(endpoint); + return Protocols::InteractionModel::Status::ConstraintError; } - - return Set(endpoint, value.Value()); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::ContentLauncher::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } -} // namespace SeekRangeStart +} // namespace SupportedStreamingProtocols namespace FeatureMap { @@ -36445,7 +37468,7 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * va Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ContentLauncher::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -36465,7 +37488,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ContentLauncher::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) @@ -36478,7 +37501,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ContentLauncher::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace FeatureMap @@ -36491,7 +37514,7 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ContentLauncher::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -36511,7 +37534,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ContentLauncher::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) @@ -36524,18 +37547,18 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ContentLauncher::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace MediaPlayback +} // namespace ContentLauncher -namespace MediaInput { +namespace AudioOutput { namespace Attributes { -namespace CurrentInput { +namespace CurrentOutput { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value) { @@ -36543,7 +37566,7 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * val Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::MediaInput::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::AudioOutput::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -36563,7 +37586,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MediaInput::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::AudioOutput::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value) @@ -36576,10 +37599,10 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MediaInput::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::AudioOutput::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -} // namespace CurrentInput +} // namespace CurrentOutput namespace FeatureMap { @@ -36589,7 +37612,7 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * va Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::MediaInput::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::AudioOutput::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -36609,7 +37632,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MediaInput::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::AudioOutput::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) @@ -36622,7 +37645,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MediaInput::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::AudioOutput::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace FeatureMap @@ -36635,7 +37658,7 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::MediaInput::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::AudioOutput::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -36655,7 +37678,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MediaInput::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::AudioOutput::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) @@ -36668,15 +37691,15 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::MediaInput::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::AudioOutput::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace MediaInput +} // namespace AudioOutput -namespace LowPower { +namespace ApplicationLauncher { namespace Attributes { namespace FeatureMap { @@ -36685,8 +37708,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * va { using Traits = NumericAttributeTraits; Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LowPower::Id, Id, readable, sizeof(temp)); + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -36706,7 +37730,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::LowPower::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) @@ -36719,19 +37743,119 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::LowPower::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace ApplicationLauncher + +namespace ApplicationBasic { +namespace Attributes { + +namespace VendorName { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) +{ + uint8_t zclString[32 + 1]; + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + + VerifyOrReturnError(value.size() == 32, Protocols::InteractionModel::Status::InvalidDataType); + memcpy(value.data(), &zclString[1], 32); + value.reduce_size(length); + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty) +{ + + static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[32 + 1]; + auto length = static_cast(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE, + markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + + static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[32 + 1]; + auto length = static_cast(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); } -} // namespace FeatureMap +} // namespace VendorName -namespace ClusterRevision { +namespace VendorID { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::VendorId * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LowPower::Id, Id, readable, sizeof(temp)); + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -36741,9 +37865,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::VendorId value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -36751,12 +37875,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::LowPower::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_VENDOR_ID_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::VendorId value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -36764,64 +37888,59 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::LowPower::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_VENDOR_ID_ATTRIBUTE_TYPE); } -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace LowPower - -namespace KeypadInput { -namespace Attributes { +} // namespace VendorID -namespace FeatureMap { +namespace ApplicationName { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + uint8_t zclString[256 + 2]; Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::KeypadInput::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + size_t length = emberAfLongStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) { return Protocols::InteractionModel::Status::ConstraintError; } - *value = Traits::StorageToWorking(temp); + + VerifyOrReturnError(value.size() == 256, Protocols::InteractionModel::Status::InvalidDataType); + memcpy(value.data(), &zclString[2], 256); + value.reduce_size(length); return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::KeypadInput::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); + + static_assert(256 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 256, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[256 + 2]; + auto length = static_cast(value.size()); + Encoding::LittleEndian::Put16(zclString, length); + memcpy(&zclString[2], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE, + markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::KeypadInput::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + + static_assert(256 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 256, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[256 + 2]; + auto length = static_cast(value.size()); + Encoding::LittleEndian::Put16(zclString, length); + memcpy(&zclString[2], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE); } -} // namespace FeatureMap +} // namespace ApplicationName -namespace ClusterRevision { +namespace ProductID { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -36829,7 +37948,7 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::KeypadInput::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -36849,7 +37968,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::KeypadInput::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) @@ -36862,27 +37981,21 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::KeypadInput::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace KeypadInput - -namespace ContentLauncher { -namespace Attributes { +} // namespace ProductID -namespace SupportedStreamingProtocols { +namespace Status { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, - chip::BitMask * value) + chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum * value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ContentLauncher::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -36892,11 +38005,10 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, - chip::BitMask value, - MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status +Set(chip::EndpointId endpoint, chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -36904,13 +38016,13 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ContentLauncher::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, - chip::BitMask value) + chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -36918,10 +38030,57 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ContentLauncher::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } -} // namespace SupportedStreamingProtocols +} // namespace Status + +namespace ApplicationVersion { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) +{ + uint8_t zclString[32 + 1]; + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + + VerifyOrReturnError(value.size() == 32, Protocols::InteractionModel::Status::InvalidDataType); + memcpy(value.data(), &zclString[1], 32); + value.reduce_size(length); + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty) +{ + + static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[32 + 1]; + auto length = static_cast(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE, + markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + + static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[32 + 1]; + auto length = static_cast(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace ApplicationVersion namespace FeatureMap { @@ -36931,7 +38090,7 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * va Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ContentLauncher::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -36951,7 +38110,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ContentLauncher::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) @@ -36964,7 +38123,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ContentLauncher::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace FeatureMap @@ -36977,7 +38136,7 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ContentLauncher::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -36997,7 +38156,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ContentLauncher::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) @@ -37010,63 +38169,17 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ContentLauncher::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace ContentLauncher +} // namespace ApplicationBasic -namespace AudioOutput { +namespace AccountLogin { namespace Attributes { -namespace CurrentOutput { - -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::AudioOutput::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::AudioOutput::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE, markDirty); -} - -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::AudioOutput::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -} // namespace CurrentOutput - namespace FeatureMap { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) @@ -37075,7 +38188,7 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * va Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::AudioOutput::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::AccountLogin::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -37095,7 +38208,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::AudioOutput::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::AccountLogin::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) @@ -37108,7 +38221,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::AudioOutput::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::AccountLogin::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace FeatureMap @@ -37121,7 +38234,7 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::AudioOutput::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::AccountLogin::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -37141,7 +38254,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::AudioOutput::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::AccountLogin::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) @@ -37154,26 +38267,26 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::AudioOutput::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::AccountLogin::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace AudioOutput +} // namespace AccountLogin -namespace ApplicationLauncher { +namespace ContentControl { namespace Attributes { -namespace FeatureMap { +namespace Enabled { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, bool * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -37183,9 +38296,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37193,12 +38306,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37206,70 +38319,64 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } -} // namespace FeatureMap +} // namespace Enabled -namespace ClusterRevision { +namespace OnDemandRatingThreshold { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + uint8_t zclString[8 + 1]; Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) { return Protocols::InteractionModel::Status::ConstraintError; } - *value = Traits::StorageToWorking(temp); + + VerifyOrReturnError(value.size() == 8, Protocols::InteractionModel::Status::InvalidDataType); + memcpy(value.data(), &zclString[1], 8); + value.reduce_size(length); return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); -} -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + static_assert(8 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 8, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[8 + 1]; + auto length = static_cast(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE, markDirty); } -} // namespace ClusterRevision +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value) +{ -} // namespace Attributes -} // namespace ApplicationLauncher + static_assert(8 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 8, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[8 + 1]; + auto length = static_cast(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} -namespace ApplicationBasic { -namespace Attributes { +} // namespace OnDemandRatingThreshold -namespace VendorName { +namespace ScheduledContentRatingThreshold { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { - uint8_t zclString[32 + 1]; + uint8_t zclString[8 + 1]; Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, sizeof(zclString)); + emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); size_t length = emberAfStringLength(zclString); if (length == NumericAttributeTraits::kNullValue) @@ -37277,8 +38384,8 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::Mutable return Protocols::InteractionModel::Status::ConstraintError; } - VerifyOrReturnError(value.size() == 32, Protocols::InteractionModel::Status::InvalidDataType); - memcpy(value.data(), &zclString[1], 32); + VerifyOrReturnError(value.size() == 8, Protocols::InteractionModel::Status::InvalidDataType); + memcpy(value.data(), &zclString[1], 8); value.reduce_size(length); return status; } @@ -37286,39 +38393,38 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::Mutable Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty) { - static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[32 + 1]; + static_assert(8 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 8, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[8 + 1]; auto length = static_cast(value.size()); Encoding::Put8(zclString, length); memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE, - markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value) { - static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[32 + 1]; + static_assert(8 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 8, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[8 + 1]; auto length = static_cast(value.size()); Encoding::Put8(zclString, length); memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); } -} // namespace VendorName +} // namespace ScheduledContentRatingThreshold -namespace VendorID { +namespace ScreenDailyTime { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::VendorId * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -37328,9 +38434,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::VendorI return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::VendorId value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37338,12 +38444,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::VendorI Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_VENDOR_ID_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::VendorId value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37351,67 +38457,112 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::VendorI Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_VENDOR_ID_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); } -} // namespace VendorID +} // namespace ScreenDailyTime -namespace ApplicationName { +namespace RemainingScreenTime { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) { - uint8_t zclString[256 + 2]; + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, sizeof(zclString)); + emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - size_t length = emberAfLongStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return Protocols::InteractionModel::Status::ConstraintError; } - - VerifyOrReturnError(value.size() == 256, Protocols::InteractionModel::Status::InvalidDataType); - memcpy(value.data(), &zclString[2], 256); - value.reduce_size(length); + *value = Traits::StorageToWorking(temp); return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) { + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE, markDirty); +} - static_assert(256 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 256, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[256 + 2]; - auto length = static_cast(value.size()); - Encoding::LittleEndian::Put16(zclString, length); - memcpy(&zclString[2], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE, - markDirty); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value) +} // namespace RemainingScreenTime + +namespace BlockUnrated { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, bool * value) { + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} - static_assert(256 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 256, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[256 + 2]; - auto length = static_cast(value.size()); - Encoding::LittleEndian::Put16(zclString, length); - memcpy(&zclString[2], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE, markDirty); } -} // namespace ApplicationName +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} -namespace ProductID { +} // namespace BlockUnrated -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +namespace FeatureMap { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -37421,9 +38572,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37431,12 +38582,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37444,21 +38595,20 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } -} // namespace ProductID +} // namespace FeatureMap -namespace Status { +namespace ClusterRevision { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, - chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -37468,10 +38618,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, return status; } -Protocols::InteractionModel::Status -Set(chip::EndpointId endpoint, chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37479,13 +38628,12 @@ Set(chip::EndpointId endpoint, chip::app::Clusters::ApplicationBasic::Applicatio Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, - chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37493,57 +38641,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); -} - -} // namespace Status - -namespace ApplicationVersion { - -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) -{ - uint8_t zclString[32 + 1]; - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, sizeof(zclString)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - - VerifyOrReturnError(value.size() == 32, Protocols::InteractionModel::Status::InvalidDataType); - memcpy(value.data(), &zclString[1], 32); - value.reduce_size(length); - return status; -} - -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty) -{ - - static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[32 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE, - markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value) -{ +} // namespace ClusterRevision - static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[32 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); -} +} // namespace Attributes +} // namespace ContentControl -} // namespace ApplicationVersion +namespace ContentAppObserver { +namespace Attributes { namespace FeatureMap { @@ -37553,7 +38660,7 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * va Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ContentAppObserver::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -37573,7 +38680,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ContentAppObserver::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) @@ -37586,7 +38693,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ContentAppObserver::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace FeatureMap @@ -37599,7 +38706,7 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ContentAppObserver::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -37619,7 +38726,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ContentAppObserver::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) @@ -37632,18 +38739,18 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ContentAppObserver::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace ApplicationBasic +} // namespace ContentAppObserver -namespace AccountLogin { +namespace ElectricalMeasurement { namespace Attributes { -namespace FeatureMap { +namespace MeasurementType { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) { @@ -37651,7 +38758,7 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * va Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::AccountLogin::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -37671,7 +38778,8 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::AccountLogin::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, + markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) @@ -37684,20 +38792,20 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::AccountLogin::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } -} // namespace FeatureMap +} // namespace MeasurementType -namespace ClusterRevision { +namespace DcVoltage { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::AccountLogin::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -37707,9 +38815,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37717,12 +38825,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::AccountLogin::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37730,26 +38838,20 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::AccountLogin::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace AccountLogin - -namespace ContentControl { -namespace Attributes { +} // namespace DcVoltage -namespace Enabled { +namespace DcVoltageMin { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, bool * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -37759,9 +38861,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, bool * value) return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37769,12 +38871,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value, M Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37782,112 +38884,66 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace Enabled +} // namespace DcVoltageMin -namespace OnDemandRatingThreshold { +namespace DcVoltageMax { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - uint8_t zclString[8 + 1]; + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, zclString, sizeof(zclString)); + emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return Protocols::InteractionModel::Status::ConstraintError; } - - VerifyOrReturnError(value.size() == 8, Protocols::InteractionModel::Status::InvalidDataType); - memcpy(value.data(), &zclString[1], 8); - value.reduce_size(length); + *value = Traits::StorageToWorking(temp); return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty) -{ - - static_assert(8 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 8, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[8 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE, markDirty); -} - -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value) -{ - - static_assert(8 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 8, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[8 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); -} - -} // namespace OnDemandRatingThreshold - -namespace ScheduledContentRatingThreshold { - -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - uint8_t zclString[8 + 1]; - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, zclString, sizeof(zclString)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; } - - VerifyOrReturnError(value.size() == 8, Protocols::InteractionModel::Status::InvalidDataType); - memcpy(value.data(), &zclString[1], 8); - value.reduce_size(length); - return status; -} - -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty) -{ - - static_assert(8 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 8, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[8 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE, markDirty); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - - static_assert(8 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 8, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[8 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace ScheduledContentRatingThreshold +} // namespace DcVoltageMax -namespace ScreenDailyTime { +namespace DcCurrent { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -37897,9 +38953,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37907,12 +38963,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37920,20 +38976,20 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace ScreenDailyTime +} // namespace DcCurrent -namespace RemainingScreenTime { +namespace DcCurrentMin { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -37943,9 +38999,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37953,12 +39009,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37966,20 +39022,20 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace RemainingScreenTime +} // namespace DcCurrentMin -namespace BlockUnrated { +namespace DcCurrentMax { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, bool * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -37989,9 +39045,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, bool * value) return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -37999,12 +39055,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value, M Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38012,20 +39068,20 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace BlockUnrated +} // namespace DcCurrentMax -namespace FeatureMap { +namespace DcPower { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -38035,9 +39091,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38045,12 +39101,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38058,20 +39114,20 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace FeatureMap +} // namespace DcPower -namespace ClusterRevision { +namespace DcPowerMin { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -38081,9 +39137,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38091,12 +39147,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38104,26 +39160,20 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace ContentControl - -namespace ContentAppObserver { -namespace Attributes { +} // namespace DcPowerMin -namespace FeatureMap { +namespace DcPowerMax { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ContentAppObserver::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -38133,9 +39183,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38143,12 +39193,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ContentAppObserver::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38156,12 +39206,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ContentAppObserver::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace FeatureMap +} // namespace DcPowerMax -namespace ClusterRevision { +namespace DcVoltageMultiplier { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -38169,7 +39219,7 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ContentAppObserver::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -38189,7 +39239,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ContentAppObserver::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) @@ -38202,22 +39252,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ContentAppObserver::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace ContentAppObserver - -namespace ElectricalMeasurement { -namespace Attributes { +} // namespace DcVoltageMultiplier -namespace MeasurementType { +namespace DcVoltageDivisor { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -38231,9 +39275,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38241,13 +39285,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, - markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38255,16 +39298,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace MeasurementType +} // namespace DcVoltageDivisor -namespace DcVoltage { +namespace DcCurrentMultiplier { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -38278,9 +39321,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38288,12 +39331,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38301,16 +39344,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace DcVoltage +} // namespace DcCurrentMultiplier -namespace DcVoltageMin { +namespace DcCurrentDivisor { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -38324,9 +39367,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38334,12 +39377,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38347,16 +39390,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace DcVoltageMin +} // namespace DcCurrentDivisor -namespace DcVoltageMax { +namespace DcPowerMultiplier { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -38370,9 +39413,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38380,12 +39423,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38393,16 +39436,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace DcVoltageMax +} // namespace DcPowerMultiplier -namespace DcCurrent { +namespace DcPowerDivisor { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -38416,9 +39459,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38426,12 +39469,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38439,16 +39482,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace DcCurrent +} // namespace DcPowerDivisor -namespace DcCurrentMin { +namespace AcFrequency { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -38462,9 +39505,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38472,12 +39515,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38485,16 +39528,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace DcCurrentMin +} // namespace AcFrequency -namespace DcCurrentMax { +namespace AcFrequencyMin { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -38508,9 +39551,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38518,12 +39561,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38531,16 +39574,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace DcCurrentMax +} // namespace AcFrequencyMin -namespace DcPower { +namespace AcFrequencyMax { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -38554,9 +39597,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38564,12 +39607,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38577,16 +39620,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace DcPower +} // namespace AcFrequencyMax -namespace DcPowerMin { +namespace NeutralCurrent { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -38600,9 +39643,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38610,12 +39653,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38623,16 +39666,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace DcPowerMin +} // namespace NeutralCurrent -namespace DcPowerMax { +namespace TotalActivePower { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int32_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -38646,9 +39689,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int32_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38656,12 +39699,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int32_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38669,16 +39712,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE); } -} // namespace DcPowerMax +} // namespace TotalActivePower -namespace DcVoltageMultiplier { +namespace TotalReactivePower { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int32_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -38692,9 +39735,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int32_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38702,12 +39745,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int32_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38715,16 +39758,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE); } -} // namespace DcVoltageMultiplier +} // namespace TotalReactivePower -namespace DcVoltageDivisor { +namespace TotalApparentPower { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -38738,9 +39781,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38748,12 +39791,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38761,16 +39804,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } -} // namespace DcVoltageDivisor +} // namespace TotalApparentPower -namespace DcCurrentMultiplier { +namespace Measured1stHarmonicCurrent { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -38784,9 +39827,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38794,12 +39837,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38807,16 +39850,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace DcCurrentMultiplier +} // namespace Measured1stHarmonicCurrent -namespace DcCurrentDivisor { +namespace Measured3rdHarmonicCurrent { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -38830,9 +39873,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38840,12 +39883,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38853,16 +39896,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace DcCurrentDivisor +} // namespace Measured3rdHarmonicCurrent -namespace DcPowerMultiplier { +namespace Measured5thHarmonicCurrent { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -38876,9 +39919,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38886,12 +39929,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38899,16 +39942,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace DcPowerMultiplier +} // namespace Measured5thHarmonicCurrent -namespace DcPowerDivisor { +namespace Measured7thHarmonicCurrent { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -38922,9 +39965,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38932,12 +39975,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38945,16 +39988,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace DcPowerDivisor +} // namespace Measured7thHarmonicCurrent -namespace AcFrequency { +namespace Measured9thHarmonicCurrent { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -38968,9 +40011,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38978,12 +40021,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -38991,16 +40034,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace AcFrequency +} // namespace Measured9thHarmonicCurrent -namespace AcFrequencyMin { +namespace Measured11thHarmonicCurrent { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -39014,9 +40057,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39024,12 +40067,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39037,16 +40080,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace AcFrequencyMin +} // namespace Measured11thHarmonicCurrent -namespace AcFrequencyMax { +namespace MeasuredPhase1stHarmonicCurrent { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -39060,9 +40103,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39070,12 +40113,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39083,16 +40126,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace AcFrequencyMax +} // namespace MeasuredPhase1stHarmonicCurrent -namespace NeutralCurrent { +namespace MeasuredPhase3rdHarmonicCurrent { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -39106,9 +40149,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39116,12 +40159,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39129,16 +40172,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace NeutralCurrent +} // namespace MeasuredPhase3rdHarmonicCurrent -namespace TotalActivePower { +namespace MeasuredPhase5thHarmonicCurrent { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int32_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -39152,9 +40195,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int32_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int32_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39162,12 +40205,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int32_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int32_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39175,16 +40218,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int32_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace TotalActivePower +} // namespace MeasuredPhase5thHarmonicCurrent -namespace TotalReactivePower { +namespace MeasuredPhase7thHarmonicCurrent { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int32_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -39198,9 +40241,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int32_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int32_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39208,12 +40251,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int32_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int32_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39221,16 +40264,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int32_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace TotalReactivePower +} // namespace MeasuredPhase7thHarmonicCurrent -namespace TotalApparentPower { +namespace MeasuredPhase9thHarmonicCurrent { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -39244,9 +40287,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39254,12 +40297,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39267,12 +40310,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace TotalApparentPower +} // namespace MeasuredPhase9thHarmonicCurrent -namespace Measured1stHarmonicCurrent { +namespace MeasuredPhase11thHarmonicCurrent { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { @@ -39316,13 +40359,13 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace Measured1stHarmonicCurrent +} // namespace MeasuredPhase11thHarmonicCurrent -namespace Measured3rdHarmonicCurrent { +namespace AcFrequencyMultiplier { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -39336,9 +40379,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39346,12 +40389,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39359,16 +40402,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace Measured3rdHarmonicCurrent +} // namespace AcFrequencyMultiplier -namespace Measured5thHarmonicCurrent { +namespace AcFrequencyDivisor { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -39382,9 +40425,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39392,12 +40435,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39405,16 +40448,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace Measured5thHarmonicCurrent +} // namespace AcFrequencyDivisor -namespace Measured7thHarmonicCurrent { +namespace PowerMultiplier { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -39428,9 +40471,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39438,12 +40481,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39451,16 +40494,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } -} // namespace Measured7thHarmonicCurrent +} // namespace PowerMultiplier -namespace Measured9thHarmonicCurrent { +namespace PowerDivisor { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -39474,9 +40517,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39484,12 +40527,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39497,16 +40540,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } -} // namespace Measured9thHarmonicCurrent +} // namespace PowerDivisor -namespace Measured11thHarmonicCurrent { +namespace HarmonicCurrentMultiplier { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int8_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -39520,9 +40563,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39530,12 +40573,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39543,16 +40586,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } -} // namespace Measured11thHarmonicCurrent +} // namespace HarmonicCurrentMultiplier -namespace MeasuredPhase1stHarmonicCurrent { +namespace PhaseHarmonicCurrentMultiplier { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int8_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -39566,9 +40609,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39576,12 +40619,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39589,12 +40632,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } -} // namespace MeasuredPhase1stHarmonicCurrent +} // namespace PhaseHarmonicCurrentMultiplier -namespace MeasuredPhase3rdHarmonicCurrent { +namespace InstantaneousVoltage { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { @@ -39638,13 +40681,13 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace MeasuredPhase3rdHarmonicCurrent +} // namespace InstantaneousVoltage -namespace MeasuredPhase5thHarmonicCurrent { +namespace InstantaneousLineCurrent { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -39658,9 +40701,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39668,12 +40711,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39681,12 +40724,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace MeasuredPhase5thHarmonicCurrent +} // namespace InstantaneousLineCurrent -namespace MeasuredPhase7thHarmonicCurrent { +namespace InstantaneousActiveCurrent { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { @@ -39730,9 +40773,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace MeasuredPhase7thHarmonicCurrent +} // namespace InstantaneousActiveCurrent -namespace MeasuredPhase9thHarmonicCurrent { +namespace InstantaneousReactiveCurrent { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { @@ -39776,9 +40819,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace MeasuredPhase9thHarmonicCurrent +} // namespace InstantaneousReactiveCurrent -namespace MeasuredPhase11thHarmonicCurrent { +namespace InstantaneousPower { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { @@ -39822,9 +40865,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace MeasuredPhase11thHarmonicCurrent +} // namespace InstantaneousPower -namespace AcFrequencyMultiplier { +namespace RmsVoltage { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -39868,9 +40911,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace AcFrequencyMultiplier +} // namespace RmsVoltage -namespace AcFrequencyDivisor { +namespace RmsVoltageMin { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -39914,13 +40957,13 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace AcFrequencyDivisor +} // namespace RmsVoltageMin -namespace PowerMultiplier { +namespace RmsVoltageMax { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -39934,9 +40977,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39944,12 +40987,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39957,16 +41000,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace PowerMultiplier +} // namespace RmsVoltageMax -namespace PowerDivisor { +namespace RmsCurrent { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -39980,9 +41023,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -39990,12 +41033,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -40003,16 +41046,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace PowerDivisor +} // namespace RmsCurrent -namespace HarmonicCurrentMultiplier { +namespace RmsCurrentMin { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int8_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -40026,9 +41069,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int8_t * valu return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -40036,12 +41079,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value, Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -40049,16 +41092,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace HarmonicCurrentMultiplier +} // namespace RmsCurrentMin -namespace PhaseHarmonicCurrentMultiplier { +namespace RmsCurrentMax { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int8_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -40072,9 +41115,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int8_t * valu return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -40082,12 +41125,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value, Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -40095,12 +41138,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace PhaseHarmonicCurrentMultiplier +} // namespace RmsCurrentMax -namespace InstantaneousVoltage { +namespace ActivePower { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { @@ -40144,55 +41187,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace InstantaneousVoltage - -namespace InstantaneousLineCurrent { - -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); -} - -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace InstantaneousLineCurrent +} // namespace ActivePower -namespace InstantaneousActiveCurrent { +namespace ActivePowerMin { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { @@ -40236,9 +41233,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace InstantaneousActiveCurrent +} // namespace ActivePowerMin -namespace InstantaneousReactiveCurrent { +namespace ActivePowerMax { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { @@ -40282,9 +41279,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace InstantaneousReactiveCurrent +} // namespace ActivePowerMax -namespace InstantaneousPower { +namespace ReactivePower { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { @@ -40328,9 +41325,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace InstantaneousPower +} // namespace ReactivePower -namespace RmsVoltage { +namespace ApparentPower { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -40374,13 +41371,13 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace RmsVoltage +} // namespace ApparentPower -namespace RmsVoltageMin { +namespace PowerFactor { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int8_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -40394,9 +41391,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -40404,12 +41401,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -40417,12 +41414,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } -} // namespace RmsVoltageMin +} // namespace PowerFactor -namespace RmsVoltageMax { +namespace AverageRmsVoltageMeasurementPeriod { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -40466,9 +41463,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace RmsVoltageMax +} // namespace AverageRmsVoltageMeasurementPeriod -namespace RmsCurrent { +namespace AverageRmsUnderVoltageCounter { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -40512,9 +41509,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace RmsCurrent +} // namespace AverageRmsUnderVoltageCounter -namespace RmsCurrentMin { +namespace RmsExtremeOverVoltagePeriod { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -40558,9 +41555,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace RmsCurrentMin +} // namespace RmsExtremeOverVoltagePeriod -namespace RmsCurrentMax { +namespace RmsExtremeUnderVoltagePeriod { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -40604,13 +41601,13 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace RmsCurrentMax +} // namespace RmsExtremeUnderVoltagePeriod -namespace ActivePower { +namespace RmsVoltageSagPeriod { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -40624,9 +41621,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -40634,12 +41631,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -40647,16 +41644,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace ActivePower +} // namespace RmsVoltageSagPeriod -namespace ActivePowerMin { +namespace RmsVoltageSwellPeriod { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -40670,9 +41667,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -40680,12 +41677,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -40693,16 +41690,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace ActivePowerMin +} // namespace RmsVoltageSwellPeriod -namespace ActivePowerMax { +namespace AcVoltageMultiplier { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -40716,9 +41713,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -40726,12 +41723,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -40739,16 +41736,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace ActivePowerMax +} // namespace AcVoltageMultiplier -namespace ReactivePower { +namespace AcVoltageDivisor { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -40762,9 +41759,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -40772,12 +41769,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -40785,12 +41782,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace ReactivePower +} // namespace AcVoltageDivisor -namespace ApparentPower { +namespace AcCurrentMultiplier { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -40834,13 +41831,13 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace ApparentPower +} // namespace AcCurrentMultiplier -namespace PowerFactor { +namespace AcCurrentDivisor { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int8_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -40854,9 +41851,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int8_t * valu return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -40864,12 +41861,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value, Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -40877,12 +41874,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace PowerFactor +} // namespace AcCurrentDivisor -namespace AverageRmsVoltageMeasurementPeriod { +namespace AcPowerMultiplier { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -40926,9 +41923,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace AverageRmsVoltageMeasurementPeriod +} // namespace AcPowerMultiplier -namespace AverageRmsUnderVoltageCounter { +namespace AcPowerDivisor { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -40972,13 +41969,13 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace AverageRmsUnderVoltageCounter +} // namespace AcPowerDivisor -namespace RmsExtremeOverVoltagePeriod { +namespace OverloadAlarmsMask { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -40992,9 +41989,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41002,12 +41999,13 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE, + markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41015,16 +42013,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } -} // namespace RmsExtremeOverVoltagePeriod +} // namespace OverloadAlarmsMask -namespace RmsExtremeUnderVoltagePeriod { +namespace VoltageOverload { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -41038,9 +42036,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41048,12 +42046,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41061,16 +42059,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace RmsExtremeUnderVoltagePeriod +} // namespace VoltageOverload -namespace RmsVoltageSagPeriod { +namespace CurrentOverload { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -41084,9 +42082,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41094,12 +42092,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41107,12 +42105,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace RmsVoltageSagPeriod +} // namespace CurrentOverload -namespace RmsVoltageSwellPeriod { +namespace AcOverloadAlarmsMask { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -41140,7 +42138,8 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE, + markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) @@ -41153,16 +42152,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } -} // namespace RmsVoltageSwellPeriod +} // namespace AcOverloadAlarmsMask -namespace AcVoltageMultiplier { +namespace AcVoltageOverload { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -41176,9 +42175,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41186,12 +42185,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41199,16 +42198,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace AcVoltageMultiplier +} // namespace AcVoltageOverload -namespace AcVoltageDivisor { +namespace AcCurrentOverload { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -41222,9 +42221,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41232,12 +42231,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41245,16 +42244,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace AcVoltageDivisor +} // namespace AcCurrentOverload -namespace AcCurrentMultiplier { +namespace AcActivePowerOverload { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -41268,9 +42267,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41278,12 +42277,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41291,16 +42290,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace AcCurrentMultiplier +} // namespace AcActivePowerOverload -namespace AcCurrentDivisor { +namespace AcReactivePowerOverload { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -41314,9 +42313,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41324,12 +42323,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41337,16 +42336,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace AcCurrentDivisor +} // namespace AcReactivePowerOverload -namespace AcPowerMultiplier { +namespace AverageRmsOverVoltage { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -41360,9 +42359,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41370,12 +42369,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41383,16 +42382,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace AcPowerMultiplier +} // namespace AverageRmsOverVoltage -namespace AcPowerDivisor { +namespace AverageRmsUnderVoltage { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -41406,9 +42405,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41416,12 +42415,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41429,16 +42428,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace AcPowerDivisor +} // namespace AverageRmsUnderVoltage -namespace OverloadAlarmsMask { +namespace RmsExtremeOverVoltage { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -41452,9 +42451,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41462,13 +42461,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE, - markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41476,12 +42474,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace OverloadAlarmsMask +} // namespace RmsExtremeOverVoltage -namespace VoltageOverload { +namespace RmsExtremeUnderVoltage { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { @@ -41525,9 +42523,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace VoltageOverload +} // namespace RmsExtremeUnderVoltage -namespace CurrentOverload { +namespace RmsVoltageSag { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { @@ -41571,13 +42569,13 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace CurrentOverload +} // namespace RmsVoltageSag -namespace AcOverloadAlarmsMask { +namespace RmsVoltageSwell { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -41591,9 +42589,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41601,13 +42599,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE, - markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41615,16 +42612,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace AcOverloadAlarmsMask +} // namespace RmsVoltageSwell -namespace AcVoltageOverload { +namespace LineCurrentPhaseB { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -41638,9 +42635,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41648,12 +42645,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41661,12 +42658,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace AcVoltageOverload +} // namespace LineCurrentPhaseB -namespace AcCurrentOverload { +namespace ActiveCurrentPhaseB { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { @@ -41710,9 +42707,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace AcCurrentOverload +} // namespace ActiveCurrentPhaseB -namespace AcActivePowerOverload { +namespace ReactiveCurrentPhaseB { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { @@ -41756,13 +42753,13 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace AcActivePowerOverload +} // namespace ReactiveCurrentPhaseB -namespace AcReactivePowerOverload { +namespace RmsVoltagePhaseB { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -41776,9 +42773,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41786,12 +42783,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41799,16 +42796,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace AcReactivePowerOverload +} // namespace RmsVoltagePhaseB -namespace AverageRmsOverVoltage { +namespace RmsVoltageMinPhaseB { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -41822,9 +42819,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41832,12 +42829,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41845,16 +42842,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace AverageRmsOverVoltage +} // namespace RmsVoltageMinPhaseB -namespace AverageRmsUnderVoltage { +namespace RmsVoltageMaxPhaseB { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -41868,9 +42865,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41878,12 +42875,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41891,16 +42888,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace AverageRmsUnderVoltage +} // namespace RmsVoltageMaxPhaseB -namespace RmsExtremeOverVoltage { +namespace RmsCurrentPhaseB { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -41914,9 +42911,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41924,12 +42921,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41937,16 +42934,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace RmsExtremeOverVoltage +} // namespace RmsCurrentPhaseB -namespace RmsExtremeUnderVoltage { +namespace RmsCurrentMinPhaseB { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -41960,9 +42957,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41970,12 +42967,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -41983,16 +42980,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace RmsExtremeUnderVoltage +} // namespace RmsCurrentMinPhaseB -namespace RmsVoltageSag { +namespace RmsCurrentMaxPhaseB { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -42006,9 +43003,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -42016,12 +43013,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -42029,12 +43026,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace RmsVoltageSag +} // namespace RmsCurrentMaxPhaseB -namespace RmsVoltageSwell { +namespace ActivePowerPhaseB { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { @@ -42078,13 +43075,13 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace RmsVoltageSwell +} // namespace ActivePowerPhaseB -namespace LineCurrentPhaseB { +namespace ActivePowerMinPhaseB { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -42098,9 +43095,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -42108,12 +43105,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -42121,12 +43118,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace LineCurrentPhaseB +} // namespace ActivePowerMinPhaseB -namespace ActiveCurrentPhaseB { +namespace ActivePowerMaxPhaseB { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { @@ -42170,9 +43167,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace ActiveCurrentPhaseB +} // namespace ActivePowerMaxPhaseB -namespace ReactiveCurrentPhaseB { +namespace ReactivePowerPhaseB { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { @@ -42216,9 +43213,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace ReactiveCurrentPhaseB +} // namespace ReactivePowerPhaseB -namespace RmsVoltagePhaseB { +namespace ApparentPowerPhaseB { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -42262,13 +43259,13 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace RmsVoltagePhaseB +} // namespace ApparentPowerPhaseB -namespace RmsVoltageMinPhaseB { +namespace PowerFactorPhaseB { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int8_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -42282,9 +43279,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -42292,12 +43289,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -42305,12 +43302,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } -} // namespace RmsVoltageMinPhaseB +} // namespace PowerFactorPhaseB -namespace RmsVoltageMaxPhaseB { +namespace AverageRmsVoltageMeasurementPeriodPhaseB { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -42354,9 +43351,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace RmsVoltageMaxPhaseB +} // namespace AverageRmsVoltageMeasurementPeriodPhaseB -namespace RmsCurrentPhaseB { +namespace AverageRmsOverVoltageCounterPhaseB { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -42400,9 +43397,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace RmsCurrentPhaseB +} // namespace AverageRmsOverVoltageCounterPhaseB -namespace RmsCurrentMinPhaseB { +namespace AverageRmsUnderVoltageCounterPhaseB { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -42446,9 +43443,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace RmsCurrentMinPhaseB +} // namespace AverageRmsUnderVoltageCounterPhaseB -namespace RmsCurrentMaxPhaseB { +namespace RmsExtremeOverVoltagePeriodPhaseB { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -42492,13 +43489,13 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace RmsCurrentMaxPhaseB +} // namespace RmsExtremeOverVoltagePeriodPhaseB -namespace ActivePowerPhaseB { +namespace RmsExtremeUnderVoltagePeriodPhaseB { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -42512,9 +43509,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -42522,12 +43519,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -42535,16 +43532,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace ActivePowerPhaseB +} // namespace RmsExtremeUnderVoltagePeriodPhaseB -namespace ActivePowerMinPhaseB { +namespace RmsVoltageSagPeriodPhaseB { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -42558,9 +43555,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -42568,12 +43565,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -42581,16 +43578,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace ActivePowerMinPhaseB +} // namespace RmsVoltageSagPeriodPhaseB -namespace ActivePowerMaxPhaseB { +namespace RmsVoltageSwellPeriodPhaseB { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -42604,9 +43601,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -42614,12 +43611,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -42627,16 +43624,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace ActivePowerMaxPhaseB +} // namespace RmsVoltageSwellPeriodPhaseB -namespace ReactivePowerPhaseB { +namespace LineCurrentPhaseC { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -42650,9 +43647,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -42660,12 +43657,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -42673,16 +43670,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace ReactivePowerPhaseB +} // namespace LineCurrentPhaseC -namespace ApparentPowerPhaseB { +namespace ActiveCurrentPhaseC { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -42696,9 +43693,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -42706,12 +43703,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -42719,16 +43716,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace ApparentPowerPhaseB +} // namespace ActiveCurrentPhaseC -namespace PowerFactorPhaseB { +namespace ReactiveCurrentPhaseC { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int8_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -42742,9 +43739,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int8_t * valu return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -42752,12 +43749,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value, Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -42765,12 +43762,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace PowerFactorPhaseB +} // namespace ReactiveCurrentPhaseC -namespace AverageRmsVoltageMeasurementPeriodPhaseB { +namespace RmsVoltagePhaseC { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -42814,9 +43811,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace AverageRmsVoltageMeasurementPeriodPhaseB +} // namespace RmsVoltagePhaseC -namespace AverageRmsOverVoltageCounterPhaseB { +namespace RmsVoltageMinPhaseC { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -42860,9 +43857,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace AverageRmsOverVoltageCounterPhaseB +} // namespace RmsVoltageMinPhaseC -namespace AverageRmsUnderVoltageCounterPhaseB { +namespace RmsVoltageMaxPhaseC { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -42906,9 +43903,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace AverageRmsUnderVoltageCounterPhaseB +} // namespace RmsVoltageMaxPhaseC -namespace RmsExtremeOverVoltagePeriodPhaseB { +namespace RmsCurrentPhaseC { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -42952,9 +43949,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace RmsExtremeOverVoltagePeriodPhaseB +} // namespace RmsCurrentPhaseC -namespace RmsExtremeUnderVoltagePeriodPhaseB { +namespace RmsCurrentMinPhaseC { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -42998,9 +43995,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace RmsExtremeUnderVoltagePeriodPhaseB +} // namespace RmsCurrentMinPhaseC -namespace RmsVoltageSagPeriodPhaseB { +namespace RmsCurrentMaxPhaseC { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -43044,13 +44041,13 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace RmsVoltageSagPeriodPhaseB +} // namespace RmsCurrentMaxPhaseC -namespace RmsVoltageSwellPeriodPhaseB { +namespace ActivePowerPhaseC { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -43064,9 +44061,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -43074,12 +44071,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -43087,16 +44084,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace RmsVoltageSwellPeriodPhaseB +} // namespace ActivePowerPhaseC -namespace LineCurrentPhaseC { +namespace ActivePowerMinPhaseC { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -43110,9 +44107,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -43120,12 +44117,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -43133,12 +44130,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace LineCurrentPhaseC +} // namespace ActivePowerMinPhaseC -namespace ActiveCurrentPhaseC { +namespace ActivePowerMaxPhaseC { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { @@ -43182,9 +44179,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace ActiveCurrentPhaseC +} // namespace ActivePowerMaxPhaseC -namespace ReactiveCurrentPhaseC { +namespace ReactivePowerPhaseC { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) { @@ -43228,9 +44225,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -} // namespace ReactiveCurrentPhaseC +} // namespace ReactivePowerPhaseC -namespace RmsVoltagePhaseC { +namespace ApparentPowerPhaseC { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -43274,13 +44271,13 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace RmsVoltagePhaseC +} // namespace ApparentPowerPhaseC -namespace RmsVoltageMinPhaseC { +namespace PowerFactorPhaseC { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int8_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -43294,9 +44291,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -43304,12 +44301,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -43317,12 +44314,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } -} // namespace RmsVoltageMinPhaseC +} // namespace PowerFactorPhaseC -namespace RmsVoltageMaxPhaseC { +namespace AverageRmsVoltageMeasurementPeriodPhaseC { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -43366,9 +44363,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace RmsVoltageMaxPhaseC +} // namespace AverageRmsVoltageMeasurementPeriodPhaseC -namespace RmsCurrentPhaseC { +namespace AverageRmsOverVoltageCounterPhaseC { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -43412,9 +44409,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace RmsCurrentPhaseC +} // namespace AverageRmsOverVoltageCounterPhaseC -namespace RmsCurrentMinPhaseC { +namespace AverageRmsUnderVoltageCounterPhaseC { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -43458,9 +44455,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace RmsCurrentMinPhaseC +} // namespace AverageRmsUnderVoltageCounterPhaseC -namespace RmsCurrentMaxPhaseC { +namespace RmsExtremeOverVoltagePeriodPhaseC { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -43504,13 +44501,13 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace RmsCurrentMaxPhaseC +} // namespace RmsExtremeOverVoltagePeriodPhaseC -namespace ActivePowerPhaseC { +namespace RmsExtremeUnderVoltagePeriodPhaseC { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -43524,9 +44521,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -43534,12 +44531,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -43547,16 +44544,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace ActivePowerPhaseC +} // namespace RmsExtremeUnderVoltagePeriodPhaseC -namespace ActivePowerMinPhaseC { +namespace RmsVoltageSagPeriodPhaseC { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -43570,9 +44567,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -43580,12 +44577,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -43593,16 +44590,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace ActivePowerMinPhaseC +} // namespace RmsVoltageSagPeriodPhaseC -namespace ActivePowerMaxPhaseC { +namespace RmsVoltageSwellPeriodPhaseC { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -43616,9 +44613,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -43626,12 +44623,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -43639,16 +44636,16 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace ActivePowerMaxPhaseC +} // namespace RmsVoltageSwellPeriodPhaseC -namespace ReactivePowerPhaseC { +namespace FeatureMap { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -43662,9 +44659,9 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -43672,12 +44669,13 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, + markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -43685,12 +44683,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } -} // namespace ReactivePowerPhaseC +} // namespace FeatureMap -namespace ApparentPowerPhaseC { +namespace ClusterRevision { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) { @@ -43734,375 +44732,469 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace ApparentPowerPhaseC +} // namespace ClusterRevision -namespace PowerFactorPhaseC { +} // namespace Attributes +} // namespace ElectricalMeasurement -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int8_t * value) +namespace MeterIdentification { +namespace Attributes { + +namespace MeterType { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, + DataModel::Nullable & value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::MeterIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return Protocols::InteractionModel::Status::ConstraintError; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::MeterIdentification::MeterTypeEnum value, + MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return Protocols::InteractionModel::Status::ConstraintError; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::MeterIdentification::MeterTypeEnum value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return Protocols::InteractionModel::Status::ConstraintError; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } -} // namespace PowerFactorPhaseC +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE, markDirty); +} -namespace AverageRmsVoltageMeasurementPeriodPhaseC { +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status +Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + if (value.IsNull()) + { + return SetNull(endpoint, markDirty); + } + + return Set(endpoint, value.Value(), markDirty); +} + +Protocols::InteractionModel::Status +Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace MeterType + +namespace UtilityName { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + if (value.IsNull()) + { + ChipLogError(Zcl, "Null Nullable passed to MeterIdentification::UtilityName::Get"); + return Protocols::InteractionModel::Status::Failure; + } + + uint8_t zclString[16 + 1]; Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) { - return Protocols::InteractionModel::Status::ConstraintError; + value.SetNull(); + return Protocols::InteractionModel::Status::Success; } - *value = Traits::StorageToWorking(temp); + auto & span = value.Value(); + + VerifyOrReturnError(span.size() == 16, Protocols::InteractionModel::Status::InvalidDataType); + memcpy(span.data(), &zclString[1], 16); + span.reduce_size(length); return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[16 + 1]; + auto length = static_cast(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE, + markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[16 + 1]; + auto length = static_cast(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty) +{ + uint8_t zclString[1] = { 0xFF }; + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE, + markDirty); +} + +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint) +{ + uint8_t zclString[1] = { 0xFF }; + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty) +{ + if (value.IsNull()) { - return Protocols::InteractionModel::Status::ConstraintError; + return SetNull(endpoint, markDirty); } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + + return Set(endpoint, value.Value(), markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (value.IsNull()) { - return Protocols::InteractionModel::Status::ConstraintError; + return SetNull(endpoint); } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + + return Set(endpoint, value.Value()); } -} // namespace AverageRmsVoltageMeasurementPeriodPhaseC +} // namespace UtilityName -namespace AverageRmsOverVoltageCounterPhaseC { +namespace PointOfDelivery { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + if (value.IsNull()) + { + ChipLogError(Zcl, "Null Nullable passed to MeterIdentification::PointOfDelivery::Get"); + return Protocols::InteractionModel::Status::Failure; + } + + uint8_t zclString[16 + 1]; Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) { - return Protocols::InteractionModel::Status::ConstraintError; + value.SetNull(); + return Protocols::InteractionModel::Status::Success; } - *value = Traits::StorageToWorking(temp); + auto & span = value.Value(); + + VerifyOrReturnError(span.size() == 16, Protocols::InteractionModel::Status::InvalidDataType); + memcpy(span.data(), &zclString[1], 16); + span.reduce_size(length); return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty) +{ + + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[16 + 1]; + auto length = static_cast(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE, + markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[16 + 1]; + auto length = static_cast(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + uint8_t zclString[1] = { 0xFF }; + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE, + markDirty); } -} // namespace AverageRmsOverVoltageCounterPhaseC - -namespace AverageRmsUnderVoltageCounterPhaseC { - -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint) { - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; + uint8_t zclString[1] = { 0xFF }; + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (value.IsNull()) { - return Protocols::InteractionModel::Status::ConstraintError; + return SetNull(endpoint, markDirty); } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + + return Set(endpoint, value.Value(), markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (value.IsNull()) { - return Protocols::InteractionModel::Status::ConstraintError; + return SetNull(endpoint); } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + + return Set(endpoint, value.Value()); } -} // namespace AverageRmsUnderVoltageCounterPhaseC +} // namespace PointOfDelivery -namespace RmsExtremeOverVoltagePeriodPhaseC { +namespace PowerThreshold { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::MeterIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return Protocols::InteractionModel::Status::ConstraintError; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int64_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return Protocols::InteractionModel::Status::ConstraintError; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_POWER_MW_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int64_t value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return Protocols::InteractionModel::Status::ConstraintError; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_POWER_MW_ATTRIBUTE_TYPE); } -} // namespace RmsExtremeOverVoltagePeriodPhaseC - -namespace RmsExtremeUnderVoltagePeriodPhaseC { +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_POWER_MW_ATTRIBUTE_TYPE, markDirty); +} -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint) { - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *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::MeterIdentification::Id, Id, writable, ZCL_POWER_MW_ATTRIBUTE_TYPE); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (value.IsNull()) { - return Protocols::InteractionModel::Status::ConstraintError; + return SetNull(endpoint, markDirty); } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + + return Set(endpoint, value.Value(), markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (value.IsNull()) { - return Protocols::InteractionModel::Status::ConstraintError; + return SetNull(endpoint); } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + + return Set(endpoint, value.Value()); } -} // namespace RmsExtremeUnderVoltagePeriodPhaseC +} // namespace PowerThreshold -namespace RmsVoltageSagPeriodPhaseC { +namespace PowerThresholdSource { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status +Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::MeterIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return Protocols::InteractionModel::Status::ConstraintError; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::app::Clusters::MeterIdentification::PowerThresholdSourceEnum value, + MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return Protocols::InteractionModel::Status::ConstraintError; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::app::Clusters::MeterIdentification::PowerThresholdSourceEnum value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return Protocols::InteractionModel::Status::ConstraintError; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } -} // namespace RmsVoltageSagPeriodPhaseC - -namespace RmsVoltageSwellPeriodPhaseC { +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE, markDirty); +} -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint) { - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *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::MeterIdentification::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status +Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (value.IsNull()) { - return Protocols::InteractionModel::Status::ConstraintError; + return SetNull(endpoint, markDirty); } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + + return Set(endpoint, value.Value(), markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status +Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable & value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (value.IsNull()) { - return Protocols::InteractionModel::Status::ConstraintError; + return SetNull(endpoint); } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + + return Set(endpoint, value.Value()); } -} // namespace RmsVoltageSwellPeriodPhaseC +} // namespace PowerThresholdSource namespace FeatureMap { @@ -44112,7 +45204,7 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * va Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::MeterIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -44132,8 +45224,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, - markDirty); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) @@ -44146,7 +45237,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace FeatureMap @@ -44159,7 +45250,7 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::MeterIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -44179,7 +45270,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) @@ -44192,13 +45283,13 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace ElectricalMeasurement +} // namespace MeterIdentification namespace UnitTesting { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 4d0c6c1d97ad9a..e4fa3ffee26985 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 @@ -2557,6 +2557,80 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu } // namespace Attributes } // namespace EnergyEvse +namespace EnergyCalendar { +namespace Attributes { + +namespace CalendarID { +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int32u +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint); +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty); +} // namespace CalendarID + +namespace Name { +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, + DataModel::Nullable & value); // char_string +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint); +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty); +} // namespace Name + +namespace ProviderID { +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int32u +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint); +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty); +} // namespace ProviderID + +namespace EventID { +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int32u +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint); +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty); +} // namespace EventID + +namespace StartDate { +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value); // epoch_s +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint); +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty); +} // namespace StartDate + +namespace FeatureMap { +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); +} // namespace FeatureMap + +namespace ClusterRevision { +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value); // int16u +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace EnergyCalendar + namespace EnergyPreference { namespace Attributes { @@ -6674,6 +6748,97 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu } // namespace Attributes } // namespace ElectricalMeasurement +namespace MeterIdentification { +namespace Attributes { + +namespace MeterType { +Protocols::InteractionModel::Status +Get(chip::EndpointId endpoint, + DataModel::Nullable & value); // MeterTypeEnum +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::MeterIdentification::MeterTypeEnum value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::MeterIdentification::MeterTypeEnum value, + MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint); +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status +Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable & value); +Protocols::InteractionModel::Status +Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty); +} // namespace MeterType + +namespace UtilityName { +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, + DataModel::Nullable & value); // char_string +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint); +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty); +} // namespace UtilityName + +namespace PointOfDelivery { +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, + DataModel::Nullable & value); // char_string +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint); +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty); +} // namespace PointOfDelivery + +namespace PowerThreshold { +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value); // power_mw +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int64_t value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int64_t value, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint); +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty); +} // namespace PowerThreshold + +namespace PowerThresholdSource { +Protocols::InteractionModel::Status +Get(chip::EndpointId endpoint, + DataModel::Nullable & value); // PowerThresholdSourceEnum +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::app::Clusters::MeterIdentification::PowerThresholdSourceEnum value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::app::Clusters::MeterIdentification::PowerThresholdSourceEnum value, + MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint); +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status +Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable & value); +Protocols::InteractionModel::Status +Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty); +} // namespace PowerThresholdSource + +namespace FeatureMap { +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); +} // namespace FeatureMap + +namespace ClusterRevision { +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value); // int16u +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace MeterIdentification + namespace UnitTesting { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 1619aeb30881d7..2181c0dfd29600 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -388,6 +388,11 @@ void emberAfDeviceEnergyManagementClusterInitCallback(chip::EndpointId endpoint) */ void emberAfEnergyEvseClusterInitCallback(chip::EndpointId endpoint); +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfEnergyCalendarClusterInitCallback(chip::EndpointId endpoint); + /** * @param endpoint Endpoint that is being initialized */ @@ -628,6 +633,11 @@ void emberAfContentAppObserverClusterInitCallback(chip::EndpointId endpoint); */ void emberAfElectricalMeasurementClusterInitCallback(chip::EndpointId endpoint); +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfMeterIdentificationClusterInitCallback(chip::EndpointId endpoint); + /** * @param endpoint Endpoint that is being initialized */ @@ -3384,6 +3394,45 @@ MatterEnergyEvseClusterServerPreAttributeChangedCallback(const chip::app::Concre */ void emberAfEnergyEvseClusterServerTickCallback(chip::EndpointId endpoint); +// +// Energy Calendar Cluster +// + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfEnergyCalendarClusterServerInitCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being shutdown + */ +void MatterEnergyCalendarClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfEnergyCalendarClusterClientInitCallback(chip::EndpointId endpoint); + +/** + * @param attributePath Concrete attribute path that changed + */ +void MatterEnergyCalendarClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status +MatterEnergyCalendarClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** + * @param endpoint Endpoint that is being served + */ +void emberAfEnergyCalendarClusterServerTickCallback(chip::EndpointId endpoint); + // // Energy Preference Cluster // @@ -5244,6 +5293,44 @@ chip::Protocols::InteractionModel::Status MatterElectricalMeasurementClusterServ */ void emberAfElectricalMeasurementClusterServerTickCallback(chip::EndpointId endpoint); +// +// Meter Identification Cluster +// + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfMeterIdentificationClusterServerInitCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being shutdown + */ +void MatterMeterIdentificationClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfMeterIdentificationClusterClientInitCallback(chip::EndpointId endpoint); + +/** + * @param attributePath Concrete attribute path that changed + */ +void MatterMeterIdentificationClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status MatterMeterIdentificationClusterServerPreAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** + * @param endpoint Endpoint that is being served + */ +void emberAfMeterIdentificationClusterServerTickCallback(chip::EndpointId endpoint); + // // Unit Testing Cluster // 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 7e52fd09a2c13c..bc27df745c3e89 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 @@ -1866,6 +1866,21 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(EnergyEvse::SupplyState } } +static auto __attribute__((unused)) EnsureKnownEnumValue(EnergyCalendar::PeakPeriodSeverityEnum val) +{ + using EnumType = EnergyCalendar::PeakPeriodSeverityEnum; + switch (val) + { + case EnumType::kUnused: + case EnumType::kLow: + case EnumType::kMedium: + case EnumType::kHigh: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} + static auto __attribute__((unused)) EnsureKnownEnumValue(EnergyPreference::EnergyPriorityEnum val) { using EnumType = EnergyPreference::EnergyPriorityEnum; @@ -3386,6 +3401,33 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(ContentAppObserver::Sta } } +static auto __attribute__((unused)) EnsureKnownEnumValue(MeterIdentification::MeterTypeEnum val) +{ + using EnumType = MeterIdentification::MeterTypeEnum; + switch (val) + { + case EnumType::kUtility: + case EnumType::kPrivate: + case EnumType::kGeneric: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(MeterIdentification::PowerThresholdSourceEnum val) +{ + using EnumType = MeterIdentification::PowerThresholdSourceEnum; + switch (val) + { + case EnumType::kContract: + case EnumType::kRegulator: + case EnumType::kEquipment: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} + static auto __attribute__((unused)) EnsureKnownEnumValue(UnitTesting::SimpleEnum val) { using EnumType = UnitTesting::SimpleEnum; 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 a7c433848df662..6257be81b88c95 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 @@ -2707,6 +2707,57 @@ enum class TargetDayOfWeekBitmap : uint8_t }; } // namespace EnergyEvse +namespace EnergyCalendar { + +// Enum for PeakPeriodSeverityEnum +enum class PeakPeriodSeverityEnum : uint8_t +{ + kUnused = 0x00, + kLow = 0x01, + kMedium = 0x02, + kHigh = 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 AuxiliaryLoadBitmap +enum class AuxiliaryLoadBitmap : uint8_t +{ + kAuxiliarySwitch1 = 0x1, + kAuxiliarySwitch2 = 0x2, + kAuxiliarySwitch3 = 0x4, + kAuxiliarySwitch4 = 0x8, + kAuxiliarySwitch5 = 0x10, + kAuxiliarySwitch6 = 0x20, + kAuxiliarySwitch7 = 0x40, + kAuxiliarySwitch8 = 0x80, +}; + +// Bitmap for Feature +enum class Feature : uint32_t +{ + kPricingTier = 0x1, + kFriendlyCredit = 0x2, + kAuxiliaryLoad = 0x4, + kPeakPeriod = 0x8, +}; + +// Bitmap for TransitionDayOfWeekBitmap +enum class TransitionDayOfWeekBitmap : uint8_t +{ + kSunday = 0x1, + kMonday = 0x2, + kTuesday = 0x4, + kWednesday = 0x8, + kThursday = 0x10, + kFriday = 0x20, + kSaturday = 0x40, +}; +} // namespace EnergyCalendar + namespace EnergyPreference { // Enum for EnergyPriorityEnum @@ -5122,6 +5173,41 @@ enum class StatusEnum : uint8_t namespace ElectricalMeasurement {} // namespace ElectricalMeasurement +namespace MeterIdentification { + +// Enum for MeterTypeEnum +enum class MeterTypeEnum : uint8_t +{ + kUtility = 0x00, + kPrivate = 0x01, + kGeneric = 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 PowerThresholdSourceEnum +enum class PowerThresholdSourceEnum : uint8_t +{ + kContract = 0x00, + kRegulator = 0x01, + kEquipment = 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 Feature +enum class Feature : uint32_t +{ + kPowerThreshold = 0x1, +}; +} // namespace MeterIdentification + namespace UnitTesting { // Enum for SimpleEnum diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 54bcec37353ef1..bdf104c0fb3a98 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -17104,6 +17104,256 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace Events } // namespace EnergyEvse +namespace EnergyCalendar { +namespace Structs { + +namespace TransitionStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kTransitionTime), transitionTime); + encoder.Encode(to_underlying(Fields::kPriceTier), priceTier); + encoder.Encode(to_underlying(Fields::kFriendlyCredit), friendlyCredit); + encoder.Encode(to_underlying(Fields::kAuxiliaryLoad), auxiliaryLoad); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kTransitionTime)) + { + err = DataModel::Decode(reader, transitionTime); + } + else if (__context_tag == to_underlying(Fields::kPriceTier)) + { + err = DataModel::Decode(reader, priceTier); + } + else if (__context_tag == to_underlying(Fields::kFriendlyCredit)) + { + err = DataModel::Decode(reader, friendlyCredit); + } + else if (__context_tag == to_underlying(Fields::kAuxiliaryLoad)) + { + err = DataModel::Decode(reader, auxiliaryLoad); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace TransitionStruct + +namespace DayStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kDate), date); + encoder.Encode(to_underlying(Fields::kDaysOfWeek), daysOfWeek); + encoder.Encode(to_underlying(Fields::kTransitions), transitions); + encoder.Encode(to_underlying(Fields::kCalendarID), calendarID); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kDate)) + { + err = DataModel::Decode(reader, date); + } + else if (__context_tag == to_underlying(Fields::kDaysOfWeek)) + { + err = DataModel::Decode(reader, daysOfWeek); + } + else if (__context_tag == to_underlying(Fields::kTransitions)) + { + err = DataModel::Decode(reader, transitions); + } + else if (__context_tag == to_underlying(Fields::kCalendarID)) + { + err = DataModel::Decode(reader, calendarID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace DayStruct + +namespace CalendarPeriodStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kStartDate), startDate); + encoder.Encode(to_underlying(Fields::kDays), days); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kStartDate)) + { + err = DataModel::Decode(reader, startDate); + } + else if (__context_tag == to_underlying(Fields::kDays)) + { + err = DataModel::Decode(reader, days); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace CalendarPeriodStruct + +namespace PeakPeriodStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kSeverity), severity); + encoder.Encode(to_underlying(Fields::kPeakPeriod), peakPeriod); + encoder.Encode(to_underlying(Fields::kStartTime), startTime); + encoder.Encode(to_underlying(Fields::kEndTime), endTime); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kSeverity)) + { + err = DataModel::Decode(reader, severity); + } + else if (__context_tag == to_underlying(Fields::kPeakPeriod)) + { + err = DataModel::Decode(reader, peakPeriod); + } + else if (__context_tag == to_underlying(Fields::kStartTime)) + { + err = DataModel::Decode(reader, startTime); + } + else if (__context_tag == to_underlying(Fields::kEndTime)) + { + err = DataModel::Decode(reader, endTime); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace PeakPeriodStruct +} // namespace Structs + +namespace Commands {} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::CalendarID::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, calendarID); + case Attributes::Name::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, name); + case Attributes::ProviderID::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, providerID); + case Attributes::EventID::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventID); + case Attributes::StartDate::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, startDate); + case Attributes::CalendarPeriods::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, calendarPeriods); + case Attributes::SpecialDays::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, specialDays); + case Attributes::CurrentDay::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, currentDay); + case Attributes::NextDay::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, nextDay); + case Attributes::CurrentTransition::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, currentTransition); + case Attributes::CurrentPeakPeriod::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, currentPeakPeriod); + case Attributes::NextPeakPeriod::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, nextPeakPeriod); + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::EventList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventList); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, attributeList); + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, featureMap); + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, clusterRevision); + default: + return CHIP_NO_ERROR; + } +} +} // namespace Attributes + +namespace Events {} // namespace Events + +} // namespace EnergyCalendar namespace EnergyPreference { namespace Structs { @@ -28187,6 +28437,46 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events } // namespace ElectricalMeasurement +namespace MeterIdentification { + +namespace Commands {} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::MeterType::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, meterType); + case Attributes::UtilityName::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, utilityName); + case Attributes::PointOfDelivery::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, pointOfDelivery); + case Attributes::PowerThreshold::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, powerThreshold); + case Attributes::PowerThresholdSource::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, powerThresholdSource); + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::EventList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventList); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, attributeList); + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, featureMap); + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, clusterRevision); + default: + return CHIP_NO_ERROR; + } +} +} // namespace Attributes + +namespace Events {} // namespace Events + +} // namespace MeterIdentification namespace UnitTesting { namespace Structs { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 84f19b11e4f105..e2f2d717375d74 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -23671,6 +23671,358 @@ struct DecodableType } // namespace Rfid } // namespace Events } // namespace EnergyEvse +namespace EnergyCalendar { +namespace Structs { +namespace TransitionStruct { +enum class Fields : uint8_t +{ + kTransitionTime = 0, + kPriceTier = 1, + kFriendlyCredit = 2, + kAuxiliaryLoad = 3, +}; + +struct Type +{ +public: + uint16_t transitionTime = static_cast(0); + Optional priceTier; + Optional friendlyCredit; + Optional> auxiliaryLoad; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace TransitionStruct +namespace DayStruct { +enum class Fields : uint8_t +{ + kDate = 0, + kDaysOfWeek = 1, + kTransitions = 2, + kCalendarID = 3, +}; + +struct Type +{ +public: + Optional date; + Optional> daysOfWeek; + DataModel::List transitions; + Optional calendarID; + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + Optional date; + Optional> daysOfWeek; + DataModel::DecodableList transitions; + Optional calendarID; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; +}; + +} // namespace DayStruct +namespace CalendarPeriodStruct { +enum class Fields : uint8_t +{ + kStartDate = 0, + kDays = 1, +}; + +struct Type +{ +public: + DataModel::Nullable startDate; + DataModel::List days; + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + DataModel::Nullable startDate; + DataModel::DecodableList days; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; +}; + +} // namespace CalendarPeriodStruct +namespace PeakPeriodStruct { +enum class Fields : uint8_t +{ + kSeverity = 0, + kPeakPeriod = 1, + kStartTime = 2, + kEndTime = 3, +}; + +struct Type +{ +public: + PeakPeriodSeverityEnum severity = static_cast(0); + uint16_t peakPeriod = static_cast(0); + DataModel::Nullable startTime; + DataModel::Nullable endTime; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace PeakPeriodStruct +} // namespace Structs + +namespace Attributes { + +namespace CalendarID { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyCalendar::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CalendarID::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CalendarID +namespace Name { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyCalendar::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::Name::Id; } + static constexpr bool MustUseTimedWrite() { return false; } + static constexpr size_t MaxLength() { return 12; } +}; +} // namespace Name +namespace ProviderID { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyCalendar::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ProviderID::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ProviderID +namespace EventID { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyCalendar::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::EventID::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace EventID +namespace StartDate { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyCalendar::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::StartDate::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace StartDate +namespace CalendarPeriods { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable< + chip::app::DataModel::List>; + using DecodableType = chip::app::DataModel::Nullable< + chip::app::DataModel::DecodableList>; + using DecodableArgType = const chip::app::DataModel::Nullable< + chip::app::DataModel::DecodableList> &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyCalendar::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CalendarPeriods::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CalendarPeriods +namespace SpecialDays { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable< + chip::app::DataModel::List>; + using DecodableType = chip::app::DataModel::Nullable< + chip::app::DataModel::DecodableList>; + using DecodableArgType = const chip::app::DataModel::Nullable< + chip::app::DataModel::DecodableList> &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyCalendar::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SpecialDays::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SpecialDays +namespace CurrentDay { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = + const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyCalendar::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CurrentDay::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CurrentDay +namespace NextDay { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = + const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyCalendar::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NextDay::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace NextDay +namespace CurrentTransition { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = + chip::app::DataModel::Nullable; + using DecodableArgType = + const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyCalendar::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CurrentTransition::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CurrentTransition +namespace CurrentPeakPeriod { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = + chip::app::DataModel::Nullable; + using DecodableArgType = + const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyCalendar::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CurrentPeakPeriod::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CurrentPeakPeriod +namespace NextPeakPeriod { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = + chip::app::DataModel::Nullable; + using DecodableArgType = + const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyCalendar::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NextPeakPeriod::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace NextPeakPeriod +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::EnergyCalendar::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::EnergyCalendar::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::EnergyCalendar::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::EnergyCalendar::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::EnergyCalendar::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::EnergyCalendar::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::EnergyCalendar::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::CalendarID::TypeInfo::DecodableType calendarID; + Attributes::Name::TypeInfo::DecodableType name; + Attributes::ProviderID::TypeInfo::DecodableType providerID; + Attributes::EventID::TypeInfo::DecodableType eventID; + Attributes::StartDate::TypeInfo::DecodableType startDate; + Attributes::CalendarPeriods::TypeInfo::DecodableType calendarPeriods; + Attributes::SpecialDays::TypeInfo::DecodableType specialDays; + Attributes::CurrentDay::TypeInfo::DecodableType currentDay; + Attributes::NextDay::TypeInfo::DecodableType nextDay; + Attributes::CurrentTransition::TypeInfo::DecodableType currentTransition; + Attributes::CurrentPeakPeriod::TypeInfo::DecodableType currentPeakPeriod; + Attributes::NextPeakPeriod::TypeInfo::DecodableType nextPeakPeriod; + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::EventList::TypeInfo::DecodableType eventList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + }; +}; +} // namespace Attributes +} // namespace EnergyCalendar namespace EnergyPreference { namespace Structs { namespace BalanceStruct { @@ -42605,6 +42957,133 @@ struct TypeInfo }; } // namespace Attributes } // namespace ElectricalMeasurement +namespace MeterIdentification { + +namespace Attributes { + +namespace MeterType { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MeterType::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MeterType +namespace UtilityName { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::UtilityName::Id; } + static constexpr bool MustUseTimedWrite() { return false; } + static constexpr size_t MaxLength() { return 16; } +}; +} // namespace UtilityName +namespace PointOfDelivery { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::PointOfDelivery::Id; } + static constexpr bool MustUseTimedWrite() { return false; } + static constexpr size_t MaxLength() { return 16; } +}; +} // namespace PointOfDelivery +namespace PowerThreshold { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::PowerThreshold::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace PowerThreshold +namespace PowerThresholdSource { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = + const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::PowerThresholdSource::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace PowerThresholdSource +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::MeterType::TypeInfo::DecodableType meterType; + Attributes::UtilityName::TypeInfo::DecodableType utilityName; + Attributes::PointOfDelivery::TypeInfo::DecodableType pointOfDelivery; + Attributes::PowerThreshold::TypeInfo::DecodableType powerThreshold; + Attributes::PowerThresholdSource::TypeInfo::DecodableType powerThresholdSource; + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::EventList::TypeInfo::DecodableType eventList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + }; +}; +} // namespace Attributes +} // namespace MeterIdentification namespace UnitTesting { namespace Structs { namespace SimpleStruct { 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 03ddaed214890c..4d3cd2a5fa6390 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 @@ -4085,6 +4085,84 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace EnergyEvse +namespace EnergyCalendar { +namespace Attributes { + +namespace CalendarID { +static constexpr AttributeId Id = 0x00000000; +} // namespace CalendarID + +namespace Name { +static constexpr AttributeId Id = 0x00000001; +} // namespace Name + +namespace ProviderID { +static constexpr AttributeId Id = 0x00000002; +} // namespace ProviderID + +namespace EventID { +static constexpr AttributeId Id = 0x00000003; +} // namespace EventID + +namespace StartDate { +static constexpr AttributeId Id = 0x00000004; +} // namespace StartDate + +namespace CalendarPeriods { +static constexpr AttributeId Id = 0x00000005; +} // namespace CalendarPeriods + +namespace SpecialDays { +static constexpr AttributeId Id = 0x00000006; +} // namespace SpecialDays + +namespace CurrentDay { +static constexpr AttributeId Id = 0x00000007; +} // namespace CurrentDay + +namespace NextDay { +static constexpr AttributeId Id = 0x00000008; +} // namespace NextDay + +namespace CurrentTransition { +static constexpr AttributeId Id = 0x00000009; +} // namespace CurrentTransition + +namespace CurrentPeakPeriod { +static constexpr AttributeId Id = 0x0000000A; +} // namespace CurrentPeakPeriod + +namespace NextPeakPeriod { +static constexpr AttributeId Id = 0x0000000B; +} // namespace NextPeakPeriod + +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 EnergyCalendar + namespace EnergyPreference { namespace Attributes { @@ -7893,6 +7971,56 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace ElectricalMeasurement +namespace MeterIdentification { +namespace Attributes { + +namespace MeterType { +static constexpr AttributeId Id = 0x00000000; +} // namespace MeterType + +namespace UtilityName { +static constexpr AttributeId Id = 0x00000001; +} // namespace UtilityName + +namespace PointOfDelivery { +static constexpr AttributeId Id = 0x00000002; +} // namespace PointOfDelivery + +namespace PowerThreshold { +static constexpr AttributeId Id = 0x00000003; +} // namespace PowerThreshold + +namespace PowerThresholdSource { +static constexpr AttributeId Id = 0x00000004; +} // namespace PowerThresholdSource + +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 MeterIdentification + namespace UnitTesting { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index eab334c8ce3a29..aef151c415ad88 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -238,6 +238,9 @@ static constexpr ClusterId Id = 0x00000098; namespace EnergyEvse { static constexpr ClusterId Id = 0x00000099; } // namespace EnergyEvse +namespace EnergyCalendar { +static constexpr ClusterId Id = 0x0000009A; +} // namespace EnergyCalendar namespace EnergyPreference { static constexpr ClusterId Id = 0x0000009B; } // namespace EnergyPreference @@ -382,6 +385,9 @@ static constexpr ClusterId Id = 0x00000510; namespace ElectricalMeasurement { static constexpr ClusterId Id = 0x00000B04; } // namespace ElectricalMeasurement +namespace MeterIdentification { +static constexpr ClusterId Id = 0x00000B06; +} // namespace MeterIdentification namespace UnitTesting { static constexpr ClusterId Id = 0xFFF1FC05; } // namespace UnitTesting diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 2cdd59a303bb63..07bb95e38489c5 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -106,6 +106,7 @@ | Messages | 0x0097 | | DeviceEnergyManagement | 0x0098 | | EnergyEvse | 0x0099 | +| EnergyCalendar | 0x009A | | EnergyPreference | 0x009B | | PowerTopology | 0x009C | | EnergyEvseMode | 0x009D | @@ -154,6 +155,7 @@ | ContentControl | 0x050F | | ContentAppObserver | 0x0510 | | ElectricalMeasurement | 0x0B04 | +| MeterIdentification | 0x0B06 | | UnitTesting | 0xFFF1FC05| | FaultInjection | 0xFFF1FC06| | SampleMei | 0xFFF1FC20| @@ -7584,6 +7586,34 @@ class EnergyEvseClearTargets : public ClusterCommand chip::app::Clusters::EnergyEvse::Commands::ClearTargets::Type mRequest; }; +/*----------------------------------------------------------------------------*\ +| Cluster EnergyCalendar | 0x009A | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * CalendarID | 0x0000 | +| * Name | 0x0001 | +| * ProviderID | 0x0002 | +| * EventID | 0x0003 | +| * StartDate | 0x0004 | +| * CalendarPeriods | 0x0005 | +| * SpecialDays | 0x0006 | +| * CurrentDay | 0x0007 | +| * NextDay | 0x0008 | +| * CurrentTransition | 0x0009 | +| * CurrentPeakPeriod | 0x000A | +| * NextPeakPeriod | 0x000B | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + /*----------------------------------------------------------------------------*\ | Cluster EnergyPreference | 0x009B | |------------------------------------------------------------------------------| @@ -13874,6 +13904,27 @@ class ElectricalMeasurementGetMeasurementProfileCommand : public ClusterCommand chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileCommand::Type mRequest; }; +/*----------------------------------------------------------------------------*\ +| Cluster MeterIdentification | 0x0B06 | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * MeterType | 0x0000 | +| * UtilityName | 0x0001 | +| * PointOfDelivery | 0x0002 | +| * PowerThreshold | 0x0003 | +| * PowerThresholdSource | 0x0004 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + /*----------------------------------------------------------------------------*\ | Cluster UnitTesting | 0xFFF1FC05 | |------------------------------------------------------------------------------| @@ -21324,6 +21375,112 @@ void registerClusterEnergyEvse(Commands & commands, CredentialIssuerCommands * c commands.RegisterCluster(clusterName, clusterCommands); } +void registerClusterEnergyCalendar(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::EnergyCalendar; + + const char * clusterName = "EnergyCalendar"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "calendar-id", Attributes::CalendarID::Id, credsIssuerConfig), // + make_unique(Id, "name", Attributes::Name::Id, credsIssuerConfig), // + make_unique(Id, "provider-id", Attributes::ProviderID::Id, credsIssuerConfig), // + make_unique(Id, "event-id", Attributes::EventID::Id, credsIssuerConfig), // + make_unique(Id, "start-date", Attributes::StartDate::Id, credsIssuerConfig), // + make_unique(Id, "calendar-periods", Attributes::CalendarPeriods::Id, credsIssuerConfig), // + make_unique(Id, "special-days", Attributes::SpecialDays::Id, credsIssuerConfig), // + make_unique(Id, "current-day", Attributes::CurrentDay::Id, credsIssuerConfig), // + make_unique(Id, "next-day", Attributes::NextDay::Id, credsIssuerConfig), // + make_unique(Id, "current-transition", Attributes::CurrentTransition::Id, credsIssuerConfig), // + make_unique(Id, "current-peak-period", Attributes::CurrentPeakPeriod::Id, credsIssuerConfig), // + make_unique(Id, "next-peak-period", Attributes::NextPeakPeriod::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique>(Id, credsIssuerConfig), // + make_unique>>( + Id, "calendar-id", 0, UINT32_MAX, Attributes::CalendarID::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "name", Attributes::Name::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "provider-id", 0, UINT32_MAX, Attributes::ProviderID::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "event-id", 0, UINT32_MAX, Attributes::EventID::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "start-date", 0, UINT32_MAX, Attributes::StartDate::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>>( + Id, "calendar-periods", Attributes::CalendarPeriods::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>>( + Id, "special-days", Attributes::SpecialDays::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique< + WriteAttributeAsComplex>>( + Id, "current-day", Attributes::CurrentDay::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique< + WriteAttributeAsComplex>>( + Id, "next-day", Attributes::NextDay::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "current-transition", Attributes::CurrentTransition::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "current-peak-period", Attributes::CurrentPeakPeriod::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "next-peak-period", Attributes::NextPeakPeriod::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "calendar-id", Attributes::CalendarID::Id, credsIssuerConfig), // + make_unique(Id, "name", Attributes::Name::Id, credsIssuerConfig), // + make_unique(Id, "provider-id", Attributes::ProviderID::Id, credsIssuerConfig), // + make_unique(Id, "event-id", Attributes::EventID::Id, credsIssuerConfig), // + make_unique(Id, "start-date", Attributes::StartDate::Id, credsIssuerConfig), // + make_unique(Id, "calendar-periods", Attributes::CalendarPeriods::Id, credsIssuerConfig), // + make_unique(Id, "special-days", Attributes::SpecialDays::Id, credsIssuerConfig), // + make_unique(Id, "current-day", Attributes::CurrentDay::Id, credsIssuerConfig), // + make_unique(Id, "next-day", Attributes::NextDay::Id, credsIssuerConfig), // + make_unique(Id, "current-transition", Attributes::CurrentTransition::Id, credsIssuerConfig), // + make_unique(Id, "current-peak-period", Attributes::CurrentPeakPeriod::Id, credsIssuerConfig), // + make_unique(Id, "next-peak-period", Attributes::NextPeakPeriod::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +} void registerClusterEnergyPreference(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::EnergyPreference; @@ -26936,6 +27093,80 @@ void registerClusterElectricalMeasurement(Commands & commands, CredentialIssuerC commands.RegisterCluster(clusterName, clusterCommands); } +void registerClusterMeterIdentification(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::MeterIdentification; + + const char * clusterName = "MeterIdentification"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "meter-type", Attributes::MeterType::Id, credsIssuerConfig), // + make_unique(Id, "utility-name", Attributes::UtilityName::Id, credsIssuerConfig), // + make_unique(Id, "point-of-delivery", Attributes::PointOfDelivery::Id, credsIssuerConfig), // + make_unique(Id, "power-threshold", Attributes::PowerThreshold::Id, credsIssuerConfig), // + make_unique(Id, "power-threshold-source", Attributes::PowerThresholdSource::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique>(Id, credsIssuerConfig), // + make_unique>>( + Id, "meter-type", 0, UINT8_MAX, Attributes::MeterType::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "utility-name", Attributes::UtilityName::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "point-of-delivery", Attributes::PointOfDelivery::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>(Id, "power-threshold", INT64_MIN, INT64_MAX, + Attributes::PowerThreshold::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique< + WriteAttribute>>( + Id, "power-threshold-source", 0, UINT8_MAX, Attributes::PowerThresholdSource::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "meter-type", Attributes::MeterType::Id, credsIssuerConfig), // + make_unique(Id, "utility-name", Attributes::UtilityName::Id, credsIssuerConfig), // + make_unique(Id, "point-of-delivery", Attributes::PointOfDelivery::Id, credsIssuerConfig), // + make_unique(Id, "power-threshold", Attributes::PowerThreshold::Id, credsIssuerConfig), // + make_unique(Id, "power-threshold-source", Attributes::PowerThresholdSource::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +} void registerClusterUnitTesting(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::UnitTesting; @@ -27600,6 +27831,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterMessages(commands, credsIssuerConfig); registerClusterDeviceEnergyManagement(commands, credsIssuerConfig); registerClusterEnergyEvse(commands, credsIssuerConfig); + registerClusterEnergyCalendar(commands, credsIssuerConfig); registerClusterEnergyPreference(commands, credsIssuerConfig); registerClusterPowerTopology(commands, credsIssuerConfig); registerClusterEnergyEvseMode(commands, credsIssuerConfig); @@ -27648,6 +27880,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterContentControl(commands, credsIssuerConfig); registerClusterContentAppObserver(commands, credsIssuerConfig); registerClusterElectricalMeasurement(commands, credsIssuerConfig); + registerClusterMeterIdentification(commands, credsIssuerConfig); registerClusterUnitTesting(commands, credsIssuerConfig); registerClusterFaultInjection(commands, credsIssuerConfig); registerClusterSampleMei(commands, credsIssuerConfig); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index 6a73b61ce13720..81396de5956725 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -3627,6 +3627,180 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::EnergyEvse::Structs::C ComplexArgumentParser::Finalize(request.chargingTargets); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::EnergyCalendar::Structs::TransitionStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TransitionStruct.transitionTime", "transitionTime", + value.isMember("transitionTime"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "transitionTime"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.transitionTime, value["transitionTime"])); + valueCopy.removeMember("transitionTime"); + + if (value.isMember("priceTier")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "priceTier"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.priceTier, value["priceTier"])); + } + valueCopy.removeMember("priceTier"); + + if (value.isMember("friendlyCredit")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "friendlyCredit"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.friendlyCredit, value["friendlyCredit"])); + } + valueCopy.removeMember("friendlyCredit"); + + if (value.isMember("auxiliaryLoad")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "auxiliaryLoad"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.auxiliaryLoad, value["auxiliaryLoad"])); + } + valueCopy.removeMember("auxiliaryLoad"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::EnergyCalendar::Structs::TransitionStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.transitionTime); + ComplexArgumentParser::Finalize(request.priceTier); + ComplexArgumentParser::Finalize(request.friendlyCredit); + ComplexArgumentParser::Finalize(request.auxiliaryLoad); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::EnergyCalendar::Structs::DayStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("DayStruct.transitions", "transitions", value.isMember("transitions"))); + + char labelWithMember[kMaxLabelLength]; + if (value.isMember("date")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "date"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.date, value["date"])); + } + valueCopy.removeMember("date"); + + if (value.isMember("daysOfWeek")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "daysOfWeek"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.daysOfWeek, value["daysOfWeek"])); + } + valueCopy.removeMember("daysOfWeek"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "transitions"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.transitions, value["transitions"])); + valueCopy.removeMember("transitions"); + + if (value.isMember("calendarID")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "calendarID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.calendarID, value["calendarID"])); + } + valueCopy.removeMember("calendarID"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::EnergyCalendar::Structs::DayStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.date); + ComplexArgumentParser::Finalize(request.daysOfWeek); + ComplexArgumentParser::Finalize(request.transitions); + ComplexArgumentParser::Finalize(request.calendarID); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::EnergyCalendar::Structs::CalendarPeriodStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("CalendarPeriodStruct.startDate", "startDate", value.isMember("startDate"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("CalendarPeriodStruct.days", "days", value.isMember("days"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "startDate"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.startDate, value["startDate"])); + valueCopy.removeMember("startDate"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "days"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.days, value["days"])); + valueCopy.removeMember("days"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::EnergyCalendar::Structs::CalendarPeriodStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.startDate); + ComplexArgumentParser::Finalize(request.days); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::EnergyCalendar::Structs::PeakPeriodStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("PeakPeriodStruct.severity", "severity", value.isMember("severity"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("PeakPeriodStruct.peakPeriod", "peakPeriod", value.isMember("peakPeriod"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("PeakPeriodStruct.startTime", "startTime", value.isMember("startTime"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("PeakPeriodStruct.endTime", "endTime", value.isMember("endTime"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "severity"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.severity, value["severity"])); + valueCopy.removeMember("severity"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "peakPeriod"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.peakPeriod, value["peakPeriod"])); + valueCopy.removeMember("peakPeriod"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "startTime"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.startTime, value["startTime"])); + valueCopy.removeMember("startTime"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "endTime"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.endTime, value["endTime"])); + valueCopy.removeMember("endTime"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::EnergyCalendar::Structs::PeakPeriodStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.severity); + ComplexArgumentParser::Finalize(request.peakPeriod); + ComplexArgumentParser::Finalize(request.startTime); + ComplexArgumentParser::Finalize(request.endTime); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::EnergyPreference::Structs::BalanceStruct::Type & request, Json::Value & value) diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index 4d7544b92daa32..72d05161b750d1 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -415,6 +415,26 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::EnergyEvse::Str static void Finalize(chip::app::Clusters::EnergyEvse::Structs::ChargingTargetScheduleStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::EnergyCalendar::Structs::TransitionStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::EnergyCalendar::Structs::TransitionStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::EnergyCalendar::Structs::DayStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::EnergyCalendar::Structs::DayStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::EnergyCalendar::Structs::CalendarPeriodStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::EnergyCalendar::Structs::CalendarPeriodStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::EnergyCalendar::Structs::PeakPeriodStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::EnergyCalendar::Structs::PeakPeriodStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::EnergyPreference::Structs::BalanceStruct::Type & request, Json::Value & value); 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 a9d3f942abcd7c..97499c25b7fbc4 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -3215,6 +3215,155 @@ DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::EnergyCalendar::Structs::TransitionStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("TransitionTime", indent + 1, value.transitionTime); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'TransitionTime'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("PriceTier", indent + 1, value.priceTier); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'PriceTier'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("FriendlyCredit", indent + 1, value.friendlyCredit); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FriendlyCredit'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("AuxiliaryLoad", indent + 1, value.auxiliaryLoad); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'AuxiliaryLoad'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::EnergyCalendar::Structs::DayStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("Date", indent + 1, value.date); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Date'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("DaysOfWeek", indent + 1, value.daysOfWeek); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DaysOfWeek'"); + 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; + } + } + { + CHIP_ERROR err = LogValue("CalendarID", indent + 1, value.calendarID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'CalendarID'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::EnergyCalendar::Structs::CalendarPeriodStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("StartDate", indent + 1, value.startDate); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'StartDate'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Days", indent + 1, value.days); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Days'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::EnergyCalendar::Structs::PeakPeriodStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("Severity", indent + 1, value.severity); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Severity'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("PeakPeriod", indent + 1, value.peakPeriod); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'PeakPeriod'"); + 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("EndTime", indent + 1, value.endTime); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'EndTime'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::EnergyPreference::Structs::BalanceStruct::DecodableType & value) { @@ -13306,6 +13455,106 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case EnergyCalendar::Id: { + switch (path.mAttributeId) + { + case EnergyCalendar::Attributes::CalendarID::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CalendarID", 1, value); + } + case EnergyCalendar::Attributes::Name::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("Name", 1, value); + } + case EnergyCalendar::Attributes::ProviderID::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ProviderID", 1, value); + } + case EnergyCalendar::Attributes::EventID::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventID", 1, value); + } + case EnergyCalendar::Attributes::StartDate::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("StartDate", 1, value); + } + case EnergyCalendar::Attributes::CalendarPeriods::Id: { + chip::app::DataModel::Nullable> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CalendarPeriods", 1, value); + } + case EnergyCalendar::Attributes::SpecialDays::Id: { + chip::app::DataModel::Nullable< + chip::app::DataModel::DecodableList> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SpecialDays", 1, value); + } + case EnergyCalendar::Attributes::CurrentDay::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CurrentDay", 1, value); + } + case EnergyCalendar::Attributes::NextDay::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("NextDay", 1, value); + } + case EnergyCalendar::Attributes::CurrentTransition::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CurrentTransition", 1, value); + } + case EnergyCalendar::Attributes::CurrentPeakPeriod::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CurrentPeakPeriod", 1, value); + } + case EnergyCalendar::Attributes::NextPeakPeriod::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("NextPeakPeriod", 1, value); + } + case EnergyCalendar::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + } + case EnergyCalendar::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + } + case EnergyCalendar::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventList", 1, value); + } + case EnergyCalendar::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AttributeList", 1, value); + } + case EnergyCalendar::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case EnergyCalendar::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } case EnergyPreference::Id: { switch (path.mAttributeId) { @@ -18012,6 +18261,67 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case MeterIdentification::Id: { + switch (path.mAttributeId) + { + case MeterIdentification::Attributes::MeterType::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MeterType", 1, value); + } + case MeterIdentification::Attributes::UtilityName::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("UtilityName", 1, value); + } + case MeterIdentification::Attributes::PointOfDelivery::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PointOfDelivery", 1, value); + } + case MeterIdentification::Attributes::PowerThreshold::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PowerThreshold", 1, value); + } + case MeterIdentification::Attributes::PowerThresholdSource::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PowerThresholdSource", 1, value); + } + case MeterIdentification::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + } + case MeterIdentification::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + } + case MeterIdentification::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventList", 1, value); + } + case MeterIdentification::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AttributeList", 1, value); + } + case MeterIdentification::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case MeterIdentification::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } case UnitTesting::Id: { switch (path.mAttributeId) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index ab1040c7069e3b..55b894d39dad2b 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -261,6 +261,18 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::EnergyEvse::Structs::ChargingTargetScheduleStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::EnergyCalendar::Structs::TransitionStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::EnergyCalendar::Structs::DayStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::EnergyCalendar::Structs::CalendarPeriodStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::EnergyCalendar::Structs::PeakPeriodStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::EnergyPreference::Structs::BalanceStruct::DecodableType & value); diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index dfac8e499e1449..c5cd13170a8a05 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -108,6 +108,7 @@ | Messages | 0x0097 | | DeviceEnergyManagement | 0x0098 | | EnergyEvse | 0x0099 | +| EnergyCalendar | 0x009A | | EnergyPreference | 0x009B | | PowerTopology | 0x009C | | EnergyEvseMode | 0x009D | @@ -156,6 +157,7 @@ | ContentControl | 0x050F | | ContentAppObserver | 0x0510 | | ElectricalMeasurement | 0x0B04 | +| MeterIdentification | 0x0B06 | | UnitTesting | 0xFFF1FC05| | FaultInjection | 0xFFF1FC06| | SampleMei | 0xFFF1FC20| @@ -86298,6 +86300,1566 @@ class SubscribeAttributeEnergyEvseClusterRevision : public SubscribeAttribute { } }; +#endif // MTR_ENABLE_PROVISIONAL +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/*----------------------------------------------------------------------------*\ +| Cluster EnergyCalendar | 0x009A | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * CalendarID | 0x0000 | +| * Name | 0x0001 | +| * ProviderID | 0x0002 | +| * EventID | 0x0003 | +| * StartDate | 0x0004 | +| * CalendarPeriods | 0x0005 | +| * SpecialDays | 0x0006 | +| * CurrentDay | 0x0007 | +| * NextDay | 0x0008 | +| * CurrentTransition | 0x0009 | +| * CurrentPeakPeriod | 0x000A | +| * NextPeakPeriod | 0x000B | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute CalendarID + */ +class ReadEnergyCalendarCalendarID : public ReadAttribute { +public: + ReadEnergyCalendarCalendarID() + : ReadAttribute("calendar-id") + { + } + + ~ReadEnergyCalendarCalendarID() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::CalendarID::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeCalendarIDWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.CalendarID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyCalendar CalendarID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyCalendarCalendarID : public SubscribeAttribute { +public: + SubscribeAttributeEnergyCalendarCalendarID() + : SubscribeAttribute("calendar-id") + { + } + + ~SubscribeAttributeEnergyCalendarCalendarID() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::CalendarID::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeCalendarIDWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.CalendarID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute Name + */ +class ReadEnergyCalendarName : public ReadAttribute { +public: + ReadEnergyCalendarName() + : ReadAttribute("name") + { + } + + ~ReadEnergyCalendarName() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::Name::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeNameWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.Name response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyCalendar Name read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyCalendarName : public SubscribeAttribute { +public: + SubscribeAttributeEnergyCalendarName() + : SubscribeAttribute("name") + { + } + + ~SubscribeAttributeEnergyCalendarName() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::Name::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeNameWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.Name response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ProviderID + */ +class ReadEnergyCalendarProviderID : public ReadAttribute { +public: + ReadEnergyCalendarProviderID() + : ReadAttribute("provider-id") + { + } + + ~ReadEnergyCalendarProviderID() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::ProviderID::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeProviderIDWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.ProviderID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyCalendar ProviderID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyCalendarProviderID : public SubscribeAttribute { +public: + SubscribeAttributeEnergyCalendarProviderID() + : SubscribeAttribute("provider-id") + { + } + + ~SubscribeAttributeEnergyCalendarProviderID() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::ProviderID::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeProviderIDWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.ProviderID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute EventID + */ +class ReadEnergyCalendarEventID : public ReadAttribute { +public: + ReadEnergyCalendarEventID() + : ReadAttribute("event-id") + { + } + + ~ReadEnergyCalendarEventID() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::EventID::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeEventIDWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.EventID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyCalendar EventID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyCalendarEventID : public SubscribeAttribute { +public: + SubscribeAttributeEnergyCalendarEventID() + : SubscribeAttribute("event-id") + { + } + + ~SubscribeAttributeEnergyCalendarEventID() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::EventID::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeEventIDWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.EventID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute StartDate + */ +class ReadEnergyCalendarStartDate : public ReadAttribute { +public: + ReadEnergyCalendarStartDate() + : ReadAttribute("start-date") + { + } + + ~ReadEnergyCalendarStartDate() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::StartDate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeStartDateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.StartDate response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyCalendar StartDate read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyCalendarStartDate : public SubscribeAttribute { +public: + SubscribeAttributeEnergyCalendarStartDate() + : SubscribeAttribute("start-date") + { + } + + ~SubscribeAttributeEnergyCalendarStartDate() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::StartDate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeStartDateWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.StartDate response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute CalendarPeriods + */ +class ReadEnergyCalendarCalendarPeriods : public ReadAttribute { +public: + ReadEnergyCalendarCalendarPeriods() + : ReadAttribute("calendar-periods") + { + } + + ~ReadEnergyCalendarCalendarPeriods() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::CalendarPeriods::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeCalendarPeriodsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.CalendarPeriods response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyCalendar CalendarPeriods read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyCalendarCalendarPeriods : public SubscribeAttribute { +public: + SubscribeAttributeEnergyCalendarCalendarPeriods() + : SubscribeAttribute("calendar-periods") + { + } + + ~SubscribeAttributeEnergyCalendarCalendarPeriods() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::CalendarPeriods::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeCalendarPeriodsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.CalendarPeriods response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute SpecialDays + */ +class ReadEnergyCalendarSpecialDays : public ReadAttribute { +public: + ReadEnergyCalendarSpecialDays() + : ReadAttribute("special-days") + { + } + + ~ReadEnergyCalendarSpecialDays() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::SpecialDays::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSpecialDaysWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.SpecialDays response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyCalendar SpecialDays read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyCalendarSpecialDays : public SubscribeAttribute { +public: + SubscribeAttributeEnergyCalendarSpecialDays() + : SubscribeAttribute("special-days") + { + } + + ~SubscribeAttributeEnergyCalendarSpecialDays() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::SpecialDays::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeSpecialDaysWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.SpecialDays response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute CurrentDay + */ +class ReadEnergyCalendarCurrentDay : public ReadAttribute { +public: + ReadEnergyCalendarCurrentDay() + : ReadAttribute("current-day") + { + } + + ~ReadEnergyCalendarCurrentDay() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::CurrentDay::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeCurrentDayWithCompletion:^(MTREnergyCalendarClusterDayStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.CurrentDay response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyCalendar CurrentDay read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyCalendarCurrentDay : public SubscribeAttribute { +public: + SubscribeAttributeEnergyCalendarCurrentDay() + : SubscribeAttribute("current-day") + { + } + + ~SubscribeAttributeEnergyCalendarCurrentDay() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::CurrentDay::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeCurrentDayWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTREnergyCalendarClusterDayStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.CurrentDay response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute NextDay + */ +class ReadEnergyCalendarNextDay : public ReadAttribute { +public: + ReadEnergyCalendarNextDay() + : ReadAttribute("next-day") + { + } + + ~ReadEnergyCalendarNextDay() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::NextDay::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeNextDayWithCompletion:^(MTREnergyCalendarClusterDayStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.NextDay response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyCalendar NextDay read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyCalendarNextDay : public SubscribeAttribute { +public: + SubscribeAttributeEnergyCalendarNextDay() + : SubscribeAttribute("next-day") + { + } + + ~SubscribeAttributeEnergyCalendarNextDay() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::NextDay::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeNextDayWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTREnergyCalendarClusterDayStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.NextDay response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute CurrentTransition + */ +class ReadEnergyCalendarCurrentTransition : public ReadAttribute { +public: + ReadEnergyCalendarCurrentTransition() + : ReadAttribute("current-transition") + { + } + + ~ReadEnergyCalendarCurrentTransition() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::CurrentTransition::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeCurrentTransitionWithCompletion:^(MTREnergyCalendarClusterTransitionStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.CurrentTransition response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyCalendar CurrentTransition read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyCalendarCurrentTransition : public SubscribeAttribute { +public: + SubscribeAttributeEnergyCalendarCurrentTransition() + : SubscribeAttribute("current-transition") + { + } + + ~SubscribeAttributeEnergyCalendarCurrentTransition() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::CurrentTransition::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeCurrentTransitionWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTREnergyCalendarClusterTransitionStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.CurrentTransition response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute CurrentPeakPeriod + */ +class ReadEnergyCalendarCurrentPeakPeriod : public ReadAttribute { +public: + ReadEnergyCalendarCurrentPeakPeriod() + : ReadAttribute("current-peak-period") + { + } + + ~ReadEnergyCalendarCurrentPeakPeriod() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::CurrentPeakPeriod::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeCurrentPeakPeriodWithCompletion:^(MTREnergyCalendarClusterPeakPeriodStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.CurrentPeakPeriod response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyCalendar CurrentPeakPeriod read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyCalendarCurrentPeakPeriod : public SubscribeAttribute { +public: + SubscribeAttributeEnergyCalendarCurrentPeakPeriod() + : SubscribeAttribute("current-peak-period") + { + } + + ~SubscribeAttributeEnergyCalendarCurrentPeakPeriod() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::CurrentPeakPeriod::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeCurrentPeakPeriodWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTREnergyCalendarClusterPeakPeriodStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.CurrentPeakPeriod response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute NextPeakPeriod + */ +class ReadEnergyCalendarNextPeakPeriod : public ReadAttribute { +public: + ReadEnergyCalendarNextPeakPeriod() + : ReadAttribute("next-peak-period") + { + } + + ~ReadEnergyCalendarNextPeakPeriod() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::NextPeakPeriod::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeNextPeakPeriodWithCompletion:^(MTREnergyCalendarClusterPeakPeriodStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.NextPeakPeriod response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyCalendar NextPeakPeriod read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyCalendarNextPeakPeriod : public SubscribeAttribute { +public: + SubscribeAttributeEnergyCalendarNextPeakPeriod() + : SubscribeAttribute("next-peak-period") + { + } + + ~SubscribeAttributeEnergyCalendarNextPeakPeriod() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::NextPeakPeriod::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeNextPeakPeriodWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTREnergyCalendarClusterPeakPeriodStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.NextPeakPeriod response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute GeneratedCommandList + */ +class ReadEnergyCalendarGeneratedCommandList : public ReadAttribute { +public: + ReadEnergyCalendarGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadEnergyCalendarGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyCalendar GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyCalendarGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeEnergyCalendarGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeEnergyCalendarGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeGeneratedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AcceptedCommandList + */ +class ReadEnergyCalendarAcceptedCommandList : public ReadAttribute { +public: + ReadEnergyCalendarAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadEnergyCalendarAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyCalendar AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyCalendarAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeEnergyCalendarAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeEnergyCalendarAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAcceptedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute EventList + */ +class ReadEnergyCalendarEventList : public ReadAttribute { +public: + ReadEnergyCalendarEventList() + : ReadAttribute("event-list") + { + } + + ~ReadEnergyCalendarEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyCalendar EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyCalendarEventList : public SubscribeAttribute { +public: + SubscribeAttributeEnergyCalendarEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeEnergyCalendarEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeEventListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AttributeList + */ +class ReadEnergyCalendarAttributeList : public ReadAttribute { +public: + ReadEnergyCalendarAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadEnergyCalendarAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyCalendar AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyCalendarAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeEnergyCalendarAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeEnergyCalendarAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAttributeListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute FeatureMap + */ +class ReadEnergyCalendarFeatureMap : public ReadAttribute { +public: + ReadEnergyCalendarFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadEnergyCalendarFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyCalendar FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyCalendarFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeEnergyCalendarFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeEnergyCalendarFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeFeatureMapWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ClusterRevision + */ +class ReadEnergyCalendarClusterRevision : public ReadAttribute { +public: + ReadEnergyCalendarClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadEnergyCalendarClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyCalendar ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyCalendarClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeEnergyCalendarClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeEnergyCalendarClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyCalendar::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::EnergyCalendar::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyCalendar alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeClusterRevisionWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyCalendar.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + #endif // MTR_ENABLE_PROVISIONAL #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL @@ -172389,6 +173951,964 @@ class SubscribeAttributeElectricalMeasurementClusterRevision : public SubscribeA } }; +#if MTR_ENABLE_PROVISIONAL +/*----------------------------------------------------------------------------*\ +| Cluster MeterIdentification | 0x0B06 | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * MeterType | 0x0000 | +| * UtilityName | 0x0001 | +| * PointOfDelivery | 0x0002 | +| * PowerThreshold | 0x0003 | +| * PowerThresholdSource | 0x0004 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute MeterType + */ +class ReadMeterIdentificationMeterType : public ReadAttribute { +public: + ReadMeterIdentificationMeterType() + : ReadAttribute("meter-type") + { + } + + ~ReadMeterIdentificationMeterType() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MeterIdentification::Attributes::MeterType::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMeterTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.MeterType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MeterIdentification MeterType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMeterIdentificationMeterType : public SubscribeAttribute { +public: + SubscribeAttributeMeterIdentificationMeterType() + : SubscribeAttribute("meter-type") + { + } + + ~SubscribeAttributeMeterIdentificationMeterType() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MeterIdentification::Attributes::MeterType::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeMeterTypeWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.MeterType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute UtilityName + */ +class ReadMeterIdentificationUtilityName : public ReadAttribute { +public: + ReadMeterIdentificationUtilityName() + : ReadAttribute("utility-name") + { + } + + ~ReadMeterIdentificationUtilityName() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MeterIdentification::Attributes::UtilityName::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeUtilityNameWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.UtilityName response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MeterIdentification UtilityName read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMeterIdentificationUtilityName : public SubscribeAttribute { +public: + SubscribeAttributeMeterIdentificationUtilityName() + : SubscribeAttribute("utility-name") + { + } + + ~SubscribeAttributeMeterIdentificationUtilityName() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MeterIdentification::Attributes::UtilityName::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeUtilityNameWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.UtilityName response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute PointOfDelivery + */ +class ReadMeterIdentificationPointOfDelivery : public ReadAttribute { +public: + ReadMeterIdentificationPointOfDelivery() + : ReadAttribute("point-of-delivery") + { + } + + ~ReadMeterIdentificationPointOfDelivery() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MeterIdentification::Attributes::PointOfDelivery::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributePointOfDeliveryWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.PointOfDelivery response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MeterIdentification PointOfDelivery read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMeterIdentificationPointOfDelivery : public SubscribeAttribute { +public: + SubscribeAttributeMeterIdentificationPointOfDelivery() + : SubscribeAttribute("point-of-delivery") + { + } + + ~SubscribeAttributeMeterIdentificationPointOfDelivery() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MeterIdentification::Attributes::PointOfDelivery::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributePointOfDeliveryWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.PointOfDelivery response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute PowerThreshold + */ +class ReadMeterIdentificationPowerThreshold : public ReadAttribute { +public: + ReadMeterIdentificationPowerThreshold() + : ReadAttribute("power-threshold") + { + } + + ~ReadMeterIdentificationPowerThreshold() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MeterIdentification::Attributes::PowerThreshold::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributePowerThresholdWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.PowerThreshold response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MeterIdentification PowerThreshold read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMeterIdentificationPowerThreshold : public SubscribeAttribute { +public: + SubscribeAttributeMeterIdentificationPowerThreshold() + : SubscribeAttribute("power-threshold") + { + } + + ~SubscribeAttributeMeterIdentificationPowerThreshold() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MeterIdentification::Attributes::PowerThreshold::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributePowerThresholdWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.PowerThreshold response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute PowerThresholdSource + */ +class ReadMeterIdentificationPowerThresholdSource : public ReadAttribute { +public: + ReadMeterIdentificationPowerThresholdSource() + : ReadAttribute("power-threshold-source") + { + } + + ~ReadMeterIdentificationPowerThresholdSource() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MeterIdentification::Attributes::PowerThresholdSource::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributePowerThresholdSourceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.PowerThresholdSource response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MeterIdentification PowerThresholdSource read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMeterIdentificationPowerThresholdSource : public SubscribeAttribute { +public: + SubscribeAttributeMeterIdentificationPowerThresholdSource() + : SubscribeAttribute("power-threshold-source") + { + } + + ~SubscribeAttributeMeterIdentificationPowerThresholdSource() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MeterIdentification::Attributes::PowerThresholdSource::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributePowerThresholdSourceWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.PowerThresholdSource response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute GeneratedCommandList + */ +class ReadMeterIdentificationGeneratedCommandList : public ReadAttribute { +public: + ReadMeterIdentificationGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadMeterIdentificationGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MeterIdentification::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MeterIdentification GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMeterIdentificationGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeMeterIdentificationGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeMeterIdentificationGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MeterIdentification::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeGeneratedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AcceptedCommandList + */ +class ReadMeterIdentificationAcceptedCommandList : public ReadAttribute { +public: + ReadMeterIdentificationAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadMeterIdentificationAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MeterIdentification::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MeterIdentification AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMeterIdentificationAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeMeterIdentificationAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeMeterIdentificationAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MeterIdentification::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAcceptedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute EventList + */ +class ReadMeterIdentificationEventList : public ReadAttribute { +public: + ReadMeterIdentificationEventList() + : ReadAttribute("event-list") + { + } + + ~ReadMeterIdentificationEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MeterIdentification::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MeterIdentification EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMeterIdentificationEventList : public SubscribeAttribute { +public: + SubscribeAttributeMeterIdentificationEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeMeterIdentificationEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MeterIdentification::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeEventListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AttributeList + */ +class ReadMeterIdentificationAttributeList : public ReadAttribute { +public: + ReadMeterIdentificationAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadMeterIdentificationAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MeterIdentification::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MeterIdentification AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMeterIdentificationAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeMeterIdentificationAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeMeterIdentificationAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MeterIdentification::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAttributeListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute FeatureMap + */ +class ReadMeterIdentificationFeatureMap : public ReadAttribute { +public: + ReadMeterIdentificationFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadMeterIdentificationFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MeterIdentification::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MeterIdentification FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMeterIdentificationFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeMeterIdentificationFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeMeterIdentificationFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MeterIdentification::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeFeatureMapWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ClusterRevision + */ +class ReadMeterIdentificationClusterRevision : public ReadAttribute { +public: + ReadMeterIdentificationClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadMeterIdentificationClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MeterIdentification::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MeterIdentification ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMeterIdentificationClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeMeterIdentificationClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeMeterIdentificationClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MeterIdentification::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MeterIdentification::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMeterIdentification alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeClusterRevisionWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MeterIdentification.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#endif // MTR_ENABLE_PROVISIONAL /*----------------------------------------------------------------------------*\ | Cluster UnitTesting | 0xFFF1FC05 | |------------------------------------------------------------------------------| @@ -189953,6 +192473,95 @@ void registerClusterEnergyEvse(Commands & commands) commands.RegisterCluster(clusterName, clusterCommands); #endif // MTR_ENABLE_PROVISIONAL } +void registerClusterEnergyCalendar(Commands & commands) +{ +#if MTR_ENABLE_PROVISIONAL + using namespace chip::app::Clusters::EnergyCalendar; + + const char * clusterName = "EnergyCalendar"; + + commands_list clusterCommands = { + make_unique(Id), // + make_unique(Id), // + make_unique(Id), // + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + }; + + commands.RegisterCluster(clusterName, clusterCommands); +#endif // MTR_ENABLE_PROVISIONAL +} void registerClusterEnergyPreference(Commands & commands) { #if MTR_ENABLE_PROVISIONAL @@ -193110,6 +195719,67 @@ void registerClusterElectricalMeasurement(Commands & commands) commands.RegisterCluster(clusterName, clusterCommands); } +void registerClusterMeterIdentification(Commands & commands) +{ +#if MTR_ENABLE_PROVISIONAL + using namespace chip::app::Clusters::MeterIdentification; + + const char * clusterName = "MeterIdentification"; + + commands_list clusterCommands = { + make_unique(Id), // + make_unique(Id), // + make_unique(Id), // + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + }; + + commands.RegisterCluster(clusterName, clusterCommands); +#endif // MTR_ENABLE_PROVISIONAL +} void registerClusterUnitTesting(Commands & commands) { using namespace chip::app::Clusters::UnitTesting; @@ -193566,6 +196236,7 @@ void registerClusters(Commands & commands) registerClusterMessages(commands); registerClusterDeviceEnergyManagement(commands); registerClusterEnergyEvse(commands); + registerClusterEnergyCalendar(commands); registerClusterEnergyPreference(commands); registerClusterPowerTopology(commands); registerClusterEnergyEvseMode(commands); @@ -193614,6 +196285,7 @@ void registerClusters(Commands & commands) registerClusterContentControl(commands); registerClusterContentAppObserver(commands); registerClusterElectricalMeasurement(commands); + registerClusterMeterIdentification(commands); registerClusterUnitTesting(commands); registerClusterSampleMei(commands); }