From c0626e5ef65d6697173fefecaafe48199d1ddbf1 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Sun, 14 Jan 2024 00:23:03 +0000 Subject: [PATCH] Updated energy-evse-cluster.xml to use latest EnergyEVSE.adoc which removes numberOfWeeklyTargets, numberOfDailyTargets, and adds new ChargingTargetScheduleStruct in Get/Set/Clear Target commands --- .../all-clusters-app.matter | 21 +- .../all-clusters-common/all-clusters-app.zap | 54 +--- .../energy-management-app.matter | 21 +- .../energy-management-app.zap | 32 --- .../include/EnergyEvseDelegateImpl.h | 4 - .../src/EnergyEvseDelegateImpl.cpp | 8 - .../energy-evse-server/energy-evse-server.cpp | 4 - .../energy-evse-server/energy-evse-server.h | 7 +- .../data-model/chip/energy-evse-cluster.xml | 111 ++++---- .../data_model/controller-clusters.matter | 19 +- .../chip/devicecontroller/ChipClusters.java | 89 +------ .../chip/devicecontroller/ChipStructs.java | 61 +++++ .../devicecontroller/ClusterIDMapping.java | 21 +- .../devicecontroller/ClusterInfoMapping.java | 21 +- .../devicecontroller/ClusterReadMapping.java | 22 -- .../chip/devicecontroller/cluster/files.gni | 1 + .../cluster/clusters/EnergyEvseCluster.kt | 235 ++--------------- .../java/matter/controller/cluster/files.gni | 1 + .../CHIPAttributeTLVValueDecoder.cpp | 32 --- .../zap-generated/CHIPInvokeCallbacks.cpp | 171 ++++++++----- .../python/chip/clusters/CHIPClusters.py | 16 +- .../python/chip/clusters/Objects.py | 64 ++--- .../MTRAttributeSpecifiedCheck.mm | 6 - .../MTRAttributeTLVValueDecoder.mm | 22 -- .../CHIP/zap-generated/MTRBaseClusters.h | 16 +- .../CHIP/zap-generated/MTRBaseClusters.mm | 78 +----- .../CHIP/zap-generated/MTRClusterConstants.h | 2 - .../CHIP/zap-generated/MTRClusters.h | 8 +- .../CHIP/zap-generated/MTRClusters.mm | 16 +- .../zap-generated/MTRCommandPayloadsObjc.h | 10 +- .../zap-generated/MTRCommandPayloadsObjc.mm | 136 ++++++---- .../CHIP/zap-generated/MTRStructsObjc.h | 6 + .../CHIP/zap-generated/MTRStructsObjc.mm | 30 +++ .../zap-generated/attributes/Accessors.cpp | 62 ----- .../zap-generated/attributes/Accessors.h | 10 - .../zap-generated/cluster-objects.cpp | 71 +++--- .../zap-generated/cluster-objects.h | 78 +++--- .../app-common/zap-generated/ids/Attributes.h | 8 - .../zap-generated/cluster/Commands.h | 28 +- .../cluster/ComplexArgumentParser.cpp | 34 +++ .../cluster/ComplexArgumentParser.h | 5 + .../cluster/logging/DataModelLogger.cpp | 39 ++- .../cluster/logging/DataModelLogger.h | 3 + .../zap-generated/cluster/Commands.h | 239 +++--------------- 44 files changed, 654 insertions(+), 1268 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 9c3e474946addf..132a5533a14ce4 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 @@ -3867,6 +3867,11 @@ provisional cluster EnergyEvse = 153 { optional energy_mwh addedEnergy = 2; } + struct ChargingTargetScheduleStruct { + optional TargetDayOfWeekBitmap dayOfWeekforSequence = 0; + optional ChargingTargetStruct chargingTargets[] = 1; + } + info event EVConnected = 0 { int32u sessionID = 0; } @@ -3914,8 +3919,6 @@ provisional cluster EnergyEvse = 153 { readonly attribute optional amperage_ma maximumDischargeCurrent = 8; attribute access(write: manage) optional amperage_ma userMaximumChargeCurrent = 9; attribute access(write: manage) optional elapsed_s randomizationDelayWindow = 10; - readonly attribute optional int8u numberOfWeeklyTargets = 33; - readonly attribute optional int8u numberOfDailyTargets = 34; readonly attribute optional nullable epoch_s nextChargeStartTime = 35; readonly attribute optional nullable epoch_s nextChargeTargetTime = 36; readonly attribute optional nullable energy_mwh nextChargeRequiredEnergy = 37; @@ -3936,8 +3939,7 @@ provisional cluster EnergyEvse = 153 { readonly attribute int16u clusterRevision = 65533; response struct GetTargetsResponse = 0 { - TargetDayOfWeekBitmap dayOfWeekforSequence = 0; - ChargingTargetStruct chargingTargets[] = 1; + ChargingTargetScheduleStruct chargingTargetSchedules[] = 0; } request struct EnableChargingRequest { @@ -3952,12 +3954,7 @@ provisional cluster EnergyEvse = 153 { } request struct SetTargetsRequest { - TargetDayOfWeekBitmap dayOfWeekforSequence = 0; - ChargingTargetStruct chargingTargets[] = 1; - } - - request struct GetTargetsRequest { - TargetDayOfWeekBitmap daysToReturn = 0; + ChargingTargetScheduleStruct chargingTargetSchedules[] = 0; } /** Allows a client to disable the EVSE from charging and discharging. */ @@ -3971,7 +3968,7 @@ provisional cluster EnergyEvse = 153 { /** Allows a client to set the user specified charging targets. */ timed command SetTargets(SetTargetsRequest): DefaultSuccess = 5; /** Allows a client to retrieve the user specified charging targets. */ - timed command GetTargets(GetTargetsRequest): GetTargetsResponse = 6; + timed command GetTargets(): GetTargetsResponse = 6; /** Allows a client to clear all stored charging targets. */ timed command ClearTargets(): DefaultSuccess = 7; } @@ -7454,8 +7451,6 @@ endpoint 1 { callback attribute maximumDischargeCurrent default = 0; callback attribute userMaximumChargeCurrent default = 0; callback attribute randomizationDelayWindow default = 600; - callback attribute numberOfWeeklyTargets default = 0; - callback attribute numberOfDailyTargets default = 1; callback attribute nextChargeStartTime; callback attribute nextChargeTargetTime; callback attribute nextChargeRequiredEnergy; 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 0c14d72717e091..71be89cecc77ae 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 @@ -17,12 +17,6 @@ } ], "package": [ - { - "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "version": "chip-v1" - }, { "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/zcl/zcl-with-test-extensions.json", @@ -30,6 +24,12 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data with some extensions" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" } ], "endpointTypes": [ @@ -8427,7 +8427,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -8459,7 +8459,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -8475,7 +8475,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -8491,7 +8491,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -8507,7 +8507,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -12257,38 +12257,6 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "NumberOfWeeklyTargets", - "code": 33, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "NumberOfDailyTargets", - "code": 34, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "NextChargeStartTime", "code": 35, diff --git a/examples/energy-management-app/energy-management-common/energy-management-app.matter b/examples/energy-management-app/energy-management-common/energy-management-app.matter index d48a22c42cc51e..79b2a2b46894b1 100644 --- a/examples/energy-management-app/energy-management-common/energy-management-app.matter +++ b/examples/energy-management-app/energy-management-common/energy-management-app.matter @@ -972,6 +972,11 @@ provisional cluster EnergyEvse = 153 { optional energy_mwh addedEnergy = 2; } + struct ChargingTargetScheduleStruct { + optional TargetDayOfWeekBitmap dayOfWeekforSequence = 0; + optional ChargingTargetStruct chargingTargets[] = 1; + } + info event EVConnected = 0 { int32u sessionID = 0; } @@ -1019,8 +1024,6 @@ provisional cluster EnergyEvse = 153 { readonly attribute optional amperage_ma maximumDischargeCurrent = 8; attribute access(write: manage) optional amperage_ma userMaximumChargeCurrent = 9; attribute access(write: manage) optional elapsed_s randomizationDelayWindow = 10; - readonly attribute optional int8u numberOfWeeklyTargets = 33; - readonly attribute optional int8u numberOfDailyTargets = 34; readonly attribute optional nullable epoch_s nextChargeStartTime = 35; readonly attribute optional nullable epoch_s nextChargeTargetTime = 36; readonly attribute optional nullable energy_mwh nextChargeRequiredEnergy = 37; @@ -1041,8 +1044,7 @@ provisional cluster EnergyEvse = 153 { readonly attribute int16u clusterRevision = 65533; response struct GetTargetsResponse = 0 { - TargetDayOfWeekBitmap dayOfWeekforSequence = 0; - ChargingTargetStruct chargingTargets[] = 1; + ChargingTargetScheduleStruct chargingTargetSchedules[] = 0; } request struct EnableChargingRequest { @@ -1057,12 +1059,7 @@ provisional cluster EnergyEvse = 153 { } request struct SetTargetsRequest { - TargetDayOfWeekBitmap dayOfWeekforSequence = 0; - ChargingTargetStruct chargingTargets[] = 1; - } - - request struct GetTargetsRequest { - TargetDayOfWeekBitmap daysToReturn = 0; + ChargingTargetScheduleStruct chargingTargetSchedules[] = 0; } /** Allows a client to disable the EVSE from charging and discharging. */ @@ -1076,7 +1073,7 @@ provisional cluster EnergyEvse = 153 { /** Allows a client to set the user specified charging targets. */ timed command SetTargets(SetTargetsRequest): DefaultSuccess = 5; /** Allows a client to retrieve the user specified charging targets. */ - timed command GetTargets(GetTargetsRequest): GetTargetsResponse = 6; + timed command GetTargets(): GetTargetsResponse = 6; /** Allows a client to clear all stored charging targets. */ timed command ClearTargets(): DefaultSuccess = 7; } @@ -1308,8 +1305,6 @@ endpoint 1 { callback attribute maximumDischargeCurrent default = 0; callback attribute userMaximumChargeCurrent default = 0; callback attribute randomizationDelayWindow default = 600; - callback attribute numberOfWeeklyTargets default = 0; - callback attribute numberOfDailyTargets default = 1; callback attribute nextChargeStartTime; callback attribute nextChargeTargetTime; callback attribute nextChargeRequiredEnergy; diff --git a/examples/energy-management-app/energy-management-common/energy-management-app.zap b/examples/energy-management-app/energy-management-common/energy-management-app.zap index 55d62101227dab..c160b35de2f7d8 100644 --- a/examples/energy-management-app/energy-management-common/energy-management-app.zap +++ b/examples/energy-management-app/energy-management-common/energy-management-app.zap @@ -2768,38 +2768,6 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "NumberOfWeeklyTargets", - "code": 33, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "NumberOfDailyTargets", - "code": 34, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "NextChargeStartTime", "code": 35, diff --git a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h index 8cf76f1b7a29bf..e365ef4f304ba6 100644 --- a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h +++ b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h @@ -208,8 +208,6 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate CHIP_ERROR SetRandomizationDelayWindow(uint32_t) override; /* PREF attributes */ - uint8_t GetNumberOfWeeklyTargets() override; - uint8_t GetNumberOfDailyTargets() override; DataModel::Nullable GetNextChargeStartTime() override; DataModel::Nullable GetNextChargeTargetTime() override; DataModel::Nullable GetNextChargeRequiredEnergy() override; @@ -293,8 +291,6 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate int64_t mUserMaximumChargeCurrent = kDefaultUserMaximumChargeCurrent; // TODO update spec uint32_t mRandomizationDelayWindow = kDefaultRandomizationDelayWindow; /* PREF attributes */ - uint8_t mNumberOfWeeklyTargets = 0; - uint8_t mNumberOfDailyTargets = 1; DataModel::Nullable mNextChargeStartTime; DataModel::Nullable mNextChargeTargetTime; DataModel::Nullable mNextChargeRequiredEnergy; diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp index 2b4a6e44f5fcea..dc60d748958894 100644 --- a/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp @@ -1374,14 +1374,6 @@ CHIP_ERROR EnergyEvseDelegate::SetRandomizationDelayWindow(uint32_t newValue) } /* PREF attributes */ -uint8_t EnergyEvseDelegate::GetNumberOfWeeklyTargets() -{ - return mNumberOfWeeklyTargets; -} -uint8_t EnergyEvseDelegate::GetNumberOfDailyTargets() -{ - return mNumberOfDailyTargets; -} DataModel::Nullable EnergyEvseDelegate::GetNextChargeStartTime() { return mNextChargeStartTime; diff --git a/src/app/clusters/energy-evse-server/energy-evse-server.cpp b/src/app/clusters/energy-evse-server/energy-evse-server.cpp index bc07ba07eef55a..d718eb134c2f81 100644 --- a/src/app/clusters/energy-evse-server/energy-evse-server.cpp +++ b/src/app/clusters/energy-evse-server/energy-evse-server.cpp @@ -95,10 +95,6 @@ CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValu /* Optional */ return aEncoder.Encode(mDelegate.GetRandomizationDelayWindow()); /* PREF - ChargingPreferences attributes */ - case NumberOfWeeklyTargets::Id: - return aEncoder.Encode(mDelegate.GetNumberOfWeeklyTargets()); - case NumberOfDailyTargets::Id: - return aEncoder.Encode(mDelegate.GetNumberOfDailyTargets()); case NextChargeStartTime::Id: return aEncoder.Encode(mDelegate.GetNextChargeStartTime()); case NextChargeTargetTime::Id: diff --git a/src/app/clusters/energy-evse-server/energy-evse-server.h b/src/app/clusters/energy-evse-server/energy-evse-server.h index a194551607c6f4..edac2357e97c39 100644 --- a/src/app/clusters/energy-evse-server/energy-evse-server.h +++ b/src/app/clusters/energy-evse-server/energy-evse-server.h @@ -94,8 +94,6 @@ class Delegate virtual int64_t GetUserMaximumChargeCurrent() = 0; virtual uint32_t GetRandomizationDelayWindow() = 0; /* PREF attributes */ - virtual uint8_t GetNumberOfWeeklyTargets() = 0; - virtual uint8_t GetNumberOfDailyTargets() = 0; virtual DataModel::Nullable GetNextChargeStartTime() = 0; virtual DataModel::Nullable GetNextChargeTargetTime() = 0; virtual DataModel::Nullable GetNextChargeRequiredEnergy() = 0; @@ -142,9 +140,8 @@ class Instance : public AttributeAccessInterface, public CommandHandlerInterface public: Instance(EndpointId aEndpointId, Delegate & aDelegate, Feature aFeature, OptionalAttributes aOptionalAttrs, OptionalCommands aOptionalCmds) : - AttributeAccessInterface(MakeOptional(aEndpointId), Id), - CommandHandlerInterface(MakeOptional(aEndpointId), Id), mDelegate(aDelegate), mFeature(aFeature), - mOptionalAttrs(aOptionalAttrs), mOptionalCmds(aOptionalCmds) + AttributeAccessInterface(MakeOptional(aEndpointId), Id), CommandHandlerInterface(MakeOptional(aEndpointId), Id), + mDelegate(aDelegate), mFeature(aFeature), mOptionalAttrs(aOptionalAttrs), mOptionalCmds(aOptionalCmds) { /* set the base class delegates endpointId */ mDelegate.SetEndpointId(aEndpointId); diff --git a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml index 2e58fb31da3f42..048f217abb7db4 100644 --- a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml @@ -13,6 +13,7 @@ limitations under the License. --> + @@ -23,6 +24,7 @@ limitations under the License. + @@ -31,6 +33,7 @@ limitations under the License. + @@ -51,12 +54,14 @@ limitations under the License. + + @@ -67,12 +72,20 @@ limitations under the License. + - - - + + + + + + + + + + Energy EVSE Energy Management @@ -81,92 +94,97 @@ limitations under the License. true true Electric Vehicle Supply Equipment (EVSE) is equipment used to charge an Electric Vehicle (EV) or Plug-In Hybrid Electric Vehicle. This cluster provides an interface to the functionality of Electric Vehicle Supply Equipment (EVSE) management. - - + - State - SupplyState - FaultState + + State + SupplyState + FaultState ChargingEnabledUntil + DischargingEnabledUntil CircuitCapacity MinimumChargeCurrent MaximumChargeCurrent + MaximumDischargeCurrent - UserMaximumChargeCurrent - - + RandomizationDelayWindow - NumberOfWeeklyTargets + - NumberOfDailyTargets + - NextChargeStartTime + + NextChargeStartTime - NextChargeTargetTime + + NextChargeTargetTime + NextChargeRequiredEnergy - NextChargeTargetSoC + + NextChargeTargetSoC - - + + ApproximateEVEfficiency - StateOfCharge + + StateOfCharge + BatteryCapacity + VehicleID SessionID SessionDuration SessionEnergyCharged + SessionEnergyDischarged - + Allows a client to disable the EVSE from charging and discharging. - - + + Allows a client to enable the EVSE to charge an EV. - - + + Allows a client to enable the EVSE to discharge an EV. - + Allows a client to put the EVSE into a self-diagnostics mode. - - - + + Allows a client to set the user specified charging targets. - - + Allows a client to retrieve the user specified charging targets. - + Allows a client to clear all stored charging targets. - - - + + The GetTargetsResponse is sent in response to the GetTargets Command. @@ -176,30 +194,30 @@ limitations under the License. EVNotDetected - + - + EnergyTransferStarted - + EnergyTransferStopped - - + + Fault - - - + + + RFID @@ -208,10 +226,11 @@ limitations under the License. - - - - + + + + + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 9b39b0d849af15..9fe728a6497994 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -4655,6 +4655,11 @@ provisional cluster EnergyEvse = 153 { optional energy_mwh addedEnergy = 2; } + struct ChargingTargetScheduleStruct { + optional TargetDayOfWeekBitmap dayOfWeekforSequence = 0; + optional ChargingTargetStruct chargingTargets[] = 1; + } + info event EVConnected = 0 { int32u sessionID = 0; } @@ -4702,8 +4707,6 @@ provisional cluster EnergyEvse = 153 { readonly attribute optional amperage_ma maximumDischargeCurrent = 8; attribute access(write: manage) optional amperage_ma userMaximumChargeCurrent = 9; attribute access(write: manage) optional elapsed_s randomizationDelayWindow = 10; - readonly attribute optional int8u numberOfWeeklyTargets = 33; - readonly attribute optional int8u numberOfDailyTargets = 34; readonly attribute optional nullable epoch_s nextChargeStartTime = 35; readonly attribute optional nullable epoch_s nextChargeTargetTime = 36; readonly attribute optional nullable energy_mwh nextChargeRequiredEnergy = 37; @@ -4724,8 +4727,7 @@ provisional cluster EnergyEvse = 153 { readonly attribute int16u clusterRevision = 65533; response struct GetTargetsResponse = 0 { - TargetDayOfWeekBitmap dayOfWeekforSequence = 0; - ChargingTargetStruct chargingTargets[] = 1; + ChargingTargetScheduleStruct chargingTargetSchedules[] = 0; } request struct EnableChargingRequest { @@ -4740,12 +4742,7 @@ provisional cluster EnergyEvse = 153 { } request struct SetTargetsRequest { - TargetDayOfWeekBitmap dayOfWeekforSequence = 0; - ChargingTargetStruct chargingTargets[] = 1; - } - - request struct GetTargetsRequest { - TargetDayOfWeekBitmap daysToReturn = 0; + ChargingTargetScheduleStruct chargingTargetSchedules[] = 0; } /** Allows a client to disable the EVSE from charging and discharging. */ @@ -4759,7 +4756,7 @@ provisional cluster EnergyEvse = 153 { /** Allows a client to set the user specified charging targets. */ timed command SetTargets(SetTargetsRequest): DefaultSuccess = 5; /** Allows a client to retrieve the user specified charging targets. */ - timed command GetTargets(GetTargetsRequest): GetTargetsResponse = 6; + timed command GetTargets(): GetTargetsResponse = 6; /** Allows a client to clear all stored charging targets. */ timed command ClearTargets(): DefaultSuccess = 7; } diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index f050f7e1428d6a..7209aeff02b6df 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -29842,8 +29842,6 @@ public static class EnergyEvseCluster extends BaseChipCluster { private static final long MAXIMUM_DISCHARGE_CURRENT_ATTRIBUTE_ID = 8L; private static final long USER_MAXIMUM_CHARGE_CURRENT_ATTRIBUTE_ID = 9L; private static final long RANDOMIZATION_DELAY_WINDOW_ATTRIBUTE_ID = 10L; - private static final long NUMBER_OF_WEEKLY_TARGETS_ATTRIBUTE_ID = 33L; - private static final long NUMBER_OF_DAILY_TARGETS_ATTRIBUTE_ID = 34L; private static final long NEXT_CHARGE_START_TIME_ATTRIBUTE_ID = 35L; private static final long NEXT_CHARGE_TARGET_TIME_ATTRIBUTE_ID = 36L; private static final long NEXT_CHARGE_REQUIRED_ENERGY_ATTRIBUTE_ID = 37L; @@ -29946,17 +29944,13 @@ public void onResponse(StructType invokeStructValue) { } - public void setTargets(DefaultClusterCallback callback, Integer dayOfWeekforSequence, ArrayList chargingTargets, int timedInvokeTimeoutMs) { + public void setTargets(DefaultClusterCallback callback, ArrayList chargingTargetSchedules, int timedInvokeTimeoutMs) { final long commandId = 5L; ArrayList elements = new ArrayList<>(); - final long dayOfWeekforSequenceFieldID = 0L; - BaseTLVType dayOfWeekforSequencetlvValue = new UIntType(dayOfWeekforSequence); - elements.add(new StructElement(dayOfWeekforSequenceFieldID, dayOfWeekforSequencetlvValue)); - - final long chargingTargetsFieldID = 1L; - BaseTLVType chargingTargetstlvValue = ArrayType.generateArrayType(chargingTargets, (elementchargingTargets) -> elementchargingTargets.encodeTlv()); - elements.add(new StructElement(chargingTargetsFieldID, chargingTargetstlvValue)); + final long chargingTargetSchedulesFieldID = 0L; + BaseTLVType chargingTargetSchedulestlvValue = ArrayType.generateArrayType(chargingTargetSchedules, (elementchargingTargetSchedules) -> elementchargingTargetSchedules.encodeTlv()); + elements.add(new StructElement(chargingTargetSchedulesFieldID, chargingTargetSchedulestlvValue)); StructType value = new StructType(elements); invoke(new InvokeCallbackImpl(callback) { @@ -29967,36 +29961,25 @@ public void onResponse(StructType invokeStructValue) { } - public void getTargets(GetTargetsResponseCallback callback, Integer daysToReturn, int timedInvokeTimeoutMs) { + public void getTargets(GetTargetsResponseCallback callback, int timedInvokeTimeoutMs) { final long commandId = 6L; ArrayList elements = new ArrayList<>(); - final long daysToReturnFieldID = 0L; - BaseTLVType daysToReturntlvValue = new UIntType(daysToReturn); - elements.add(new StructElement(daysToReturnFieldID, daysToReturntlvValue)); - StructType value = new StructType(elements); invoke(new InvokeCallbackImpl(callback) { @Override public void onResponse(StructType invokeStructValue) { - final long dayOfWeekforSequenceFieldID = 0L; - Integer dayOfWeekforSequence = null; - final long chargingTargetsFieldID = 1L; - ArrayList chargingTargets = null; + final long chargingTargetSchedulesFieldID = 0L; + ArrayList chargingTargetSchedules = null; for (StructElement element: invokeStructValue.value()) { - if (element.contextTagNum() == dayOfWeekforSequenceFieldID) { - if (element.value(BaseTLVType.class).type() == TLVType.UInt) { - UIntType castingValue = element.value(UIntType.class); - dayOfWeekforSequence = castingValue.value(Integer.class); - } - } else if (element.contextTagNum() == chargingTargetsFieldID) { + if (element.contextTagNum() == chargingTargetSchedulesFieldID) { if (element.value(BaseTLVType.class).type() == TLVType.Array) { ArrayType castingValue = element.value(ArrayType.class); - chargingTargets = castingValue.map((elementcastingValue) -> ChipStructs.EnergyEvseClusterChargingTargetStruct.decodeTlv(elementcastingValue)); + chargingTargetSchedules = castingValue.map((elementcastingValue) -> ChipStructs.EnergyEvseClusterChargingTargetScheduleStruct.decodeTlv(elementcastingValue)); } } } - callback.onSuccess(dayOfWeekforSequence, chargingTargets); + callback.onSuccess(chargingTargetSchedules); }}, commandId, value, timedInvokeTimeoutMs); } @@ -30014,7 +29997,7 @@ public void onResponse(StructType invokeStructValue) { } public interface GetTargetsResponseCallback extends BaseClusterCallback { - void onSuccess(Integer dayOfWeekforSequence, ArrayList chargingTargets); + void onSuccess(ArrayList chargingTargetSchedules); } public interface StateAttributeCallback extends BaseAttributeCallback { @@ -30386,56 +30369,6 @@ public void onSuccess(byte[] tlv) { }, RANDOMIZATION_DELAY_WINDOW_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readNumberOfWeeklyTargetsAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NUMBER_OF_WEEKLY_TARGETS_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, NUMBER_OF_WEEKLY_TARGETS_ATTRIBUTE_ID, true); - } - - public void subscribeNumberOfWeeklyTargetsAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NUMBER_OF_WEEKLY_TARGETS_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - } - }, NUMBER_OF_WEEKLY_TARGETS_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readNumberOfDailyTargetsAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NUMBER_OF_DAILY_TARGETS_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, NUMBER_OF_DAILY_TARGETS_ATTRIBUTE_ID, true); - } - - public void subscribeNumberOfDailyTargetsAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NUMBER_OF_DAILY_TARGETS_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - } - }, NUMBER_OF_DAILY_TARGETS_ATTRIBUTE_ID, minInterval, maxInterval); - } - public void readNextChargeStartTimeAttribute( NextChargeStartTimeAttributeCallback callback) { ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NEXT_CHARGE_START_TIME_ATTRIBUTE_ID); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index 98bc3ca71303f5..2c8d1b63c311df 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -7351,6 +7351,67 @@ public String toString() { return output.toString(); } } +public static class EnergyEvseClusterChargingTargetScheduleStruct { + public Optional dayOfWeekforSequence; + public Optional> chargingTargets; + private static final long DAY_OF_WEEKFOR_SEQUENCE_ID = 0L; + private static final long CHARGING_TARGETS_ID = 1L; + + public EnergyEvseClusterChargingTargetScheduleStruct( + Optional dayOfWeekforSequence, + Optional> chargingTargets + ) { + this.dayOfWeekforSequence = dayOfWeekforSequence; + this.chargingTargets = chargingTargets; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(DAY_OF_WEEKFOR_SEQUENCE_ID, dayOfWeekforSequence.map((nonOptionaldayOfWeekforSequence) -> new UIntType(nonOptionaldayOfWeekforSequence)).orElse(new EmptyType()))); + values.add(new StructElement(CHARGING_TARGETS_ID, chargingTargets.map((nonOptionalchargingTargets) -> ArrayType.generateArrayType(nonOptionalchargingTargets, (elementnonOptionalchargingTargets) -> elementnonOptionalchargingTargets.encodeTlv())).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static EnergyEvseClusterChargingTargetScheduleStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Optional dayOfWeekforSequence = Optional.empty(); + Optional> chargingTargets = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == DAY_OF_WEEKFOR_SEQUENCE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + dayOfWeekforSequence = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == CHARGING_TARGETS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + chargingTargets = Optional.of(castingValue.map((elementcastingValue) -> ChipStructs.EnergyEvseClusterChargingTargetStruct.decodeTlv(elementcastingValue))); + } + } + } + return new EnergyEvseClusterChargingTargetScheduleStruct( + dayOfWeekforSequence, + chargingTargets + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("EnergyEvseClusterChargingTargetScheduleStruct {\n"); + output.append("\tdayOfWeekforSequence: "); + output.append(dayOfWeekforSequence); + output.append("\n"); + output.append("\tchargingTargets: "); + output.append(chargingTargets); + 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 2e712af09006a4..48a979486ad081 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -9561,8 +9561,6 @@ public enum Attribute { MaximumDischargeCurrent(8L), UserMaximumChargeCurrent(9L), RandomizationDelayWindow(10L), - NumberOfWeeklyTargets(33L), - NumberOfDailyTargets(34L), NextChargeStartTime(35L), NextChargeTargetTime(36L), NextChargeRequiredEnergy(37L), @@ -9685,7 +9683,7 @@ public static EnableDischargingCommandField value(int id) throws NoSuchFieldErro } throw new NoSuchFieldError(); } - }public enum SetTargetsCommandField {DayOfWeekforSequence(0),ChargingTargets(1),; + }public enum SetTargetsCommandField {ChargingTargetSchedules(0),; private final int id; SetTargetsCommandField(int id) { this.id = id; @@ -9702,23 +9700,6 @@ public static SetTargetsCommandField value(int id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } - }public enum GetTargetsCommandField {DaysToReturn(0),; - private final int id; - GetTargetsCommandField(int id) { - this.id = id; - } - - public int getID() { - return id; - } - public static GetTargetsCommandField value(int id) throws NoSuchFieldError { - for (GetTargetsCommandField field : GetTargetsCommandField.values()) { - if (field.getID() == id) { - return field; - } - } - throw new NoSuchFieldError(); - } }@Override public String getAttributeName(long id) throws NoSuchFieldError { return Attribute.value(id).toString(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index 94cda4091ba5dc..8d82536cd878a5 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -10479,12 +10479,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Integer dayOfWeekforSequence, ArrayList chargingTargets) { + public void onSuccess(ArrayList chargingTargetSchedules) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo dayOfWeekforSequenceResponseValue = new CommandResponseInfo("dayOfWeekforSequence", "Integer"); - responseValues.put(dayOfWeekforSequenceResponseValue, dayOfWeekforSequence); - // chargingTargets: ChargingTargetStruct + // chargingTargetSchedules: ChargingTargetScheduleStruct // Conversion from this type to Java is not properly implemented yet callback.onSuccess(responseValues); @@ -23303,17 +23301,12 @@ public Map> getCommandMap() { Map energyEvsesetTargetsCommandParams = new LinkedHashMap(); - CommandParameterInfo energyEvsesetTargetsdayOfWeekforSequenceCommandParameterInfo = new CommandParameterInfo("dayOfWeekforSequence", Integer.class, Integer.class); - energyEvsesetTargetsCommandParams.put("dayOfWeekforSequence",energyEvsesetTargetsdayOfWeekforSequenceCommandParameterInfo); - InteractionInfo energyEvsesetTargetsInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.EnergyEvseCluster) cluster) .setTargets((DefaultClusterCallback) callback - , (Integer) - commandArguments.get("dayOfWeekforSequence") - , (ArrayList) - commandArguments.get("chargingTargets"), 10000 + , (ArrayList) + commandArguments.get("chargingTargetSchedules"), 10000 ); }, () -> new DelegatedDefaultClusterCallback(), @@ -23322,16 +23315,10 @@ public Map> getCommandMap() { energyEvseClusterInteractionInfoMap.put("setTargets", energyEvsesetTargetsInteractionInfo); Map energyEvsegetTargetsCommandParams = new LinkedHashMap(); - - CommandParameterInfo energyEvsegetTargetsdaysToReturnCommandParameterInfo = new CommandParameterInfo("daysToReturn", Integer.class, Integer.class); - energyEvsegetTargetsCommandParams.put("daysToReturn",energyEvsegetTargetsdaysToReturnCommandParameterInfo); InteractionInfo energyEvsegetTargetsInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.EnergyEvseCluster) cluster) .getTargets((ChipClusters.EnergyEvseCluster.GetTargetsResponseCallback) callback - , (Integer) - commandArguments.get("daysToReturn") - , 10000); }, () -> new DelegatedEnergyEvseClusterGetTargetsResponseCallback(), diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 16c71818bad11c..eb2711cd6fdde7 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -9483,28 +9483,6 @@ private static Map readEnergyEvseInteractionInfo() { readEnergyEvseRandomizationDelayWindowCommandParams ); result.put("readRandomizationDelayWindowAttribute", readEnergyEvseRandomizationDelayWindowAttributeInteractionInfo); - Map readEnergyEvseNumberOfWeeklyTargetsCommandParams = new LinkedHashMap(); - InteractionInfo readEnergyEvseNumberOfWeeklyTargetsAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.EnergyEvseCluster) cluster).readNumberOfWeeklyTargetsAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readEnergyEvseNumberOfWeeklyTargetsCommandParams - ); - result.put("readNumberOfWeeklyTargetsAttribute", readEnergyEvseNumberOfWeeklyTargetsAttributeInteractionInfo); - Map readEnergyEvseNumberOfDailyTargetsCommandParams = new LinkedHashMap(); - InteractionInfo readEnergyEvseNumberOfDailyTargetsAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.EnergyEvseCluster) cluster).readNumberOfDailyTargetsAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readEnergyEvseNumberOfDailyTargetsCommandParams - ); - result.put("readNumberOfDailyTargetsAttribute", readEnergyEvseNumberOfDailyTargetsAttributeInteractionInfo); Map readEnergyEvseNextChargeStartTimeCommandParams = new LinkedHashMap(); InteractionInfo readEnergyEvseNextChargeStartTimeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { 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 41532a359802fa..701be9a7ebea52 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni @@ -56,6 +56,7 @@ structs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ElectricalEnergyMeasurementClusterEnergyMeasurementStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ElectricalEnergyMeasurementClusterMeasurementAccuracyRangeStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ElectricalEnergyMeasurementClusterMeasurementAccuracyStruct.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/EnergyPreferenceClusterBalanceStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/FixedLabelClusterLabelStruct.kt", diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyEvseCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyEvseCluster.kt index c2a269e96018af..20363bff38ec5a 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyEvseCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyEvseCluster.kt @@ -46,8 +46,7 @@ import matter.tlv.TlvWriter class EnergyEvseCluster(private val controller: MatterController, private val endpointId: UShort) { class GetTargetsResponse( - val dayOfWeekforSequence: UByte, - val chargingTargets: List + val chargingTargetSchedules: List ) class StateAttribute(val value: UByte?) @@ -345,8 +344,7 @@ class EnergyEvseCluster(private val controller: MatterController, private val en } suspend fun setTargets( - dayOfWeekforSequence: UByte, - chargingTargets: List, + chargingTargetSchedules: List, timedInvokeTimeout: Duration ) { val commandId: UInt = 5u @@ -354,12 +352,9 @@ class EnergyEvseCluster(private val controller: MatterController, private val en val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) - val TAG_DAY_OF_WEEKFOR_SEQUENCE_REQ: Int = 0 - tlvWriter.put(ContextSpecificTag(TAG_DAY_OF_WEEKFOR_SEQUENCE_REQ), dayOfWeekforSequence) - - val TAG_CHARGING_TARGETS_REQ: Int = 1 - tlvWriter.startArray(ContextSpecificTag(TAG_CHARGING_TARGETS_REQ)) - for (item in chargingTargets.iterator()) { + val TAG_CHARGING_TARGET_SCHEDULES_REQ: Int = 0 + tlvWriter.startArray(ContextSpecificTag(TAG_CHARGING_TARGET_SCHEDULES_REQ)) + for (item in chargingTargetSchedules.iterator()) { item.toTlv(AnonymousTag, tlvWriter) } tlvWriter.endArray() @@ -376,14 +371,11 @@ class EnergyEvseCluster(private val controller: MatterController, private val en logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun getTargets(daysToReturn: UByte, timedInvokeTimeout: Duration): GetTargetsResponse { + suspend fun getTargets(timedInvokeTimeout: Duration): GetTargetsResponse { val commandId: UInt = 6u val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) - - val TAG_DAYS_TO_RETURN_REQ: Int = 0 - tlvWriter.put(ContextSpecificTag(TAG_DAYS_TO_RETURN_REQ), daysToReturn) tlvWriter.endStructure() val request: InvokeRequest = @@ -398,25 +390,18 @@ class EnergyEvseCluster(private val controller: MatterController, private val en val tlvReader = TlvReader(response.payload) tlvReader.enterStructure(AnonymousTag) - val TAG_DAY_OF_WEEKFOR_SEQUENCE: Int = 0 - var dayOfWeekforSequence_decoded: UByte? = null - - val TAG_CHARGING_TARGETS: Int = 1 - var chargingTargets_decoded: List? = null + val TAG_CHARGING_TARGET_SCHEDULES: Int = 0 + var chargingTargetSchedules_decoded: List? = null while (!tlvReader.isEndOfContainer()) { val tag = tlvReader.peekElement().tag - if (tag == ContextSpecificTag(TAG_DAY_OF_WEEKFOR_SEQUENCE)) { - dayOfWeekforSequence_decoded = tlvReader.getUByte(tag) - } - - if (tag == ContextSpecificTag(TAG_CHARGING_TARGETS)) { - chargingTargets_decoded = - buildList { + if (tag == ContextSpecificTag(TAG_CHARGING_TARGET_SCHEDULES)) { + chargingTargetSchedules_decoded = + buildList { tlvReader.enterArray(tag) while (!tlvReader.isEndOfContainer()) { - add(EnergyEvseClusterChargingTargetStruct.fromTlv(AnonymousTag, tlvReader)) + add(EnergyEvseClusterChargingTargetScheduleStruct.fromTlv(AnonymousTag, tlvReader)) } tlvReader.exitContainer() } @@ -425,17 +410,13 @@ class EnergyEvseCluster(private val controller: MatterController, private val en } } - if (dayOfWeekforSequence_decoded == null) { - throw IllegalStateException("dayOfWeekforSequence not found in TLV") - } - - if (chargingTargets_decoded == null) { - throw IllegalStateException("chargingTargets not found in TLV") + if (chargingTargetSchedules_decoded == null) { + throw IllegalStateException("chargingTargetSchedules not found in TLV") } tlvReader.exitContainer() - return GetTargetsResponse(dayOfWeekforSequence_decoded, chargingTargets_decoded) + return GetTargetsResponse(chargingTargetSchedules_decoded) } suspend fun clearTargets(timedInvokeTimeout: Duration) { @@ -1523,192 +1504,6 @@ class EnergyEvseCluster(private val controller: MatterController, private val en } } - suspend fun readNumberOfWeeklyTargetsAttribute(): UByte? { - val ATTRIBUTE_ID: UInt = 33u - - 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) { "Numberofweeklytargets attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeNumberOfWeeklyTargetsAttribute( - minInterval: Int, - maxInterval: Int - ): Flow { - val ATTRIBUTE_ID: UInt = 33u - 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( - UByteSubscriptionState.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) { - "Numberofweeklytargets 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.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UByteSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readNumberOfDailyTargetsAttribute(): UByte? { - val ATTRIBUTE_ID: UInt = 34u - - 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) { "Numberofdailytargets attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeNumberOfDailyTargetsAttribute( - minInterval: Int, - maxInterval: Int - ): Flow { - val ATTRIBUTE_ID: UInt = 34u - 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( - UByteSubscriptionState.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) { - "Numberofdailytargets 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.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UByteSubscriptionState.SubscriptionEstablished) - } - } - } - } - suspend fun readNextChargeStartTimeAttribute(): NextChargeStartTimeAttribute { val ATTRIBUTE_ID: UInt = 35u 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 2ebed3b24f6c2c..7474e5ba2f1e8f 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni @@ -56,6 +56,7 @@ matter_structs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ElectricalEnergyMeasurementClusterEnergyMeasurementStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ElectricalEnergyMeasurementClusterMeasurementAccuracyRangeStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ElectricalEnergyMeasurementClusterMeasurementAccuracyStruct.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/EnergyPreferenceClusterBalanceStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/FixedLabelClusterLabelStruct.kt", diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 58fb6a4bdd6646..fb6c29eead7d36 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -22811,38 +22811,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jnivalue, value); return value; } - case Attributes::NumberOfWeeklyTargets::Id: { - using TypeInfo = Attributes::NumberOfWeeklyTargets::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::NumberOfDailyTargets::Id: { - using TypeInfo = Attributes::NumberOfDailyTargets::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } case Attributes::NextChargeStartTime::Id: { using TypeInfo = Attributes::NextChargeStartTime::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index 0611659ab41f0d..5bf21dd5f16bba 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -3970,92 +3970,149 @@ void CHIPEnergyEvseClusterGetTargetsResponseCallback::CallbackFn( // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &javaMethod); + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/ArrayList;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject DayOfWeekforSequence; - std::string DayOfWeekforSequenceClassName = "java/lang/Integer"; - std::string DayOfWeekforSequenceCtorSignature = "(I)V"; - jint jniDayOfWeekforSequence = static_cast(dataResponse.dayOfWeekforSequence.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject(DayOfWeekforSequenceClassName.c_str(), - DayOfWeekforSequenceCtorSignature.c_str(), jniDayOfWeekforSequence, - DayOfWeekforSequence); - jobject ChargingTargets; - chip::JniReferences::GetInstance().CreateArrayList(ChargingTargets); + jobject ChargingTargetSchedules; + chip::JniReferences::GetInstance().CreateArrayList(ChargingTargetSchedules); - auto iter_ChargingTargets_0 = dataResponse.chargingTargets.begin(); - while (iter_ChargingTargets_0.Next()) + auto iter_ChargingTargetSchedules_0 = dataResponse.chargingTargetSchedules.begin(); + while (iter_ChargingTargetSchedules_0.Next()) { - auto & entry_0 = iter_ChargingTargets_0.GetValue(); + auto & entry_0 = iter_ChargingTargetSchedules_0.GetValue(); jobject newElement_0; - jobject newElement_0_targetTimeMinutesPastMidnight; - std::string newElement_0_targetTimeMinutesPastMidnightClassName = "java/lang/Integer"; - std::string newElement_0_targetTimeMinutesPastMidnightCtorSignature = "(I)V"; - jint jninewElement_0_targetTimeMinutesPastMidnight = static_cast(entry_0.targetTimeMinutesPastMidnight); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_targetTimeMinutesPastMidnightClassName.c_str(), - newElement_0_targetTimeMinutesPastMidnightCtorSignature.c_str(), - jninewElement_0_targetTimeMinutesPastMidnight, - newElement_0_targetTimeMinutesPastMidnight); - jobject newElement_0_targetSoC; - if (!entry_0.targetSoC.HasValue()) + jobject newElement_0_dayOfWeekforSequence; + if (!entry_0.dayOfWeekforSequence.HasValue()) { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_targetSoC); + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_dayOfWeekforSequence); } else { - jobject newElement_0_targetSoCInsideOptional; - std::string newElement_0_targetSoCInsideOptionalClassName = "java/lang/Integer"; - std::string newElement_0_targetSoCInsideOptionalCtorSignature = "(I)V"; - jint jninewElement_0_targetSoCInsideOptional = static_cast(entry_0.targetSoC.Value()); + jobject newElement_0_dayOfWeekforSequenceInsideOptional; + std::string newElement_0_dayOfWeekforSequenceInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_0_dayOfWeekforSequenceInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_0_dayOfWeekforSequenceInsideOptional = static_cast(entry_0.dayOfWeekforSequence.Value().Raw()); chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_targetSoCInsideOptionalClassName.c_str(), newElement_0_targetSoCInsideOptionalCtorSignature.c_str(), - jninewElement_0_targetSoCInsideOptional, newElement_0_targetSoCInsideOptional); - chip::JniReferences::GetInstance().CreateOptional(newElement_0_targetSoCInsideOptional, newElement_0_targetSoC); + newElement_0_dayOfWeekforSequenceInsideOptionalClassName.c_str(), + newElement_0_dayOfWeekforSequenceInsideOptionalCtorSignature.c_str(), + jninewElement_0_dayOfWeekforSequenceInsideOptional, newElement_0_dayOfWeekforSequenceInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_dayOfWeekforSequenceInsideOptional, + newElement_0_dayOfWeekforSequence); } - jobject newElement_0_addedEnergy; - if (!entry_0.addedEnergy.HasValue()) + jobject newElement_0_chargingTargets; + if (!entry_0.chargingTargets.HasValue()) { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_addedEnergy); + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_chargingTargets); } else { - jobject newElement_0_addedEnergyInsideOptional; - std::string newElement_0_addedEnergyInsideOptionalClassName = "java/lang/Long"; - std::string newElement_0_addedEnergyInsideOptionalCtorSignature = "(J)V"; - jlong jninewElement_0_addedEnergyInsideOptional = static_cast(entry_0.addedEnergy.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_addedEnergyInsideOptionalClassName.c_str(), - newElement_0_addedEnergyInsideOptionalCtorSignature.c_str(), - jninewElement_0_addedEnergyInsideOptional, - newElement_0_addedEnergyInsideOptional); - chip::JniReferences::GetInstance().CreateOptional(newElement_0_addedEnergyInsideOptional, newElement_0_addedEnergy); + jobject newElement_0_chargingTargetsInsideOptional; + chip::JniReferences::GetInstance().CreateArrayList(newElement_0_chargingTargetsInsideOptional); + + auto iter_newElement_0_chargingTargetsInsideOptional_3 = entry_0.chargingTargets.Value().begin(); + while (iter_newElement_0_chargingTargetsInsideOptional_3.Next()) + { + auto & entry_3 = iter_newElement_0_chargingTargetsInsideOptional_3.GetValue(); + jobject newElement_3; + jobject newElement_3_targetTimeMinutesPastMidnight; + std::string newElement_3_targetTimeMinutesPastMidnightClassName = "java/lang/Integer"; + std::string newElement_3_targetTimeMinutesPastMidnightCtorSignature = "(I)V"; + jint jninewElement_3_targetTimeMinutesPastMidnight = static_cast(entry_3.targetTimeMinutesPastMidnight); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_3_targetTimeMinutesPastMidnightClassName.c_str(), + newElement_3_targetTimeMinutesPastMidnightCtorSignature.c_str(), jninewElement_3_targetTimeMinutesPastMidnight, + newElement_3_targetTimeMinutesPastMidnight); + jobject newElement_3_targetSoC; + if (!entry_3.targetSoC.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_3_targetSoC); + } + else + { + jobject newElement_3_targetSoCInsideOptional; + std::string newElement_3_targetSoCInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_3_targetSoCInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_3_targetSoCInsideOptional = static_cast(entry_3.targetSoC.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_3_targetSoCInsideOptionalClassName.c_str(), + newElement_3_targetSoCInsideOptionalCtorSignature.c_str(), jninewElement_3_targetSoCInsideOptional, + newElement_3_targetSoCInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_3_targetSoCInsideOptional, newElement_3_targetSoC); + } + jobject newElement_3_addedEnergy; + if (!entry_3.addedEnergy.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_3_addedEnergy); + } + else + { + jobject newElement_3_addedEnergyInsideOptional; + std::string newElement_3_addedEnergyInsideOptionalClassName = "java/lang/Long"; + std::string newElement_3_addedEnergyInsideOptionalCtorSignature = "(J)V"; + jlong jninewElement_3_addedEnergyInsideOptional = static_cast(entry_3.addedEnergy.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_3_addedEnergyInsideOptionalClassName.c_str(), + newElement_3_addedEnergyInsideOptionalCtorSignature.c_str(), jninewElement_3_addedEnergyInsideOptional, + newElement_3_addedEnergyInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_3_addedEnergyInsideOptional, + newElement_3_addedEnergy); + } + + jclass chargingTargetStructStructClass_4; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$EnergyEvseClusterChargingTargetStruct", + chargingTargetStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EnergyEvseClusterChargingTargetStruct"); + return; + } + + jmethodID chargingTargetStructStructCtor_4; + err = chip::JniReferences::GetInstance().FindMethod( + env, chargingTargetStructStructClass_4, "", + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", &chargingTargetStructStructCtor_4); + if (err != CHIP_NO_ERROR || chargingTargetStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$EnergyEvseClusterChargingTargetStruct constructor"); + return; + } + + newElement_3 = + env->NewObject(chargingTargetStructStructClass_4, chargingTargetStructStructCtor_4, + newElement_3_targetTimeMinutesPastMidnight, newElement_3_targetSoC, newElement_3_addedEnergy); + chip::JniReferences::GetInstance().AddToList(newElement_0_chargingTargetsInsideOptional, newElement_3); + } + chip::JniReferences::GetInstance().CreateOptional(newElement_0_chargingTargetsInsideOptional, + newElement_0_chargingTargets); } - jclass chargingTargetStructStructClass_1; + jclass chargingTargetScheduleStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$EnergyEvseClusterChargingTargetStruct", chargingTargetStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$EnergyEvseClusterChargingTargetScheduleStruct", + chargingTargetScheduleStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$EnergyEvseClusterChargingTargetStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$EnergyEvseClusterChargingTargetScheduleStruct"); return; } - jmethodID chargingTargetStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, chargingTargetStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", - &chargingTargetStructStructCtor_1); - if (err != CHIP_NO_ERROR || chargingTargetStructStructCtor_1 == nullptr) + jmethodID chargingTargetScheduleStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, chargingTargetScheduleStructStructClass_1, "", + "(Ljava/util/Optional;Ljava/util/Optional;)V", + &chargingTargetScheduleStructStructCtor_1); + if (err != CHIP_NO_ERROR || chargingTargetScheduleStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$EnergyEvseClusterChargingTargetStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$EnergyEvseClusterChargingTargetScheduleStruct constructor"); return; } - newElement_0 = env->NewObject(chargingTargetStructStructClass_1, chargingTargetStructStructCtor_1, - newElement_0_targetTimeMinutesPastMidnight, newElement_0_targetSoC, newElement_0_addedEnergy); - chip::JniReferences::GetInstance().AddToList(ChargingTargets, newElement_0); + newElement_0 = env->NewObject(chargingTargetScheduleStructStructClass_1, chargingTargetScheduleStructStructCtor_1, + newElement_0_dayOfWeekforSequence, newElement_0_chargingTargets); + chip::JniReferences::GetInstance().AddToList(ChargingTargetSchedules, newElement_0); } - env->CallVoidMethod(javaCallbackRef, javaMethod, DayOfWeekforSequence, ChargingTargets); + env->CallVoidMethod(javaCallbackRef, javaMethod, ChargingTargetSchedules); } CHIPDoorLockClusterGetWeekDayScheduleResponseCallback::CHIPDoorLockClusterGetWeekDayScheduleResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 7954593df97171..33f0a722a13d97 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -6749,15 +6749,13 @@ class ChipClusters: "commandId": 0x00000005, "commandName": "SetTargets", "args": { - "dayOfWeekforSequence": "int", - "chargingTargets": "ChargingTargetStruct", + "chargingTargetSchedules": "ChargingTargetScheduleStruct", }, }, 0x00000006: { "commandId": 0x00000006, "commandName": "GetTargets", "args": { - "daysToReturn": "int", }, }, 0x00000007: { @@ -6836,18 +6834,6 @@ class ChipClusters: "reportable": True, "writable": True, }, - 0x00000021: { - "attributeName": "NumberOfWeeklyTargets", - "attributeId": 0x00000021, - "type": "int", - "reportable": True, - }, - 0x00000022: { - "attributeName": "NumberOfDailyTargets", - "attributeId": 0x00000022, - "type": "int", - "reportable": True, - }, 0x00000023: { "attributeName": "NextChargeStartTime", "attributeId": 0x00000023, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index ecc9b63039e8bc..622fc30523abf3 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -23913,8 +23913,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="maximumDischargeCurrent", Tag=0x00000008, Type=typing.Optional[int]), ClusterObjectFieldDescriptor(Label="userMaximumChargeCurrent", Tag=0x00000009, Type=typing.Optional[int]), ClusterObjectFieldDescriptor(Label="randomizationDelayWindow", Tag=0x0000000A, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="numberOfWeeklyTargets", Tag=0x00000021, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="numberOfDailyTargets", Tag=0x00000022, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="nextChargeStartTime", Tag=0x00000023, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="nextChargeTargetTime", Tag=0x00000024, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="nextChargeRequiredEnergy", Tag=0x00000025, Type=typing.Union[None, Nullable, int]), @@ -23946,8 +23944,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: maximumDischargeCurrent: 'typing.Optional[int]' = None userMaximumChargeCurrent: 'typing.Optional[int]' = None randomizationDelayWindow: 'typing.Optional[uint]' = None - numberOfWeeklyTargets: 'typing.Optional[uint]' = None - numberOfDailyTargets: 'typing.Optional[uint]' = None nextChargeStartTime: 'typing.Union[None, Nullable, uint]' = None nextChargeTargetTime: 'typing.Union[None, Nullable, uint]' = None nextChargeRequiredEnergy: 'typing.Union[None, Nullable, int]' = None @@ -24061,6 +24057,19 @@ def descriptor(cls) -> ClusterObjectDescriptor: targetSoC: 'typing.Optional[uint]' = None addedEnergy: 'typing.Optional[int]' = None + @dataclass + class ChargingTargetScheduleStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="dayOfWeekforSequence", Tag=0, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="chargingTargets", Tag=1, Type=typing.Optional[typing.List[EnergyEvse.Structs.ChargingTargetStruct]]), + ]) + + dayOfWeekforSequence: 'typing.Optional[uint]' = None + chargingTargets: 'typing.Optional[typing.List[EnergyEvse.Structs.ChargingTargetStruct]]' = None + class Commands: @dataclass class GetTargetsResponse(ClusterCommand): @@ -24073,12 +24082,10 @@ class GetTargetsResponse(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="dayOfWeekforSequence", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="chargingTargets", Tag=1, Type=typing.List[EnergyEvse.Structs.ChargingTargetStruct]), + ClusterObjectFieldDescriptor(Label="chargingTargetSchedules", Tag=0, Type=typing.List[EnergyEvse.Structs.ChargingTargetScheduleStruct]), ]) - dayOfWeekforSequence: 'uint' = 0 - chargingTargets: 'typing.List[EnergyEvse.Structs.ChargingTargetStruct]' = field(default_factory=lambda: []) + chargingTargetSchedules: 'typing.List[EnergyEvse.Structs.ChargingTargetScheduleStruct]' = field(default_factory=lambda: []) @dataclass class Disable(ClusterCommand): @@ -24171,16 +24178,14 @@ class SetTargets(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="dayOfWeekforSequence", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="chargingTargets", Tag=1, Type=typing.List[EnergyEvse.Structs.ChargingTargetStruct]), + ClusterObjectFieldDescriptor(Label="chargingTargetSchedules", Tag=0, Type=typing.List[EnergyEvse.Structs.ChargingTargetScheduleStruct]), ]) @ChipUtility.classproperty def must_use_timed_invoke(cls) -> bool: return True - dayOfWeekforSequence: 'uint' = 0 - chargingTargets: 'typing.List[EnergyEvse.Structs.ChargingTargetStruct]' = field(default_factory=lambda: []) + chargingTargetSchedules: 'typing.List[EnergyEvse.Structs.ChargingTargetScheduleStruct]' = field(default_factory=lambda: []) @dataclass class GetTargets(ClusterCommand): @@ -24193,15 +24198,12 @@ class GetTargets(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="daysToReturn", Tag=0, Type=uint), ]) @ChipUtility.classproperty def must_use_timed_invoke(cls) -> bool: return True - daysToReturn: 'uint' = 0 - @dataclass class ClearTargets(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x00000099 @@ -24396,38 +24398,6 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'typing.Optional[uint]' = None - @dataclass - class NumberOfWeeklyTargets(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000099 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000021 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class NumberOfDailyTargets(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000099 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000022 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - @dataclass class NextChargeStartTime(ClusterAttributeDescriptor): @ChipUtility.classproperty diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index b8c6f1a59ac4bb..24bc13b1a4698a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -3111,12 +3111,6 @@ static BOOL AttributeIsSpecifiedInEnergyEVSECluster(AttributeId aAttributeId) case Attributes::RandomizationDelayWindow::Id: { return YES; } - case Attributes::NumberOfWeeklyTargets::Id: { - return YES; - } - case Attributes::NumberOfDailyTargets::Id: { - return YES; - } case Attributes::NextChargeStartTime::Id: { return YES; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 20633dafe53b0c..5825f1d904acbb 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -8620,28 +8620,6 @@ static id _Nullable DecodeAttributeValueForEnergyEVSECluster(AttributeId aAttrib value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::NumberOfWeeklyTargets::Id: { - using TypeInfo = Attributes::NumberOfWeeklyTargets::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::NumberOfDailyTargets::Id: { - using TypeInfo = Attributes::NumberOfDailyTargets::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } case Attributes::NextChargeStartTime::Id: { using TypeInfo = Attributes::NextChargeStartTime::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 7271543d1242db..ba967eb9bb5009 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -7702,7 +7702,9 @@ MTR_PROVISIONALLY_AVAILABLE * * Allows a client to retrieve the user specified charging targets. */ -- (void)getTargetsWithParams:(MTREnergyEVSEClusterGetTargetsParams *)params completion:(void (^)(MTREnergyEVSEClusterGetTargetsResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)getTargetsWithParams:(MTREnergyEVSEClusterGetTargetsParams * _Nullable)params completion:(void (^)(MTREnergyEVSEClusterGetTargetsResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)getTargetsWithCompletion:(void (^)(MTREnergyEVSEClusterGetTargetsResponseParams * _Nullable data, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; /** * Command ClearTargets * @@ -7782,18 +7784,6 @@ MTR_PROVISIONALLY_AVAILABLE reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; + (void)readAttributeRandomizationDelayWindowWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)readAttributeNumberOfWeeklyTargetsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)subscribeAttributeNumberOfWeeklyTargetsWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeNumberOfWeeklyTargetsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - -- (void)readAttributeNumberOfDailyTargetsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)subscribeAttributeNumberOfDailyTargetsWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeNumberOfDailyTargetsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - - (void)readAttributeNextChargeStartTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributeNextChargeStartTimeWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index c91da32da25ad3..2614e0ef5d9090 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -52332,7 +52332,11 @@ - (void)setTargetsWithParams:(MTREnergyEVSEClusterSetTargetsParams *)params comp queue:self.callbackQueue completion:responseHandler]; } -- (void)getTargetsWithParams:(MTREnergyEVSEClusterGetTargetsParams *)params completion:(void (^)(MTREnergyEVSEClusterGetTargetsResponseParams * _Nullable data, NSError * _Nullable error))completion +- (void)getTargetsWithCompletion:(void (^)(MTREnergyEVSEClusterGetTargetsResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + [self getTargetsWithParams:nil completion:completion]; +} +- (void)getTargetsWithParams:(MTREnergyEVSEClusterGetTargetsParams * _Nullable)params completion:(void (^)(MTREnergyEVSEClusterGetTargetsResponseParams * _Nullable data, NSError * _Nullable error))completion { if (params == nil) { params = [[MTREnergyEVSEClusterGetTargetsParams @@ -52843,78 +52847,6 @@ + (void)readAttributeRandomizationDelayWindowWithClusterStateCache:(MTRClusterSt completion:completion]; } -- (void)readAttributeNumberOfWeeklyTargetsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = EnergyEvse::Attributes::NumberOfWeeklyTargets::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeNumberOfWeeklyTargetsWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = EnergyEvse::Attributes::NumberOfWeeklyTargets::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeNumberOfWeeklyTargetsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = EnergyEvse::Attributes::NumberOfWeeklyTargets::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeNumberOfDailyTargetsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = EnergyEvse::Attributes::NumberOfDailyTargets::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeNumberOfDailyTargetsWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = EnergyEvse::Attributes::NumberOfDailyTargets::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeNumberOfDailyTargetsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = EnergyEvse::Attributes::NumberOfDailyTargets::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - - (void)readAttributeNextChargeStartTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = EnergyEvse::Attributes::NextChargeStartTime::TypeInfo; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 7c46f6315692cb..159a0f0a14b267 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -2669,8 +2669,6 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterEnergyEVSEAttributeMaximumDischargeCurrentID MTR_PROVISIONALLY_AVAILABLE = 0x00000008, MTRAttributeIDTypeClusterEnergyEVSEAttributeUserMaximumChargeCurrentID MTR_PROVISIONALLY_AVAILABLE = 0x00000009, MTRAttributeIDTypeClusterEnergyEVSEAttributeRandomizationDelayWindowID MTR_PROVISIONALLY_AVAILABLE = 0x0000000A, - MTRAttributeIDTypeClusterEnergyEVSEAttributeNumberOfWeeklyTargetsID MTR_PROVISIONALLY_AVAILABLE = 0x00000021, - MTRAttributeIDTypeClusterEnergyEVSEAttributeNumberOfDailyTargetsID MTR_PROVISIONALLY_AVAILABLE = 0x00000022, MTRAttributeIDTypeClusterEnergyEVSEAttributeNextChargeStartTimeID MTR_PROVISIONALLY_AVAILABLE = 0x00000023, MTRAttributeIDTypeClusterEnergyEVSEAttributeNextChargeTargetTimeID MTR_PROVISIONALLY_AVAILABLE = 0x00000024, MTRAttributeIDTypeClusterEnergyEVSEAttributeNextChargeRequiredEnergyID MTR_PROVISIONALLY_AVAILABLE = 0x00000025, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 605c522bb489c1..a4900af82bb2fa 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -3632,7 +3632,9 @@ MTR_PROVISIONALLY_AVAILABLE - (void)startDiagnosticsWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; - (void)setTargetsWithParams:(MTREnergyEVSEClusterSetTargetsParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)getTargetsWithParams:(MTREnergyEVSEClusterGetTargetsParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTREnergyEVSEClusterGetTargetsResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)getTargetsWithParams:(MTREnergyEVSEClusterGetTargetsParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTREnergyEVSEClusterGetTargetsResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)getTargetsWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTREnergyEVSEClusterGetTargetsResponseParams * _Nullable data, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; - (void)clearTargetsWithParams:(MTREnergyEVSEClusterClearTargetsParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; - (void)clearTargetsWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; @@ -3663,10 +3665,6 @@ MTR_PROVISIONALLY_AVAILABLE - (void)writeAttributeRandomizationDelayWindowWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; - (void)writeAttributeRandomizationDelayWindowWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeNumberOfWeeklyTargetsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - -- (NSDictionary * _Nullable)readAttributeNumberOfDailyTargetsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - - (NSDictionary * _Nullable)readAttributeNextChargeStartTimeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary * _Nullable)readAttributeNextChargeTargetTimeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index ae9159d82900a2..2976a21948aa6c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -9997,7 +9997,11 @@ - (void)setTargetsWithParams:(MTREnergyEVSEClusterSetTargetsParams *)params expe completion:responseHandler]; } -- (void)getTargetsWithParams:(MTREnergyEVSEClusterGetTargetsParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTREnergyEVSEClusterGetTargetsResponseParams * _Nullable data, NSError * _Nullable error))completion +- (void)getTargetsWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(void (^)(MTREnergyEVSEClusterGetTargetsResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + [self getTargetsWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)getTargetsWithParams:(MTREnergyEVSEClusterGetTargetsParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTREnergyEVSEClusterGetTargetsResponseParams * _Nullable data, NSError * _Nullable error))completion { if (params == nil) { params = [[MTREnergyEVSEClusterGetTargetsParams @@ -10138,16 +10142,6 @@ - (void)writeAttributeRandomizationDelayWindowWithValue:(NSDictionary * _Nullable)readAttributeNumberOfWeeklyTargetsWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeNumberOfWeeklyTargetsID) params:params]; -} - -- (NSDictionary * _Nullable)readAttributeNumberOfDailyTargetsWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeNumberOfDailyTargetsID) params:params]; -} - - (NSDictionary * _Nullable)readAttributeNextChargeStartTimeWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeNextChargeStartTimeID) params:params]; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 5f90f0d869be60..a98329f02b5a38 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -6078,9 +6078,7 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTREnergyEVSEClusterGetTargetsResponseParams : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull dayOfWeekforSequence MTR_PROVISIONALLY_AVAILABLE; - -@property (nonatomic, copy) NSArray * _Nonnull chargingTargets MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nonnull chargingTargetSchedules MTR_PROVISIONALLY_AVAILABLE; /** * Initialize an MTREnergyEVSEClusterGetTargetsResponseParams with a response-value dictionary @@ -6221,9 +6219,7 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTREnergyEVSEClusterSetTargetsParams : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull dayOfWeekforSequence MTR_PROVISIONALLY_AVAILABLE; - -@property (nonatomic, copy) NSArray * _Nonnull chargingTargets MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nonnull chargingTargetSchedules MTR_PROVISIONALLY_AVAILABLE; /** * Controls whether the command is a timed command (using Timed Invoke). * @@ -6252,8 +6248,6 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTREnergyEVSEClusterGetTargetsParams : NSObject - -@property (nonatomic, copy) NSNumber * _Nonnull daysToReturn MTR_PROVISIONALLY_AVAILABLE; /** * Controls whether the command is a timed command (using Timed Invoke). * diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 4090cfe1b4ed09..6994220b206bfd 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -16835,9 +16835,7 @@ - (instancetype)init { if (self = [super init]) { - _dayOfWeekforSequence = @(0); - - _chargingTargets = [NSArray array]; + _chargingTargetSchedules = [NSArray array]; } return self; } @@ -16846,15 +16844,14 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; { auto other = [[MTREnergyEVSEClusterGetTargetsResponseParams alloc] init]; - other.dayOfWeekforSequence = self.dayOfWeekforSequence; - other.chargingTargets = self.chargingTargets; + other.chargingTargetSchedules = self.chargingTargetSchedules; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: dayOfWeekforSequence:%@; chargingTargets:%@; >", NSStringFromClass([self class]), _dayOfWeekforSequence, _chargingTargets]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: chargingTargetSchedules:%@; >", NSStringFromClass([self class]), _chargingTargetSchedules]; return descriptionString; } @@ -16904,27 +16901,48 @@ @implementation MTREnergyEVSEClusterGetTargetsResponseParams (InternalMethods) - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::EnergyEvse::Commands::GetTargetsResponse::DecodableType &)decodableStruct { - { - self.dayOfWeekforSequence = [NSNumber numberWithUnsignedChar:decodableStruct.dayOfWeekforSequence.Raw()]; - } { { // Scope for our temporary variables auto * array_0 = [NSMutableArray new]; - auto iter_0 = decodableStruct.chargingTargets.begin(); + auto iter_0 = decodableStruct.chargingTargetSchedules.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - MTREnergyEVSEClusterChargingTargetStruct * newElement_0; - newElement_0 = [MTREnergyEVSEClusterChargingTargetStruct new]; - newElement_0.targetTimeMinutesPastMidnight = [NSNumber numberWithUnsignedShort:entry_0.targetTimeMinutesPastMidnight]; - if (entry_0.targetSoC.HasValue()) { - newElement_0.targetSoC = [NSNumber numberWithUnsignedChar:entry_0.targetSoC.Value()]; + MTREnergyEVSEClusterChargingTargetScheduleStruct * newElement_0; + newElement_0 = [MTREnergyEVSEClusterChargingTargetScheduleStruct new]; + if (entry_0.dayOfWeekforSequence.HasValue()) { + newElement_0.dayOfWeekforSequence = [NSNumber numberWithUnsignedChar:entry_0.dayOfWeekforSequence.Value().Raw()]; } else { - newElement_0.targetSoC = nil; + newElement_0.dayOfWeekforSequence = nil; } - if (entry_0.addedEnergy.HasValue()) { - newElement_0.addedEnergy = [NSNumber numberWithLongLong:entry_0.addedEnergy.Value()]; + if (entry_0.chargingTargets.HasValue()) { + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + auto iter_3 = entry_0.chargingTargets.Value().begin(); + while (iter_3.Next()) { + auto & entry_3 = iter_3.GetValue(); + MTREnergyEVSEClusterChargingTargetStruct * newElement_3; + newElement_3 = [MTREnergyEVSEClusterChargingTargetStruct new]; + newElement_3.targetTimeMinutesPastMidnight = [NSNumber numberWithUnsignedShort:entry_3.targetTimeMinutesPastMidnight]; + if (entry_3.targetSoC.HasValue()) { + newElement_3.targetSoC = [NSNumber numberWithUnsignedChar:entry_3.targetSoC.Value()]; + } else { + newElement_3.targetSoC = nil; + } + if (entry_3.addedEnergy.HasValue()) { + newElement_3.addedEnergy = [NSNumber numberWithLongLong:entry_3.addedEnergy.Value()]; + } else { + newElement_3.addedEnergy = nil; + } + [array_3 addObject:newElement_3]; + } + CHIP_ERROR err = iter_3.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + newElement_0.chargingTargets = array_3; + } } else { - newElement_0.addedEnergy = nil; + newElement_0.chargingTargets = nil; } [array_0 addObject:newElement_0]; } @@ -16932,7 +16950,7 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::EnergyEv if (err != CHIP_NO_ERROR) { return err; } - self.chargingTargets = array_0; + self.chargingTargetSchedules = array_0; } } return CHIP_NO_ERROR; @@ -17277,9 +17295,7 @@ - (instancetype)init { if (self = [super init]) { - _dayOfWeekforSequence = @(0); - - _chargingTargets = [NSArray array]; + _chargingTargetSchedules = [NSArray array]; _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -17290,8 +17306,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; { auto other = [[MTREnergyEVSEClusterSetTargetsParams alloc] init]; - other.dayOfWeekforSequence = self.dayOfWeekforSequence; - other.chargingTargets = self.chargingTargets; + other.chargingTargetSchedules = self.chargingTargetSchedules; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -17300,7 +17315,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: dayOfWeekforSequence:%@; chargingTargets:%@; >", NSStringFromClass([self class]), _dayOfWeekforSequence, _chargingTargets]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: chargingTargetSchedules:%@; >", NSStringFromClass([self class]), _chargingTargetSchedules]; return descriptionString; } @@ -17312,38 +17327,63 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { chip::app::Clusters::EnergyEvse::Commands::SetTargets::Type encodableStruct; ListFreer listFreer; - { - encodableStruct.dayOfWeekforSequence = static_cast>(self.dayOfWeekforSequence.unsignedCharValue); - } { { - using ListType_0 = std::remove_reference_t; + using ListType_0 = std::remove_reference_t; using ListMemberType_0 = ListMemberTypeGetter::Type; - if (self.chargingTargets.count != 0) { - auto * listHolder_0 = new ListHolder(self.chargingTargets.count); + if (self.chargingTargetSchedules.count != 0) { + auto * listHolder_0 = new ListHolder(self.chargingTargetSchedules.count); if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { return CHIP_ERROR_INVALID_ARGUMENT; } listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < self.chargingTargets.count; ++i_0) { - if (![self.chargingTargets[i_0] isKindOfClass:[MTREnergyEVSEClusterChargingTargetStruct class]]) { + for (size_t i_0 = 0; i_0 < self.chargingTargetSchedules.count; ++i_0) { + if (![self.chargingTargetSchedules[i_0] isKindOfClass:[MTREnergyEVSEClusterChargingTargetScheduleStruct class]]) { // Wrong kind of value. return CHIP_ERROR_INVALID_ARGUMENT; } - auto element_0 = (MTREnergyEVSEClusterChargingTargetStruct *) self.chargingTargets[i_0]; - listHolder_0->mList[i_0].targetTimeMinutesPastMidnight = element_0.targetTimeMinutesPastMidnight.unsignedShortValue; - if (element_0.targetSoC != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].targetSoC.Emplace(); - definedValue_2 = element_0.targetSoC.unsignedCharValue; + auto element_0 = (MTREnergyEVSEClusterChargingTargetScheduleStruct *) self.chargingTargetSchedules[i_0]; + if (element_0.dayOfWeekforSequence != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].dayOfWeekforSequence.Emplace(); + definedValue_2 = static_cast>(element_0.dayOfWeekforSequence.unsignedCharValue); } - if (element_0.addedEnergy != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].addedEnergy.Emplace(); - definedValue_2 = element_0.addedEnergy.longLongValue; + if (element_0.chargingTargets != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].chargingTargets.Emplace(); + { + using ListType_3 = std::remove_reference_t; + using ListMemberType_3 = ListMemberTypeGetter::Type; + if (element_0.chargingTargets.count != 0) { + auto * listHolder_3 = new ListHolder(element_0.chargingTargets.count); + if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_3); + for (size_t i_3 = 0; i_3 < element_0.chargingTargets.count; ++i_3) { + if (![element_0.chargingTargets[i_3] isKindOfClass:[MTREnergyEVSEClusterChargingTargetStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_3 = (MTREnergyEVSEClusterChargingTargetStruct *) element_0.chargingTargets[i_3]; + listHolder_3->mList[i_3].targetTimeMinutesPastMidnight = element_3.targetTimeMinutesPastMidnight.unsignedShortValue; + if (element_3.targetSoC != nil) { + auto & definedValue_5 = listHolder_3->mList[i_3].targetSoC.Emplace(); + definedValue_5 = element_3.targetSoC.unsignedCharValue; + } + if (element_3.addedEnergy != nil) { + auto & definedValue_5 = listHolder_3->mList[i_3].addedEnergy.Emplace(); + definedValue_5 = element_3.addedEnergy.longLongValue; + } + } + definedValue_2 = ListType_3(listHolder_3->mList, element_0.chargingTargets.count); + } else { + definedValue_2 = ListType_3(); + } + } } } - encodableStruct.chargingTargets = ListType_0(listHolder_0->mList, self.chargingTargets.count); + encodableStruct.chargingTargetSchedules = ListType_0(listHolder_0->mList, self.chargingTargetSchedules.count); } else { - encodableStruct.chargingTargets = ListType_0(); + encodableStruct.chargingTargetSchedules = ListType_0(); } } } @@ -17390,8 +17430,6 @@ @implementation MTREnergyEVSEClusterGetTargetsParams - (instancetype)init { if (self = [super init]) { - - _daysToReturn = @(0); _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -17402,7 +17440,6 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; { auto other = [[MTREnergyEVSEClusterGetTargetsParams alloc] init]; - other.daysToReturn = self.daysToReturn; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -17411,7 +17448,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: daysToReturn:%@; >", NSStringFromClass([self class]), _daysToReturn]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; return descriptionString; } @@ -17423,9 +17460,6 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { chip::app::Clusters::EnergyEvse::Commands::GetTargets::Type encodableStruct; ListFreer listFreer; - { - encodableStruct.daysToReturn = static_cast>(self.daysToReturn.unsignedCharValue); - } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index c952dc3da5faa2..1d155ecd860e9c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -1285,6 +1285,12 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nullable addedEnergy MTR_PROVISIONALLY_AVAILABLE; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTREnergyEVSEClusterChargingTargetScheduleStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nullable dayOfWeekforSequence MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nullable chargingTargets MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTREnergyEVSEClusterEVConnectedEvent : NSObject @property (nonatomic, copy) NSNumber * _Nonnull sessionID MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 9324a04d612704..817b54dd8ad33c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -5261,6 +5261,36 @@ - (NSString *)description @end +@implementation MTREnergyEVSEClusterChargingTargetScheduleStruct +- (instancetype)init +{ + if (self = [super init]) { + + _dayOfWeekforSequence = nil; + + _chargingTargets = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTREnergyEVSEClusterChargingTargetScheduleStruct alloc] init]; + + other.dayOfWeekforSequence = self.dayOfWeekforSequence; + other.chargingTargets = self.chargingTargets; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: dayOfWeekforSequence:%@; chargingTargets:%@; >", NSStringFromClass([self class]), _dayOfWeekforSequence, _chargingTargets]; + return descriptionString; +} + +@end + @implementation MTREnergyEVSEClusterEVConnectedEvent - (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 bb8bea1d96e7f9..2b6fd6141b5888 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 @@ -11146,68 +11146,6 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) } // namespace RandomizationDelayWindow -namespace NumberOfWeeklyTargets { - -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::EnergyEvse::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -} // namespace NumberOfWeeklyTargets - -namespace NumberOfDailyTargets { - -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::EnergyEvse::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -} // namespace NumberOfDailyTargets - namespace NextChargeStartTime { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 8eac5af1be7ff0..47d04b2b2df1ae 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 @@ -2142,16 +2142,6 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // elapsed_s EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace RandomizationDelayWindow -namespace NumberOfWeeklyTargets { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); -} // namespace NumberOfWeeklyTargets - -namespace NumberOfDailyTargets { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); -} // namespace NumberOfDailyTargets - namespace NextChargeStartTime { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // epoch_s EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); 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 834f1faa123612..9e5a7b34497209 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 @@ -15857,10 +15857,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } // namespace ChargingTargetStruct -} // namespace Structs -namespace Commands { -namespace GetTargetsResponse { +namespace ChargingTargetScheduleStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; @@ -15898,6 +15896,44 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } + +} // namespace ChargingTargetScheduleStruct +} // namespace Structs + +namespace Commands { +namespace GetTargetsResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kChargingTargetSchedules), chargingTargetSchedules); + 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::kChargingTargetSchedules)) + { + err = DataModel::Decode(reader, chargingTargetSchedules); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} } // namespace GetTargetsResponse. namespace Disable { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const @@ -16026,8 +16062,7 @@ namespace SetTargets { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kDayOfWeekforSequence), dayOfWeekforSequence); - encoder.Encode(to_underlying(Fields::kChargingTargets), chargingTargets); + encoder.Encode(to_underlying(Fields::kChargingTargetSchedules), chargingTargetSchedules); return encoder.Finalize(); } @@ -16045,13 +16080,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kDayOfWeekforSequence)) + if (__context_tag == to_underlying(Fields::kChargingTargetSchedules)) { - err = DataModel::Decode(reader, dayOfWeekforSequence); - } - else if (__context_tag == to_underlying(Fields::kChargingTargets)) - { - err = DataModel::Decode(reader, chargingTargets); + err = DataModel::Decode(reader, chargingTargetSchedules); } else { @@ -16065,7 +16096,6 @@ namespace GetTargets { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kDaysToReturn), daysToReturn); return encoder.Finalize(); } @@ -16079,19 +16109,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { return std::get(__element); } - - CHIP_ERROR err = CHIP_NO_ERROR; - const uint8_t __context_tag = std::get(__element); - - if (__context_tag == to_underlying(Fields::kDaysToReturn)) - { - err = DataModel::Decode(reader, daysToReturn); - } - else - { - } - - ReturnErrorOnFailure(err); } } } // namespace GetTargets. @@ -16144,10 +16161,6 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre return DataModel::Decode(reader, userMaximumChargeCurrent); case Attributes::RandomizationDelayWindow::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, randomizationDelayWindow); - case Attributes::NumberOfWeeklyTargets::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, numberOfWeeklyTargets); - case Attributes::NumberOfDailyTargets::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, numberOfDailyTargets); case Attributes::NextChargeStartTime::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, nextChargeStartTime); case Attributes::NextChargeTargetTime::TypeInfo::GetAttributeId(): 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 c4fc5f675fae30..cad9c6d003855e 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 @@ -22004,6 +22004,36 @@ struct Type using DecodableType = Type; } // namespace ChargingTargetStruct +namespace ChargingTargetScheduleStruct { +enum class Fields : uint8_t +{ + kDayOfWeekforSequence = 0, + kChargingTargets = 1, +}; + +struct Type +{ +public: + Optional> dayOfWeekforSequence; + Optional> chargingTargets; + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + Optional> dayOfWeekforSequence; + Optional> chargingTargets; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; +}; + +} // namespace ChargingTargetScheduleStruct } // namespace Structs namespace Commands { @@ -22055,8 +22085,7 @@ namespace Commands { namespace GetTargetsResponse { enum class Fields : uint8_t { - kDayOfWeekforSequence = 0, - kChargingTargets = 1, + kChargingTargetSchedules = 0, }; struct Type @@ -22066,8 +22095,7 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::GetTargetsResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } - chip::BitMask dayOfWeekforSequence = static_cast>(0); - DataModel::List chargingTargets; + DataModel::List chargingTargetSchedules; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -22082,8 +22110,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::GetTargetsResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } - chip::BitMask dayOfWeekforSequence = static_cast>(0); - DataModel::DecodableList chargingTargets; + DataModel::DecodableList chargingTargetSchedules; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace GetTargetsResponse @@ -22219,8 +22246,7 @@ struct DecodableType namespace SetTargets { enum class Fields : uint8_t { - kDayOfWeekforSequence = 0, - kChargingTargets = 1, + kChargingTargetSchedules = 0, }; struct Type @@ -22230,8 +22256,7 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::SetTargets::Id; } static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } - chip::BitMask dayOfWeekforSequence = static_cast>(0); - DataModel::List chargingTargets; + DataModel::List chargingTargetSchedules; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -22246,15 +22271,13 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::SetTargets::Id; } static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } - chip::BitMask dayOfWeekforSequence = static_cast>(0); - DataModel::DecodableList chargingTargets; + DataModel::DecodableList chargingTargetSchedules; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace SetTargets namespace GetTargets { enum class Fields : uint8_t { - kDaysToReturn = 0, }; struct Type @@ -22264,8 +22287,6 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::GetTargets::Id; } static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } - chip::BitMask daysToReturn = static_cast>(0); - CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; using ResponseType = Clusters::EnergyEvse::Commands::GetTargetsResponse::DecodableType; @@ -22279,7 +22300,6 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::GetTargets::Id; } static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } - chip::BitMask daysToReturn = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace GetTargets @@ -22447,30 +22467,6 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace RandomizationDelayWindow -namespace NumberOfWeeklyTargets { -struct TypeInfo -{ - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; - - static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::NumberOfWeeklyTargets::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace NumberOfWeeklyTargets -namespace NumberOfDailyTargets { -struct TypeInfo -{ - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; - - static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::NumberOfDailyTargets::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace NumberOfDailyTargets namespace NextChargeStartTime { struct TypeInfo { @@ -22674,8 +22670,6 @@ struct TypeInfo Attributes::MaximumDischargeCurrent::TypeInfo::DecodableType maximumDischargeCurrent = static_cast(0); Attributes::UserMaximumChargeCurrent::TypeInfo::DecodableType userMaximumChargeCurrent = static_cast(0); Attributes::RandomizationDelayWindow::TypeInfo::DecodableType randomizationDelayWindow = static_cast(0); - Attributes::NumberOfWeeklyTargets::TypeInfo::DecodableType numberOfWeeklyTargets = static_cast(0); - Attributes::NumberOfDailyTargets::TypeInfo::DecodableType numberOfDailyTargets = static_cast(0); Attributes::NextChargeStartTime::TypeInfo::DecodableType nextChargeStartTime; Attributes::NextChargeTargetTime::TypeInfo::DecodableType nextChargeTargetTime; Attributes::NextChargeRequiredEnergy::TypeInfo::DecodableType nextChargeRequiredEnergy; 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 4038c9c9c41723..10c5cc365f632f 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 @@ -3870,14 +3870,6 @@ namespace RandomizationDelayWindow { static constexpr AttributeId Id = 0x0000000A; } // namespace RandomizationDelayWindow -namespace NumberOfWeeklyTargets { -static constexpr AttributeId Id = 0x00000021; -} // namespace NumberOfWeeklyTargets - -namespace NumberOfDailyTargets { -static constexpr AttributeId Id = 0x00000022; -} // namespace NumberOfDailyTargets - namespace NextChargeStartTime { static constexpr AttributeId Id = 0x00000023; } // namespace NextChargeStartTime diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index a7645ac8f0c77f..9a522434590c2b 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -7172,8 +7172,6 @@ class DeviceEnergyManagementRequestConstraintBasedForecast : public ClusterComma | * MaximumDischargeCurrent | 0x0008 | | * UserMaximumChargeCurrent | 0x0009 | | * RandomizationDelayWindow | 0x000A | -| * NumberOfWeeklyTargets | 0x0021 | -| * NumberOfDailyTargets | 0x0022 | | * NextChargeStartTime | 0x0023 | | * NextChargeTargetTime | 0x0024 | | * NextChargeRequiredEnergy | 0x0025 | @@ -7360,10 +7358,9 @@ class EnergyEvseSetTargets : public ClusterCommand { public: EnergyEvseSetTargets(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("set-targets", credsIssuerConfig), mComplex_ChargingTargets(&mRequest.chargingTargets) + ClusterCommand("set-targets", credsIssuerConfig), mComplex_ChargingTargetSchedules(&mRequest.chargingTargetSchedules) { - AddArgument("DayOfWeekforSequence", 0, UINT8_MAX, &mRequest.dayOfWeekforSequence); - AddArgument("ChargingTargets", &mComplex_ChargingTargets); + AddArgument("ChargingTargetSchedules", &mComplex_ChargingTargetSchedules); ClusterCommand::AddArguments(); } @@ -7390,8 +7387,9 @@ class EnergyEvseSetTargets : public ClusterCommand private: chip::app::Clusters::EnergyEvse::Commands::SetTargets::Type mRequest; - TypedComplexArgument> - mComplex_ChargingTargets; + TypedComplexArgument< + chip::app::DataModel::List> + mComplex_ChargingTargetSchedules; }; /* @@ -7402,7 +7400,6 @@ class EnergyEvseGetTargets : public ClusterCommand public: EnergyEvseGetTargets(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("get-targets", credsIssuerConfig) { - AddArgument("DaysToReturn", 0, UINT8_MAX, &mRequest.daysToReturn); ClusterCommand::AddArguments(); } @@ -19906,11 +19903,9 @@ void registerClusterEnergyEvse(Commands & commands, CredentialIssuerCommands * c make_unique(Id, "user-maximum-charge-current", Attributes::UserMaximumChargeCurrent::Id, credsIssuerConfig), // make_unique(Id, "randomization-delay-window", Attributes::RandomizationDelayWindow::Id, - credsIssuerConfig), // - make_unique(Id, "number-of-weekly-targets", Attributes::NumberOfWeeklyTargets::Id, credsIssuerConfig), // - make_unique(Id, "number-of-daily-targets", Attributes::NumberOfDailyTargets::Id, credsIssuerConfig), // - make_unique(Id, "next-charge-start-time", Attributes::NextChargeStartTime::Id, credsIssuerConfig), // - make_unique(Id, "next-charge-target-time", Attributes::NextChargeTargetTime::Id, credsIssuerConfig), // + credsIssuerConfig), // + make_unique(Id, "next-charge-start-time", Attributes::NextChargeStartTime::Id, credsIssuerConfig), // + make_unique(Id, "next-charge-target-time", Attributes::NextChargeTargetTime::Id, credsIssuerConfig), // make_unique(Id, "next-charge-required-energy", Attributes::NextChargeRequiredEnergy::Id, credsIssuerConfig), // make_unique(Id, "next-charge-target-so-c", Attributes::NextChargeTargetSoC::Id, credsIssuerConfig), // @@ -19958,10 +19953,6 @@ void registerClusterEnergyEvse(Commands & commands, CredentialIssuerCommands * c make_unique>(Id, "randomization-delay-window", 0, UINT32_MAX, Attributes::RandomizationDelayWindow::Id, WriteCommandType::kWrite, credsIssuerConfig), // - make_unique>(Id, "number-of-weekly-targets", 0, UINT8_MAX, Attributes::NumberOfWeeklyTargets::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "number-of-daily-targets", 0, UINT8_MAX, Attributes::NumberOfDailyTargets::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>(Id, "next-charge-start-time", 0, UINT32_MAX, Attributes::NextChargeStartTime::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -20024,10 +20015,7 @@ void registerClusterEnergyEvse(Commands & commands, CredentialIssuerCommands * c make_unique(Id, "user-maximum-charge-current", Attributes::UserMaximumChargeCurrent::Id, credsIssuerConfig), // make_unique(Id, "randomization-delay-window", Attributes::RandomizationDelayWindow::Id, - credsIssuerConfig), // - make_unique(Id, "number-of-weekly-targets", Attributes::NumberOfWeeklyTargets::Id, credsIssuerConfig), // - make_unique(Id, "number-of-daily-targets", Attributes::NumberOfDailyTargets::Id, credsIssuerConfig), // make_unique(Id, "next-charge-start-time", Attributes::NextChargeStartTime::Id, credsIssuerConfig), // make_unique(Id, "next-charge-target-time", Attributes::NextChargeTargetTime::Id, credsIssuerConfig), // make_unique(Id, "next-charge-required-energy", Attributes::NextChargeRequiredEnergy::Id, diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index acbd349dc09dfc..ea06951314b7dd 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -3249,6 +3249,40 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::EnergyEvse::Structs::C ComplexArgumentParser::Finalize(request.addedEnergy); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::EnergyEvse::Structs::ChargingTargetScheduleStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + char labelWithMember[kMaxLabelLength]; + if (value.isMember("dayOfWeekforSequence")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "dayOfWeekforSequence"); + ReturnErrorOnFailure( + ComplexArgumentParser::Setup(labelWithMember, request.dayOfWeekforSequence, value["dayOfWeekforSequence"])); + } + valueCopy.removeMember("dayOfWeekforSequence"); + + if (value.isMember("chargingTargets")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "chargingTargets"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.chargingTargets, value["chargingTargets"])); + } + valueCopy.removeMember("chargingTargets"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::EnergyEvse::Structs::ChargingTargetScheduleStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.dayOfWeekforSequence); + ComplexArgumentParser::Finalize(request.chargingTargets); +} + 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 445524c97f85e4..a97d35e2ac7f0b 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -378,6 +378,11 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::EnergyEvse::Str static void Finalize(chip::app::Clusters::EnergyEvse::Structs::ChargingTargetStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::EnergyEvse::Structs::ChargingTargetScheduleStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::EnergyEvse::Structs::ChargingTargetScheduleStruct::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 2da87471d0a3c0..446d77b0aee60f 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -2890,6 +2890,32 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::EnergyEvse::Structs::ChargingTargetScheduleStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("DayOfWeekforSequence", indent + 1, value.dayOfWeekforSequence); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DayOfWeekforSequence'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ChargingTargets", indent + 1, value.chargingTargets); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ChargingTargets'"); + 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) { @@ -6964,8 +6990,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const EnergyEvse::Commands::GetTargetsResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("dayOfWeekforSequence", indent + 1, value.dayOfWeekforSequence)); - ReturnErrorOnFailure(DataModelLogger::LogValue("chargingTargets", indent + 1, value.chargingTargets)); + ReturnErrorOnFailure(DataModelLogger::LogValue("chargingTargetSchedules", indent + 1, value.chargingTargetSchedules)); DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } @@ -12062,16 +12087,6 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("RandomizationDelayWindow", 1, value); } - case EnergyEvse::Attributes::NumberOfWeeklyTargets::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("NumberOfWeeklyTargets", 1, value); - } - case EnergyEvse::Attributes::NumberOfDailyTargets::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("NumberOfDailyTargets", 1, value); - } case EnergyEvse::Attributes::NextChargeStartTime::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); 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 2880226ecb9d14..89b8e51c0d0799 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -238,6 +238,9 @@ 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::ChargingTargetStruct::DecodableType & value); +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::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 8b7c3cfbf53724..6e4ec40955e85b 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -80633,8 +80633,6 @@ class SubscribeAttributeDeviceEnergyManagementClusterRevision : public Subscribe | * MaximumDischargeCurrent | 0x0008 | | * UserMaximumChargeCurrent | 0x0009 | | * RandomizationDelayWindow | 0x000A | -| * NumberOfWeeklyTargets | 0x0021 | -| * NumberOfDailyTargets | 0x0022 | | * NextChargeStartTime | 0x0023 | | * NextChargeTargetTime | 0x0024 | | * NextChargeRequiredEnergy | 0x0025 | @@ -80895,13 +80893,10 @@ class EnergyEvseSetTargets : public ClusterCommand { public: EnergyEvseSetTargets() : ClusterCommand("set-targets") - , mComplex_ChargingTargets(&mRequest.chargingTargets) + , mComplex_ChargingTargetSchedules(&mRequest.chargingTargetSchedules) { #if MTR_ENABLE_PROVISIONAL - AddArgument("DayOfWeekforSequence", 0, UINT8_MAX, &mRequest.dayOfWeekforSequence); -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - AddArgument("ChargingTargets", &mComplex_ChargingTargets); + AddArgument("ChargingTargetSchedules", &mComplex_ChargingTargetSchedules); #endif // MTR_ENABLE_PROVISIONAL ClusterCommand::AddArguments(); } @@ -80917,29 +80912,44 @@ class EnergyEvseSetTargets : public ClusterCommand { __auto_type * cluster = [[MTRBaseClusterEnergyEVSE alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; __auto_type * params = [[MTREnergyEVSEClusterSetTargetsParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; -#if MTR_ENABLE_PROVISIONAL - params.dayOfWeekforSequence = [NSNumber numberWithUnsignedChar:mRequest.dayOfWeekforSequence.Raw()]; -#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL { // Scope for our temporary variables auto * array_0 = [NSMutableArray new]; - for (auto & entry_0 : mRequest.chargingTargets) { - MTREnergyEVSEClusterChargingTargetStruct * newElement_0; - newElement_0 = [MTREnergyEVSEClusterChargingTargetStruct new]; - newElement_0.targetTimeMinutesPastMidnight = [NSNumber numberWithUnsignedShort:entry_0.targetTimeMinutesPastMidnight]; - if (entry_0.targetSoC.HasValue()) { - newElement_0.targetSoC = [NSNumber numberWithUnsignedChar:entry_0.targetSoC.Value()]; + for (auto & entry_0 : mRequest.chargingTargetSchedules) { + MTREnergyEVSEClusterChargingTargetScheduleStruct * newElement_0; + newElement_0 = [MTREnergyEVSEClusterChargingTargetScheduleStruct new]; + if (entry_0.dayOfWeekforSequence.HasValue()) { + newElement_0.dayOfWeekforSequence = [NSNumber numberWithUnsignedChar:entry_0.dayOfWeekforSequence.Value().Raw()]; } else { - newElement_0.targetSoC = nil; + newElement_0.dayOfWeekforSequence = nil; } - if (entry_0.addedEnergy.HasValue()) { - newElement_0.addedEnergy = [NSNumber numberWithLongLong:entry_0.addedEnergy.Value()]; + if (entry_0.chargingTargets.HasValue()) { + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + for (auto & entry_3 : entry_0.chargingTargets.Value()) { + MTREnergyEVSEClusterChargingTargetStruct * newElement_3; + newElement_3 = [MTREnergyEVSEClusterChargingTargetStruct new]; + newElement_3.targetTimeMinutesPastMidnight = [NSNumber numberWithUnsignedShort:entry_3.targetTimeMinutesPastMidnight]; + if (entry_3.targetSoC.HasValue()) { + newElement_3.targetSoC = [NSNumber numberWithUnsignedChar:entry_3.targetSoC.Value()]; + } else { + newElement_3.targetSoC = nil; + } + if (entry_3.addedEnergy.HasValue()) { + newElement_3.addedEnergy = [NSNumber numberWithLongLong:entry_3.addedEnergy.Value()]; + } else { + newElement_3.addedEnergy = nil; + } + [array_3 addObject:newElement_3]; + } + newElement_0.chargingTargets = array_3; + } } else { - newElement_0.addedEnergy = nil; + newElement_0.chargingTargets = nil; } [array_0 addObject:newElement_0]; } - params.chargingTargets = array_0; + params.chargingTargetSchedules = array_0; } #endif // MTR_ENABLE_PROVISIONAL uint16_t repeatCount = mRepeatCount.ValueOr(1); @@ -80963,7 +80973,7 @@ class EnergyEvseSetTargets : public ClusterCommand { private: chip::app::Clusters::EnergyEvse::Commands::SetTargets::Type mRequest; - TypedComplexArgument> mComplex_ChargingTargets; + TypedComplexArgument> mComplex_ChargingTargetSchedules; }; #endif // MTR_ENABLE_PROVISIONAL @@ -80976,9 +80986,6 @@ class EnergyEvseGetTargets : public ClusterCommand { EnergyEvseGetTargets() : ClusterCommand("get-targets") { -#if MTR_ENABLE_PROVISIONAL - AddArgument("DaysToReturn", 0, UINT8_MAX, &mRequest.daysToReturn); -#endif // MTR_ENABLE_PROVISIONAL ClusterCommand::AddArguments(); } @@ -80993,9 +81000,6 @@ class EnergyEvseGetTargets : public ClusterCommand { __auto_type * cluster = [[MTRBaseClusterEnergyEVSE alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; __auto_type * params = [[MTREnergyEVSEClusterGetTargetsParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; -#if MTR_ENABLE_PROVISIONAL - params.daysToReturn = [NSNumber numberWithUnsignedChar:mRequest.daysToReturn.Raw()]; -#endif // MTR_ENABLE_PROVISIONAL uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -81022,7 +81026,6 @@ class EnergyEvseGetTargets : public ClusterCommand { } private: - chip::app::Clusters::EnergyEvse::Commands::GetTargets::Type mRequest; }; #endif // MTR_ENABLE_PROVISIONAL @@ -82092,176 +82095,6 @@ class SubscribeAttributeEnergyEvseRandomizationDelayWindow : public SubscribeAtt #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL -/* - * Attribute NumberOfWeeklyTargets - */ -class ReadEnergyEvseNumberOfWeeklyTargets : public ReadAttribute { -public: - ReadEnergyEvseNumberOfWeeklyTargets() - : ReadAttribute("number-of-weekly-targets") - { - } - - ~ReadEnergyEvseNumberOfWeeklyTargets() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyEvse::Attributes::NumberOfWeeklyTargets::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 = [[MTRBaseClusterEnergyEVSE alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - [cluster readAttributeNumberOfWeeklyTargetsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EnergyEVSE.NumberOfWeeklyTargets response %@", [value description]); - if (error == nil) { - RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); - } else { - LogNSError("EnergyEVSE NumberOfWeeklyTargets read Error", error); - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeEnergyEvseNumberOfWeeklyTargets : public SubscribeAttribute { -public: - SubscribeAttributeEnergyEvseNumberOfWeeklyTargets() - : SubscribeAttribute("number-of-weekly-targets") - { - } - - ~SubscribeAttributeEnergyEvseNumberOfWeeklyTargets() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::EnergyEvse::Attributes::NumberOfWeeklyTargets::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 = [[MTRBaseClusterEnergyEVSE 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 subscribeAttributeNumberOfWeeklyTargetsWithParams:params - subscriptionEstablished:^() { mSubscriptionEstablished = YES; } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EnergyEVSE.NumberOfWeeklyTargets 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 NumberOfDailyTargets - */ -class ReadEnergyEvseNumberOfDailyTargets : public ReadAttribute { -public: - ReadEnergyEvseNumberOfDailyTargets() - : ReadAttribute("number-of-daily-targets") - { - } - - ~ReadEnergyEvseNumberOfDailyTargets() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyEvse::Attributes::NumberOfDailyTargets::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 = [[MTRBaseClusterEnergyEVSE alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - [cluster readAttributeNumberOfDailyTargetsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EnergyEVSE.NumberOfDailyTargets response %@", [value description]); - if (error == nil) { - RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); - } else { - LogNSError("EnergyEVSE NumberOfDailyTargets read Error", error); - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeEnergyEvseNumberOfDailyTargets : public SubscribeAttribute { -public: - SubscribeAttributeEnergyEvseNumberOfDailyTargets() - : SubscribeAttribute("number-of-daily-targets") - { - } - - ~SubscribeAttributeEnergyEvseNumberOfDailyTargets() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::EnergyEvse::Attributes::NumberOfDailyTargets::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 = [[MTRBaseClusterEnergyEVSE 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 subscribeAttributeNumberOfDailyTargetsWithParams:params - subscriptionEstablished:^() { mSubscriptionEstablished = YES; } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EnergyEVSE.NumberOfDailyTargets 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 NextChargeStartTime */ @@ -179242,14 +179075,6 @@ void registerClusterEnergyEvse(Commands & commands) 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(), //