diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 308d0a688a46fe..fcd314e5de3b64 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -117,6 +117,7 @@ jobs: src/app/zap-templates/zcl/data-model/chip/microwave-oven-mode-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/fault-injection-cluster.xml \ diff --git a/examples/chip-tool/templates/logging/DataModelLogger-src.zapt b/examples/chip-tool/templates/logging/DataModelLogger-src.zapt index 167021f49577d2..e6c735465dbfc2 100644 --- a/examples/chip-tool/templates/logging/DataModelLogger-src.zapt +++ b/examples/chip-tool/templates/logging/DataModelLogger-src.zapt @@ -162,7 +162,7 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip {{/first}} case {{asUpperCamelCase parent.name}}::Events::{{asUpperCamelCase name}}::Id: { - {{zapTypeToDecodableClusterObjectType name ns=parent.name forceNotOptional=true}} value; + {{asUpperCamelCase parent.name}}::Events::{{asUpperCamelCase name}}::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("{{name}}", 1, value); } diff --git a/scripts/rules.matterlint b/scripts/rules.matterlint index 5f6883198c57f9..e5220517096ac1 100644 --- a/scripts/rules.matterlint +++ b/scripts/rules.matterlint @@ -28,6 +28,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/microwave-oven-mode-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/fixed-label-cluster.xml"; diff --git a/src/app/zap-templates/zcl/data-model/all.xml b/src/app/zap-templates/zcl/data-model/all.xml index dcb87db9350b50..d099283ba7f8da 100644 --- a/src/app/zap-templates/zcl/data-model/all.xml +++ b/src/app/zap-templates/zcl/data-model/all.xml @@ -28,6 +28,7 @@ <xi:include href="chip/microwave-oven-mode-cluster.xml" /> <xi:include href="chip/microwave-oven-control-cluster.xml" /> <xi:include href="chip/door-lock-cluster.xml" /> + <xi:include href="chip/energy-evse-cluster.xml" /> <xi:include href="chip/ethernet-network-diagnostics-cluster.xml" /> <xi:include href="chip/fan-control-cluster.xml" /> <xi:include href="chip/fault-injection-cluster.xml" /> 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 new file mode 100644 index 00000000000000..8eed118f9ef953 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml @@ -0,0 +1,224 @@ +<?xml version="1.0"?> +<!-- +Copyright (c) 2023 Project CHIP Authors +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> +<configurator> + <domain name="Energy Management"/> + <enum name="StateEnum" type="enum8" apiMaturity="provisional"> + <cluster code="0x0099"/> + <item name="NotPluggedIn" value="0x00"/> + <item name="PluggedInNoDemand" value="0x01"/> + <item name="PluggedInDemand" value="0x02"/> + <item name="PluggedInCharging" value="0x03"/> + <item name="PluggedInDischarging" value="0x04"/> + <item name="SessionEnding" value="0x05"/> + <item name="Fault" value="0x06"/> + </enum> + <enum name="SupplyStateEnum" type="enum8" apiMaturity="provisional"> + <cluster code="0x0099"/> + <item name="Disabled" value="0x00"/> + <item name="ChargingEnabled" value="0x01"/> + <item name="DischargingEnabled" value="0x02"/> + <item name="DisabledError" value="0x03"/> + <item name="DisabledDiagnostics" value="0x04"/> + </enum> + <enum name="FaultStateEnum" type="enum8" apiMaturity="provisional"> + <cluster code="0x0099"/> + <item name="NoError" value="0x00"/> + <item name="MeterFailure" value="0x01"/> + <item name="OverVoltage" value="0x02"/> + <item name="UnderVoltage" value="0x03"/> + <item name="OverCurrent" value="0x04"/> + <item name="ContactWetFailure" value="0x05"/> + <item name="ContactDryFailure" value="0x06"/> + <item name="GroundFault" value="0x07"/> + <item name="PowerLoss" value="0x08"/> + <item name="PowerQuality" value="0x09"/> + <item name="PilotShortCircuit" value="0x0A"/> + <item name="EmergencyStop" value="0x0B"/> + <item name="EVDisconnected" value="0x0C"/> + <item name="WrongPowerSupply" value="0x0D"/> + <item name="LiveNeutralSwap" value="0x0E"/> + <item name="OverTemperature" value="0x0F"/> + <item name="Other" value="0xFF"/> + </enum> + <enum name="EnergyTransferStoppedReasonEnum" type="enum8" apiMaturity="provisional"> + <cluster code="0x0099"/> + <item name="EVStopped" value="0x00"/> + <item name="EVSEStopped" value="0x01"/> + <item name="Other" value="0x02"/> + </enum> + <bitmap name="TargetDayOfWeekBitmap" type="bitmap8" apiMaturity="provisional"> + <cluster code="0x0099"/> + <field name="Sunday" mask="0x01"/> + <field name="Monday" mask="0x02"/> + <field name="Tuesday" mask="0x04"/> + <field name="Wednesday" mask="0x08"/> + <field name="Thursday" mask="0x10"/> + <field name="Friday" mask="0x20"/> + <field name="Saturday" mask="0x40"/> + </bitmap> + <struct name="ChargingTargetStruct" apiMaturity="provisional"> + <cluster code="0x0099"/> + <item fieldId="0" name="TargetTime" type="int16u" min="0" max="1439"/> + <item fieldId="1" name="TargetSoC" type="percent" optional="true"/> + <item fieldId="2" name="AddedEnergy" type="int64s" min="0" max="500000000" optional="true"/> + </struct> + <cluster apiMaturity="provisional"> + <name>Energy EVSE</name> + <domain>Energy Management</domain> + <code>0x0099</code> + <define>ENERGY_EVSE_CLUSTER</define> + <client init="false" tick="false">true</client> + <server init="false" tick="false">true</server> + <description>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.</description> + + <globalAttribute side="server" code="0xFFFD" value="2" /> + + <!--Attributes--> + <attribute code="0x0000" side="server" type="StateEnum" define="STATE" isNullable="true" writable="false" optional="false">State</attribute> + <attribute code="0x0001" side="server" type="SupplyStateEnum" define="SUPPLY_STATE" writable="false" optional="false">SupplyState</attribute> + <attribute code="0x0002" side="server" type="FaultStateEnum" define="FAULT_STATE" writable="false" optional="false">FaultState</attribute> + <attribute code="0x0003" side="server" type="epoch_s" define="CHARGING_ENABLED_UNTIL" isNullable="true" default="0" max="0xFFFFFFFE" writable="false" optional="false">ChargingEnabledUntil</attribute> + <!--Conformance feature V2X - for now optional--> + <attribute code="0x0004" side="server" type="epoch_s" define="DISCHARGING_ENABLED_UNTIL" isNullable="true" default="0" max="0xFFFFFFFE" writable="false" optional="true">DischargingEnabledUntil</attribute> + <attribute code="0x0005" side="server" type="int64s" define="CIRCUIT_CAPACITY" default="0" min="0" max="80000" writable="false" optional="false">CircuitCapacity</attribute> + <attribute code="0x0006" side="server" type="int64s" define="MINIMUM_CHARGE_CURRENT" default="6000" min="0" max="80000" writable="false" optional="false">MinimumChargeCurrent</attribute> + <attribute code="0x0007" side="server" type="int64s" define="MAXIMUM_CHARGE_CURRENT" default="0" min="0" max="80000" writable="false" optional="false">MaximumChargeCurrent</attribute> + <!--Conformance feature V2X - for now optional--> + <attribute code="0x0008" side="server" type="int64s" define="MAXIMUM_DISCHARGE_CURRENT" default="0" min="0" max="80000" writable="false" optional="true">MaximumDischargeCurrent</attribute> + <attribute code="0x0009" side="server" type="int64s" define="USER_MAXIMUM_CHARGE_CURRENT" default="0" writable="true" optional="true"> + <access op="read" privilege="view"/> + <access op="write" privilege="manage"/> + <description>UserMaximumChargeCurrent</description> + </attribute> + <attribute code="0x000A" side="server" type="elapsed_s" define="RANDOMIZATION_DELAY_WINDOW" default="600" writable="true" optional="true"> + <access op="read" privilege="view"/> + <access op="write" privilege="manage"/> + <description>RandomizationDelayWindow</description> + </attribute> + <!--Conformance feature PREF - for now optional--> + <attribute code="0x0021" side="server" type="int8u" define="NUMBER_OF_WEEKLY_TARGETS" default="0" writable="false" optional="true">NumberOfWeeklyTargets</attribute> + <!--Conformance feature PREF - for now optional--> + <attribute code="0x0022" side="server" type="int8u" define="NUMBER_OF_DAILY_TARGETS" default="1" writable="false" optional="true">NumberOfDailyTargets</attribute> + <!--Conformance feature PREF - for now optional--> + <attribute code="0x0023" side="server" type="epoch_s" define="NEXT_CHARGE_START_TIME" isNullable="true" max="0xFFFFFFFE" writable="false" optional="true">NextChargeStartTime</attribute> + <!--Conformance feature PREF - for now optional--> + <attribute code="0x0024" side="server" type="epoch_s" define="NEXT_CHARGE_TARGET_TIME" isNullable="true" max="0xFFFFFFFE" writable="false" optional="true">NextChargeTargetTime</attribute> + <!--Conformance feature PREF - for now optional--> + <attribute code="0x0025" side="server" type="int64s" define="NEXT_CHARGE_REQUIRED_ENERGY" isNullable="true" min="0" max="500000000" writable="false" optional="true">NextChargeRequiredEnergy</attribute> + <!--Conformance feature PREF - for now optional--> + <attribute code="0x0026" side="server" type="percent" define="NEXT_CHARGE_TARGET_SOC" isNullable="true" max="100" writable="false" optional="true">NextChargeTargetSoC</attribute> + <!--Conformance feature [PREF] - for now optional--> + <attribute code="0x0027" side="server" type="int16u" define="APPROXIMATE_EV_EFFICIENCY" isNullable="true" default="0xFFFF" max="0xFFFE" writable="true" optional="true"> + <access op="read" privilege="view"/> + <access op="write" privilege="manage"/> + <description>ApproximateEVEfficiency</description> + </attribute> + <!--Conformance feature SOC - for now optional--> + <attribute code="0x0030" side="server" type="percent" define="STATE_OF_CHARGE" isNullable="true" max="100" writable="false" optional="true">StateOfCharge</attribute> + <!--Conformance feature SOC - for now optional--> + <attribute code="0x0031" side="server" type="int64s" define="BATTERY_CAPACITY" isNullable="true" min="0" max="500000000" writable="false" optional="true">BatteryCapacity</attribute> + <!--Conformance feature PNC - for now optional--> + <attribute code="0x0032" side="server" type="char_string" define="VEHICLE_ID" isNullable="true" length="32" writable="false" optional="true">VehicleID</attribute> + <attribute code="0x0040" side="server" type="int32u" define="SESSION_ID" isNullable="true" default="0" min="1" max="0xFFFFFFFF" writable="false" optional="false">SessionID</attribute> + <attribute code="0x0041" side="server" type="elapsed_s" define="SESSION_DURATION" default="0" writable="false" optional="false">SessionDuration</attribute> + <attribute code="0x0042" side="server" type="int64s" define="SESSION_ENERGY_CHARGED" default="0" min="0" max="500000000" writable="false" optional="false">SessionEnergyCharged</attribute> + <!--Conformance feature V2X - for now optional--> + <attribute code="0x0043" side="server" type="int64s" define="SESSION_ENERGY_DISCHARGED" default="0" min="0" max="500000000" writable="false" optional="true">SessionEnergyDischarged</attribute> + <command source="client" code="0x0001" name="Disable" optional="false" mustUseTimedInvoke="true" apiMaturity="provisional"> + <access op="invoke" privilege="operate"/> + <description>Allows a client to disable the EVSE from charging and discharging.</description> + </command> + <command source="client" code="0x0002" name="EnableCharging" optional="false" mustUseTimedInvoke="true" apiMaturity="provisional"> + <access op="invoke" privilege="operate"/> + <arg name="ChargingEnabledUntil" type="epoch_s" max="0xFFFFFFFE" isNullable="true"/> + <arg name="MinimumChargeCurrent" type="int64s" min="0" max="80000"/> + <arg name="MaximumChargeCurrent" type="int64s" min="0" max="80000"/> + <description>Allows a client to enable the EVSE to charge an EV.</description> + </command> + <command source="client" code="0x0003" name="EnableDischarging" optional="true" mustUseTimedInvoke="true" apiMaturity="provisional"> + <access op="invoke" privilege="operate"/> + <arg name="DischargingEnabledUntil" type="epoch_s" max="0xFFFFFFFE" isNullable="true"/> + <arg name="MaximumDischargeCurrent" type="int64s" min="0" max="80000"/> + <description>Allows a client to enable the EVSE to discharge an EV.</description> + </command> + <command source="client" code="0x0004" name="StartDiagnostics" optional="true" mustUseTimedInvoke="true" apiMaturity="provisional"> + <access op="invoke" privilege="operate"/> + <description>Allows a client to put the EVSE into a self-diagnostics mode.</description> + </command> + <command source="client" code="0x0005" name="SetTargets" optional="true" mustUseTimedInvoke="true" apiMaturity="provisional"> + <access op="invoke" privilege="operate"/> + <arg name="DayOfWeekforSequence" type="TargetDayOfWeekBitmap"/> + <arg name="ChargingTargets" array="true" type="ChargingTargetStruct"/> + <description>Allows a client to set the user specified charging targets.</description> + </command> + <command source="client" code="0x0006" name="GetTargets" optional="true" response="GetTargetsResponse" mustUseTimedInvoke="true" apiMaturity="provisional"> + <access op="invoke" privilege="operate"/> + <arg name="DaysToReturn" type="TargetDayOfWeekBitmap"/> + <description>Allows a client to retrieve the user specified charging targets.</description> + </command> + <command source="client" code="0x0007" name="ClearTargets" optional="true" mustUseTimedInvoke="true" apiMaturity="provisional"> + <access op="invoke" privilege="operate"/> + <description>Allows a client to clear all stored charging targets.</description> + </command> + <command source="server" code="0x0000" name="GetTargetsResponse" optional="true" apiMaturity="provisional"> + <arg name="DayOfWeekforSequence" type="TargetDayOfWeekBitmap"/> + <arg name="ChargingTargets" array="true" type="ChargingTargetStruct"/> + <description>The GetTargetsResponse is sent in response to the GetTargets Command.</description> + </command> + <event code="0x0000" name="EVConnected" priority="info" side="server" apiMaturity="provisional"> + <description>EVConnected</description> + <field id="0" name="SessionID" type="int32u" min="1" max="0xFFFFFFFF" apiMaturity="provisional"/> + </event> + <event code="0x0001" name="EVNotDetected" priority="info" side="server" apiMaturity="provisional"> + <description>EVNotDetected</description> + <field id="0" name="SessionID" type="int32u" min="1" max="0xFFFFFFFF" apiMaturity="provisional"/> + <field id="1" name="State" type="StateEnum" apiMaturity="provisional"/> + <field id="2" name="SessionDuration" type="elapsed_s" apiMaturity="provisional"/> + <field id="3" name="SessionEnergyCharged" type="int64s" min="0" max="500000000" apiMaturity="provisional"/> + <field id="4" name="SessionEnergyDischarged" type="int64s" min="0" max="500000000" optional="true" apiMaturity="provisional"/> + </event> + <event code="0x0002" name="EnergyTransferStarted" priority="info" side="server" apiMaturity="provisional"> + <description>EnergyTransferStarted</description> + <field id="0" name="SessionID" type="int32u" min="1" max="0xFFFFFFFF" apiMaturity="provisional"/> + <field id="1" name="State" type="StateEnum" apiMaturity="provisional"/> + <field id="2" name="MaximumCurrent" type="int64s" min="0" max="80000" apiMaturity="provisional"/> + </event> + <event code="0x0003" name="EnergyTransferStopped" priority="info" side="server" apiMaturity="provisional"> + <description>EnergyTransferStopped</description> + <field id="0" name="SessionID" type="int32u" min="1" max="0xFFFFFFFF" apiMaturity="provisional"/> + <field id="1" name="State" type="StateEnum" apiMaturity="provisional"/> + <field id="2" name="Reason" type="EnergyTransferStoppedReasonEnum" apiMaturity="provisional"/> + <field id="4" name="EnergyTransferred" type="int64s" min="0" max="500000000" apiMaturity="provisional"/> + </event> + <event code="0x0004" name="Fault" priority="critical" side="server" apiMaturity="provisional"> + <description>Fault</description> + <field id="0" name="SessionID" type="int32u" min="1" max="0xFFFFFFFF" apiMaturity="provisional"/> + <field id="1" name="State" type="StateEnum" apiMaturity="provisional"/> + <field id="2" name="FaultStatePreviousState" type="FaultStateEnum" apiMaturity="provisional"/> + <field id="4" name="FaultStateCurrentState" type="FaultStateEnum" apiMaturity="provisional"/> + </event> + <event code="0x0005" name="RFID" priority="info" side="server" apiMaturity="provisional" optional="true"> + <description>RFID</description> + <field id="0" name="UID" type="octet_string" length="10" apiMaturity="provisional"/> + </event> + </cluster> + <bitmap name="Feature" type="bitmap32"> + <cluster code="0x0099"/> + <field name="ChargingPreferences" mask="0x1"/> + <field name="SoCReporting" mask="0x2"/> + <field name="PlugAndCharge" mask="0x4"/> + <field name="RFID" mask="0x8"/> + <field name="V2X" mask="0x10"/> + </bitmap> +</configurator> \ No newline at end of file diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 2655fdad6367de..639a1311ced5bc 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -43,6 +43,7 @@ "microwave-oven-control-cluster.xml", "door-lock-cluster.xml", "electrical-measurement-cluster.xml", + "energy-evse-cluster.xml", "ethernet-network-diagnostics-cluster.xml", "fan-control-cluster.xml", "fault-injection-cluster.xml", diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 143615c32f8942..377ebd67b3b67a 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -41,6 +41,7 @@ "door-lock-cluster.xml", "drlc-cluster.xml", "electrical-measurement-cluster.xml", + "energy-evse-cluster.xml", "ethernet-network-diagnostics-cluster.xml", "fan-control-cluster.xml", "fault-injection-cluster.xml", diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index 87b88730322461..c5c1feb7746e59 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -33,6 +33,7 @@ "MICROWAVE_OVEN_MODE_CLUSTER": [], "DOOR_LOCK_CLUSTER": [], "ELECTRICAL_MEASUREMENT_CLUSTER": [], + "ENERGY_EVSE_CLUSTER": [], "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER": [], "FAN_CONTROL_CLUSTER": [], "FAULT_INJECTION_CLUSTER": [], @@ -163,6 +164,7 @@ "MICROWAVE_OVEN_MODE_CLUSTER": ["mode-base-server"], "DOOR_LOCK_CLUSTER": ["door-lock-server"], "ELECTRICAL_MEASUREMENT_CLUSTER": [], + "ENERGY_EVSE_CLUSTER": ["energy-evse-server"], "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER": [ "ethernet-network-diagnostics-server" ], diff --git a/src/controller/data_model/BUILD.gn b/src/controller/data_model/BUILD.gn index e65596de2d483e..7f1cb17fd75c55 100644 --- a/src/controller/data_model/BUILD.gn +++ b/src/controller/data_model/BUILD.gn @@ -124,6 +124,8 @@ if (current_os == "android" || matter_enable_java_compilation) { "jni/ElectricalMeasurementClient-ReadImpl.cpp", "jni/EthernetNetworkDiagnosticsClient-InvokeSubscribeImpl.cpp", "jni/EthernetNetworkDiagnosticsClient-ReadImpl.cpp", + "jni/EnergyEvseClient-InvokeSubscribeImpl.cpp", + "jni/EnergyEvseClient-ReadImpl.cpp", "jni/FanControlClient-InvokeSubscribeImpl.cpp", "jni/FanControlClient-ReadImpl.cpp", "jni/FaultInjectionClient-InvokeSubscribeImpl.cpp", diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 74c6b6f2502701..395161df94d592 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -4235,6 +4235,187 @@ provisional client cluster DemandResponseLoadControl = 150 { command ClearLoadControlEventsRequest(): DefaultSuccess = 4; } +/** 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. */ +provisional client cluster EnergyEvse = 153 { + revision 1; // NOTE: Default/not specifically set + + enum EnergyTransferStoppedReasonEnum : enum8 { + kEVStopped = 0; + kEVSEStopped = 1; + kOther = 2; + } + + enum FaultStateEnum : enum8 { + kNoError = 0; + kMeterFailure = 1; + kOverVoltage = 2; + kUnderVoltage = 3; + kOverCurrent = 4; + kContactWetFailure = 5; + kContactDryFailure = 6; + kGroundFault = 7; + kPowerLoss = 8; + kPowerQuality = 9; + kPilotShortCircuit = 10; + kEmergencyStop = 11; + kEVDisconnected = 12; + kWrongPowerSupply = 13; + kLiveNeutralSwap = 14; + kOverTemperature = 15; + kOther = 255; + } + + enum StateEnum : enum8 { + kNotPluggedIn = 0; + kPluggedInNoDemand = 1; + kPluggedInDemand = 2; + kPluggedInCharging = 3; + kPluggedInDischarging = 4; + kSessionEnding = 5; + kFault = 6; + } + + enum SupplyStateEnum : enum8 { + kDisabled = 0; + kChargingEnabled = 1; + kDischargingEnabled = 2; + kDisabledError = 3; + kDisabledDiagnostics = 4; + } + + bitmap Feature : bitmap32 { + kChargingPreferences = 0x1; + kSoCReporting = 0x2; + kPlugAndCharge = 0x4; + kRFID = 0x8; + kV2X = 0x10; + } + + bitmap TargetDayOfWeekBitmap : bitmap8 { + kSunday = 0x1; + kMonday = 0x2; + kTuesday = 0x4; + kWednesday = 0x8; + kThursday = 0x10; + kFriday = 0x20; + kSaturday = 0x40; + } + + struct ChargingTargetStruct { + int16u targetTime = 0; + optional percent targetSoC = 1; + optional int64s addedEnergy = 2; + } + + info event EVConnected = 0 { + int32u sessionID = 0; + } + + info event EVNotDetected = 1 { + int32u sessionID = 0; + StateEnum state = 1; + elapsed_s sessionDuration = 2; + int64s sessionEnergyCharged = 3; + optional int64s sessionEnergyDischarged = 4; + } + + info event EnergyTransferStarted = 2 { + int32u sessionID = 0; + StateEnum state = 1; + int64s maximumCurrent = 2; + } + + info event EnergyTransferStopped = 3 { + int32u sessionID = 0; + StateEnum state = 1; + EnergyTransferStoppedReasonEnum reason = 2; + int64s energyTransferred = 4; + } + + critical event Fault = 4 { + int32u sessionID = 0; + StateEnum state = 1; + FaultStateEnum faultStatePreviousState = 2; + FaultStateEnum faultStateCurrentState = 4; + } + + info event RFID = 5 { + octet_string uid = 0; + } + + readonly attribute nullable StateEnum state = 0; + readonly attribute SupplyStateEnum supplyState = 1; + readonly attribute FaultStateEnum faultState = 2; + readonly attribute nullable epoch_s chargingEnabledUntil = 3; + readonly attribute optional nullable epoch_s dischargingEnabledUntil = 4; + readonly attribute int64s circuitCapacity = 5; + readonly attribute int64s minimumChargeCurrent = 6; + readonly attribute int64s maximumChargeCurrent = 7; + readonly attribute optional int64s maximumDischargeCurrent = 8; + attribute access(write: manage) optional int64s 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 int64s nextChargeRequiredEnergy = 37; + readonly attribute optional nullable percent nextChargeTargetSoC = 38; + attribute access(write: manage) optional nullable int16u approximateEVEfficiency = 39; + readonly attribute optional nullable percent stateOfCharge = 48; + readonly attribute optional nullable int64s batteryCapacity = 49; + readonly attribute optional nullable char_string<32> vehicleID = 50; + readonly attribute nullable int32u sessionID = 64; + readonly attribute elapsed_s sessionDuration = 65; + readonly attribute int64s sessionEnergyCharged = 66; + readonly attribute optional int64s sessionEnergyDischarged = 67; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + response struct GetTargetsResponse = 0 { + TargetDayOfWeekBitmap dayOfWeekforSequence = 0; + ChargingTargetStruct chargingTargets[] = 1; + } + + request struct EnableChargingRequest { + nullable epoch_s chargingEnabledUntil = 0; + int64s minimumChargeCurrent = 1; + int64s maximumChargeCurrent = 2; + } + + request struct EnableDischargingRequest { + nullable epoch_s dischargingEnabledUntil = 0; + int64s maximumDischargeCurrent = 1; + } + + request struct SetTargetsRequest { + TargetDayOfWeekBitmap dayOfWeekforSequence = 0; + ChargingTargetStruct chargingTargets[] = 1; + } + + request struct GetTargetsRequest { + TargetDayOfWeekBitmap daysToReturn = 0; + } + + /** Allows a client to disable the EVSE from charging and discharging. */ + timed command Disable(): DefaultSuccess = 1; + /** Allows a client to enable the EVSE to charge an EV. */ + timed command EnableCharging(EnableChargingRequest): DefaultSuccess = 2; + /** Allows a client to enable the EVSE to discharge an EV. */ + timed command EnableDischarging(EnableDischargingRequest): DefaultSuccess = 3; + /** Allows a client to put the EVSE into a self-diagnostics mode. */ + timed command StartDiagnostics(): DefaultSuccess = 4; + /** 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; + /** Allows a client to clear all stored charging targets. */ + timed command ClearTargets(): DefaultSuccess = 7; +} + /** An interface to a generic way to secure a door */ client cluster DoorLock = 257 { revision 7; diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 181e669291f113..446e4b5fefc228 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -17,12 +17,6 @@ } ], "package": [ - { - "pathRelativity": "relativeToZap", - "path": "../../app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "version": "chip-v1" - }, { "pathRelativity": "relativeToZap", "path": "../../app/zap-templates/zcl/zcl.json", @@ -30,6 +24,12 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" } ], "endpointTypes": [ @@ -3026,6 +3026,67 @@ } ] }, + { + "name": "Energy EVSE", + "code": 153, + "mfgCode": null, + "define": "ENERGY_EVSE_CLUSTER", + "side": "client", + "enabled": 1, + "apiMaturity": "provisional", + "commands": [ + { + "name": "Disable", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "EnableCharging", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Door Lock", "code": 257, diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 6a3327b98b45ed..07abc1d8db6a68 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -28365,6 +28365,1062 @@ public void onSuccess(byte[] tlv) { } } + public static class EnergyEvseCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 153L; + + private static final long STATE_ATTRIBUTE_ID = 0L; + private static final long SUPPLY_STATE_ATTRIBUTE_ID = 1L; + private static final long FAULT_STATE_ATTRIBUTE_ID = 2L; + private static final long CHARGING_ENABLED_UNTIL_ATTRIBUTE_ID = 3L; + private static final long DISCHARGING_ENABLED_UNTIL_ATTRIBUTE_ID = 4L; + private static final long CIRCUIT_CAPACITY_ATTRIBUTE_ID = 5L; + private static final long MINIMUM_CHARGE_CURRENT_ATTRIBUTE_ID = 6L; + private static final long MAXIMUM_CHARGE_CURRENT_ATTRIBUTE_ID = 7L; + 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; + private static final long NEXT_CHARGE_TARGET_SO_C_ATTRIBUTE_ID = 38L; + private static final long APPROXIMATE_E_V_EFFICIENCY_ATTRIBUTE_ID = 39L; + private static final long STATE_OF_CHARGE_ATTRIBUTE_ID = 48L; + private static final long BATTERY_CAPACITY_ATTRIBUTE_ID = 49L; + private static final long VEHICLE_I_D_ATTRIBUTE_ID = 50L; + private static final long SESSION_I_D_ATTRIBUTE_ID = 64L; + private static final long SESSION_DURATION_ATTRIBUTE_ID = 65L; + private static final long SESSION_ENERGY_CHARGED_ATTRIBUTE_ID = 66L; + private static final long SESSION_ENERGY_DISCHARGED_ATTRIBUTE_ID = 67L; + private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; + private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; + private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; + private static final long ATTRIBUTE_LIST_ATTRIBUTE_ID = 65531L; + private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; + private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; + + public EnergyEvseCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId, CLUSTER_ID); + } + + @Override + @Deprecated + public long initWithDevice(long devicePtr, int endpointId) { + return 0L; + } + + + public void disable(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { + final long commandId = 1L; + + ArrayList<StructElement> elements = new ArrayList<>(); + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + + public void enableCharging(DefaultClusterCallback callback, @Nullable Long chargingEnabledUntil, Long minimumChargeCurrent, Long maximumChargeCurrent, int timedInvokeTimeoutMs) { + final long commandId = 2L; + + ArrayList<StructElement> elements = new ArrayList<>(); + final long chargingEnabledUntilFieldID = 0L; + BaseTLVType chargingEnabledUntiltlvValue = chargingEnabledUntil != null ? new UIntType(chargingEnabledUntil) : new NullType(); + elements.add(new StructElement(chargingEnabledUntilFieldID, chargingEnabledUntiltlvValue)); + + final long minimumChargeCurrentFieldID = 1L; + BaseTLVType minimumChargeCurrenttlvValue = new IntType(minimumChargeCurrent); + elements.add(new StructElement(minimumChargeCurrentFieldID, minimumChargeCurrenttlvValue)); + + final long maximumChargeCurrentFieldID = 2L; + BaseTLVType maximumChargeCurrenttlvValue = new IntType(maximumChargeCurrent); + elements.add(new StructElement(maximumChargeCurrentFieldID, maximumChargeCurrenttlvValue)); + + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + + public void enableDischarging(DefaultClusterCallback callback, @Nullable Long dischargingEnabledUntil, Long maximumDischargeCurrent, int timedInvokeTimeoutMs) { + final long commandId = 3L; + + ArrayList<StructElement> elements = new ArrayList<>(); + final long dischargingEnabledUntilFieldID = 0L; + BaseTLVType dischargingEnabledUntiltlvValue = dischargingEnabledUntil != null ? new UIntType(dischargingEnabledUntil) : new NullType(); + elements.add(new StructElement(dischargingEnabledUntilFieldID, dischargingEnabledUntiltlvValue)); + + final long maximumDischargeCurrentFieldID = 1L; + BaseTLVType maximumDischargeCurrenttlvValue = new IntType(maximumDischargeCurrent); + elements.add(new StructElement(maximumDischargeCurrentFieldID, maximumDischargeCurrenttlvValue)); + + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + + public void startDiagnostics(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { + final long commandId = 4L; + + ArrayList<StructElement> elements = new ArrayList<>(); + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + + public void setTargets(DefaultClusterCallback callback, Integer dayOfWeekforSequence, ArrayList<ChipStructs.EnergyEvseClusterChargingTargetStruct> chargingTargets, int timedInvokeTimeoutMs) { + final long commandId = 5L; + + ArrayList<StructElement> 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)); + + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + + public void getTargets(GetTargetsResponseCallback callback, Integer daysToReturn, int timedInvokeTimeoutMs) { + final long commandId = 6L; + + ArrayList<StructElement> 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<ChipStructs.EnergyEvseClusterChargingTargetStruct> chargingTargets = 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.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + chargingTargets = castingValue.map((elementcastingValue) -> ChipStructs.EnergyEvseClusterChargingTargetStruct.decodeTlv(elementcastingValue)); + } + } + } + callback.onSuccess(dayOfWeekforSequence, chargingTargets); + }}, commandId, value, timedInvokeTimeoutMs); + } + + + public void clearTargets(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { + final long commandId = 7L; + + ArrayList<StructElement> elements = new ArrayList<>(); + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + public interface GetTargetsResponseCallback extends BaseClusterCallback { + void onSuccess(Integer dayOfWeekforSequence, ArrayList<ChipStructs.EnergyEvseClusterChargingTargetStruct> chargingTargets); + } + + public interface StateAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Integer value); + } + + public interface ChargingEnabledUntilAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Long value); + } + + public interface DischargingEnabledUntilAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Long value); + } + + public interface NextChargeStartTimeAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Long value); + } + + public interface NextChargeTargetTimeAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Long value); + } + + public interface NextChargeRequiredEnergyAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Long value); + } + + public interface NextChargeTargetSoCAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Integer value); + } + + public interface ApproximateEVEfficiencyAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Integer value); + } + + public interface StateOfChargeAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Integer value); + } + + public interface BatteryCapacityAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Long value); + } + + public interface VehicleIDAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable String value); + } + + public interface SessionIDAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Long value); + } + + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List<Long> value); + } + + public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List<Long> value); + } + + public interface EventListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List<Long> value); + } + + public interface AttributeListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List<Long> value); + } + + public void readStateAttribute( + StateAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, STATE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, STATE_ATTRIBUTE_ID, true); + } + + public void subscribeStateAttribute( + StateAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, STATE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, STATE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSupplyStateAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPLY_STATE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SUPPLY_STATE_ATTRIBUTE_ID, true); + } + + public void subscribeSupplyStateAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPLY_STATE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, SUPPLY_STATE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readFaultStateAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FAULT_STATE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FAULT_STATE_ATTRIBUTE_ID, true); + } + + public void subscribeFaultStateAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FAULT_STATE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, FAULT_STATE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readChargingEnabledUntilAttribute( + ChargingEnabledUntilAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CHARGING_ENABLED_UNTIL_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CHARGING_ENABLED_UNTIL_ATTRIBUTE_ID, true); + } + + public void subscribeChargingEnabledUntilAttribute( + ChargingEnabledUntilAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CHARGING_ENABLED_UNTIL_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, CHARGING_ENABLED_UNTIL_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readDischargingEnabledUntilAttribute( + DischargingEnabledUntilAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DISCHARGING_ENABLED_UNTIL_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DISCHARGING_ENABLED_UNTIL_ATTRIBUTE_ID, true); + } + + public void subscribeDischargingEnabledUntilAttribute( + DischargingEnabledUntilAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DISCHARGING_ENABLED_UNTIL_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, DISCHARGING_ENABLED_UNTIL_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readCircuitCapacityAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CIRCUIT_CAPACITY_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CIRCUIT_CAPACITY_ATTRIBUTE_ID, true); + } + + public void subscribeCircuitCapacityAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CIRCUIT_CAPACITY_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, CIRCUIT_CAPACITY_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMinimumChargeCurrentAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MINIMUM_CHARGE_CURRENT_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MINIMUM_CHARGE_CURRENT_ATTRIBUTE_ID, true); + } + + public void subscribeMinimumChargeCurrentAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MINIMUM_CHARGE_CURRENT_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, MINIMUM_CHARGE_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMaximumChargeCurrentAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAXIMUM_CHARGE_CURRENT_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MAXIMUM_CHARGE_CURRENT_ATTRIBUTE_ID, true); + } + + public void subscribeMaximumChargeCurrentAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAXIMUM_CHARGE_CURRENT_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, MAXIMUM_CHARGE_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMaximumDischargeCurrentAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAXIMUM_DISCHARGE_CURRENT_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MAXIMUM_DISCHARGE_CURRENT_ATTRIBUTE_ID, true); + } + + public void subscribeMaximumDischargeCurrentAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAXIMUM_DISCHARGE_CURRENT_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, MAXIMUM_DISCHARGE_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readUserMaximumChargeCurrentAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, USER_MAXIMUM_CHARGE_CURRENT_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, USER_MAXIMUM_CHARGE_CURRENT_ATTRIBUTE_ID, true); + } + + public void writeUserMaximumChargeCurrentAttribute(DefaultClusterCallback callback, Long value) { + writeUserMaximumChargeCurrentAttribute(callback, value, 0); + } + + public void writeUserMaximumChargeCurrentAttribute(DefaultClusterCallback callback, Long value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new IntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), USER_MAXIMUM_CHARGE_CURRENT_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeUserMaximumChargeCurrentAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, USER_MAXIMUM_CHARGE_CURRENT_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, USER_MAXIMUM_CHARGE_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readRandomizationDelayWindowAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RANDOMIZATION_DELAY_WINDOW_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, RANDOMIZATION_DELAY_WINDOW_ATTRIBUTE_ID, true); + } + + public void writeRandomizationDelayWindowAttribute(DefaultClusterCallback callback, Long value) { + writeRandomizationDelayWindowAttribute(callback, value, 0); + } + + public void writeRandomizationDelayWindowAttribute(DefaultClusterCallback callback, Long value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), RANDOMIZATION_DELAY_WINDOW_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeRandomizationDelayWindowAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RANDOMIZATION_DELAY_WINDOW_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, 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); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NEXT_CHARGE_START_TIME_ATTRIBUTE_ID, true); + } + + public void subscribeNextChargeStartTimeAttribute( + NextChargeStartTimeAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NEXT_CHARGE_START_TIME_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, NEXT_CHARGE_START_TIME_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readNextChargeTargetTimeAttribute( + NextChargeTargetTimeAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NEXT_CHARGE_TARGET_TIME_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NEXT_CHARGE_TARGET_TIME_ATTRIBUTE_ID, true); + } + + public void subscribeNextChargeTargetTimeAttribute( + NextChargeTargetTimeAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NEXT_CHARGE_TARGET_TIME_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, NEXT_CHARGE_TARGET_TIME_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readNextChargeRequiredEnergyAttribute( + NextChargeRequiredEnergyAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NEXT_CHARGE_REQUIRED_ENERGY_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NEXT_CHARGE_REQUIRED_ENERGY_ATTRIBUTE_ID, true); + } + + public void subscribeNextChargeRequiredEnergyAttribute( + NextChargeRequiredEnergyAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NEXT_CHARGE_REQUIRED_ENERGY_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, NEXT_CHARGE_REQUIRED_ENERGY_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readNextChargeTargetSoCAttribute( + NextChargeTargetSoCAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NEXT_CHARGE_TARGET_SO_C_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NEXT_CHARGE_TARGET_SO_C_ATTRIBUTE_ID, true); + } + + public void subscribeNextChargeTargetSoCAttribute( + NextChargeTargetSoCAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NEXT_CHARGE_TARGET_SO_C_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, NEXT_CHARGE_TARGET_SO_C_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readApproximateEVEfficiencyAttribute( + ApproximateEVEfficiencyAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, APPROXIMATE_E_V_EFFICIENCY_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, APPROXIMATE_E_V_EFFICIENCY_ATTRIBUTE_ID, true); + } + + public void writeApproximateEVEfficiencyAttribute(DefaultClusterCallback callback, Integer value) { + writeApproximateEVEfficiencyAttribute(callback, value, 0); + } + + public void writeApproximateEVEfficiencyAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = value != null ? new UIntType(value) : new NullType(); + writeAttribute(new WriteAttributesCallbackImpl(callback), APPROXIMATE_E_V_EFFICIENCY_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeApproximateEVEfficiencyAttribute( + ApproximateEVEfficiencyAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, APPROXIMATE_E_V_EFFICIENCY_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, APPROXIMATE_E_V_EFFICIENCY_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readStateOfChargeAttribute( + StateOfChargeAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, STATE_OF_CHARGE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, STATE_OF_CHARGE_ATTRIBUTE_ID, true); + } + + public void subscribeStateOfChargeAttribute( + StateOfChargeAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, STATE_OF_CHARGE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, STATE_OF_CHARGE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readBatteryCapacityAttribute( + BatteryCapacityAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BATTERY_CAPACITY_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, BATTERY_CAPACITY_ATTRIBUTE_ID, true); + } + + public void subscribeBatteryCapacityAttribute( + BatteryCapacityAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BATTERY_CAPACITY_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, BATTERY_CAPACITY_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readVehicleIDAttribute( + VehicleIDAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, VEHICLE_I_D_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, VEHICLE_I_D_ATTRIBUTE_ID, true); + } + + public void subscribeVehicleIDAttribute( + VehicleIDAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, VEHICLE_I_D_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, VEHICLE_I_D_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSessionIDAttribute( + SessionIDAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SESSION_I_D_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SESSION_I_D_ATTRIBUTE_ID, true); + } + + public void subscribeSessionIDAttribute( + SessionIDAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SESSION_I_D_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, SESSION_I_D_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSessionDurationAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SESSION_DURATION_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SESSION_DURATION_ATTRIBUTE_ID, true); + } + + public void subscribeSessionDurationAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SESSION_DURATION_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, SESSION_DURATION_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSessionEnergyChargedAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SESSION_ENERGY_CHARGED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SESSION_ENERGY_CHARGED_ATTRIBUTE_ID, true); + } + + public void subscribeSessionEnergyChargedAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SESSION_ENERGY_CHARGED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, SESSION_ENERGY_CHARGED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSessionEnergyDischargedAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SESSION_ENERGY_DISCHARGED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SESSION_ENERGY_DISCHARGED_ATTRIBUTE_ID, true); + } + + public void subscribeSessionEnergyDischargedAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SESSION_ENERGY_DISCHARGED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, SESSION_ENERGY_DISCHARGED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readEventListAttribute( + EventListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, EVENT_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAttributeListAttribute( + AttributeListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readFeatureMapAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, true); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, FEATURE_MAP_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, true); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, minInterval, maxInterval); + } + } + public static class DoorLockCluster extends BaseChipCluster { public static final long CLUSTER_ID = 257L; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java index 9c48ad3dcdcb70..47cdeb84a31298 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java @@ -3119,6 +3119,462 @@ public String toString() { return output.toString(); } } +public static class EnergyEvseClusterEVConnectedEvent { + public Long sessionID; + private static final long SESSION_I_D_ID = 0L; + + public EnergyEvseClusterEVConnectedEvent( + Long sessionID + ) { + this.sessionID = sessionID; + } + + public StructType encodeTlv() { + ArrayList<StructElement> values = new ArrayList<>(); + values.add(new StructElement(SESSION_I_D_ID, new UIntType(sessionID))); + + return new StructType(values); + } + + public static EnergyEvseClusterEVConnectedEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Long sessionID = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == SESSION_I_D_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + sessionID = castingValue.value(Long.class); + } + } + } + return new EnergyEvseClusterEVConnectedEvent( + sessionID + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("EnergyEvseClusterEVConnectedEvent {\n"); + output.append("\tsessionID: "); + output.append(sessionID); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class EnergyEvseClusterEVNotDetectedEvent { + public Long sessionID; + public Integer state; + public Long sessionDuration; + public Long sessionEnergyCharged; + public Optional<Long> sessionEnergyDischarged; + private static final long SESSION_I_D_ID = 0L; + private static final long STATE_ID = 1L; + private static final long SESSION_DURATION_ID = 2L; + private static final long SESSION_ENERGY_CHARGED_ID = 3L; + private static final long SESSION_ENERGY_DISCHARGED_ID = 4L; + + public EnergyEvseClusterEVNotDetectedEvent( + Long sessionID, + Integer state, + Long sessionDuration, + Long sessionEnergyCharged, + Optional<Long> sessionEnergyDischarged + ) { + this.sessionID = sessionID; + this.state = state; + this.sessionDuration = sessionDuration; + this.sessionEnergyCharged = sessionEnergyCharged; + this.sessionEnergyDischarged = sessionEnergyDischarged; + } + + public StructType encodeTlv() { + ArrayList<StructElement> values = new ArrayList<>(); + values.add(new StructElement(SESSION_I_D_ID, new UIntType(sessionID))); + values.add(new StructElement(STATE_ID, new UIntType(state))); + values.add(new StructElement(SESSION_DURATION_ID, new UIntType(sessionDuration))); + values.add(new StructElement(SESSION_ENERGY_CHARGED_ID, new IntType(sessionEnergyCharged))); + values.add(new StructElement(SESSION_ENERGY_DISCHARGED_ID, sessionEnergyDischarged.<BaseTLVType>map((nonOptionalsessionEnergyDischarged) -> new IntType(nonOptionalsessionEnergyDischarged)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static EnergyEvseClusterEVNotDetectedEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Long sessionID = null; + Integer state = null; + Long sessionDuration = null; + Long sessionEnergyCharged = null; + Optional<Long> sessionEnergyDischarged = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == SESSION_I_D_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + sessionID = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == STATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + state = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == SESSION_DURATION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + sessionDuration = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == SESSION_ENERGY_CHARGED_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + sessionEnergyCharged = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == SESSION_ENERGY_DISCHARGED_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + sessionEnergyDischarged = Optional.of(castingValue.value(Long.class)); + } + } + } + return new EnergyEvseClusterEVNotDetectedEvent( + sessionID, + state, + sessionDuration, + sessionEnergyCharged, + sessionEnergyDischarged + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("EnergyEvseClusterEVNotDetectedEvent {\n"); + output.append("\tsessionID: "); + output.append(sessionID); + output.append("\n"); + output.append("\tstate: "); + output.append(state); + output.append("\n"); + output.append("\tsessionDuration: "); + output.append(sessionDuration); + output.append("\n"); + output.append("\tsessionEnergyCharged: "); + output.append(sessionEnergyCharged); + output.append("\n"); + output.append("\tsessionEnergyDischarged: "); + output.append(sessionEnergyDischarged); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class EnergyEvseClusterEnergyTransferStartedEvent { + public Long sessionID; + public Integer state; + public Long maximumCurrent; + private static final long SESSION_I_D_ID = 0L; + private static final long STATE_ID = 1L; + private static final long MAXIMUM_CURRENT_ID = 2L; + + public EnergyEvseClusterEnergyTransferStartedEvent( + Long sessionID, + Integer state, + Long maximumCurrent + ) { + this.sessionID = sessionID; + this.state = state; + this.maximumCurrent = maximumCurrent; + } + + public StructType encodeTlv() { + ArrayList<StructElement> values = new ArrayList<>(); + values.add(new StructElement(SESSION_I_D_ID, new UIntType(sessionID))); + values.add(new StructElement(STATE_ID, new UIntType(state))); + values.add(new StructElement(MAXIMUM_CURRENT_ID, new IntType(maximumCurrent))); + + return new StructType(values); + } + + public static EnergyEvseClusterEnergyTransferStartedEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Long sessionID = null; + Integer state = null; + Long maximumCurrent = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == SESSION_I_D_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + sessionID = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == STATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + state = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == MAXIMUM_CURRENT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + maximumCurrent = castingValue.value(Long.class); + } + } + } + return new EnergyEvseClusterEnergyTransferStartedEvent( + sessionID, + state, + maximumCurrent + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("EnergyEvseClusterEnergyTransferStartedEvent {\n"); + output.append("\tsessionID: "); + output.append(sessionID); + output.append("\n"); + output.append("\tstate: "); + output.append(state); + output.append("\n"); + output.append("\tmaximumCurrent: "); + output.append(maximumCurrent); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class EnergyEvseClusterEnergyTransferStoppedEvent { + public Long sessionID; + public Integer state; + public Integer reason; + public Long energyTransferred; + private static final long SESSION_I_D_ID = 0L; + private static final long STATE_ID = 1L; + private static final long REASON_ID = 2L; + private static final long ENERGY_TRANSFERRED_ID = 4L; + + public EnergyEvseClusterEnergyTransferStoppedEvent( + Long sessionID, + Integer state, + Integer reason, + Long energyTransferred + ) { + this.sessionID = sessionID; + this.state = state; + this.reason = reason; + this.energyTransferred = energyTransferred; + } + + public StructType encodeTlv() { + ArrayList<StructElement> values = new ArrayList<>(); + values.add(new StructElement(SESSION_I_D_ID, new UIntType(sessionID))); + values.add(new StructElement(STATE_ID, new UIntType(state))); + values.add(new StructElement(REASON_ID, new UIntType(reason))); + values.add(new StructElement(ENERGY_TRANSFERRED_ID, new IntType(energyTransferred))); + + return new StructType(values); + } + + public static EnergyEvseClusterEnergyTransferStoppedEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Long sessionID = null; + Integer state = null; + Integer reason = null; + Long energyTransferred = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == SESSION_I_D_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + sessionID = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == STATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + state = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == REASON_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + reason = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == ENERGY_TRANSFERRED_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + energyTransferred = castingValue.value(Long.class); + } + } + } + return new EnergyEvseClusterEnergyTransferStoppedEvent( + sessionID, + state, + reason, + energyTransferred + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("EnergyEvseClusterEnergyTransferStoppedEvent {\n"); + output.append("\tsessionID: "); + output.append(sessionID); + output.append("\n"); + output.append("\tstate: "); + output.append(state); + output.append("\n"); + output.append("\treason: "); + output.append(reason); + output.append("\n"); + output.append("\tenergyTransferred: "); + output.append(energyTransferred); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class EnergyEvseClusterFaultEvent { + public Long sessionID; + public Integer state; + public Integer faultStatePreviousState; + public Integer faultStateCurrentState; + private static final long SESSION_I_D_ID = 0L; + private static final long STATE_ID = 1L; + private static final long FAULT_STATE_PREVIOUS_STATE_ID = 2L; + private static final long FAULT_STATE_CURRENT_STATE_ID = 4L; + + public EnergyEvseClusterFaultEvent( + Long sessionID, + Integer state, + Integer faultStatePreviousState, + Integer faultStateCurrentState + ) { + this.sessionID = sessionID; + this.state = state; + this.faultStatePreviousState = faultStatePreviousState; + this.faultStateCurrentState = faultStateCurrentState; + } + + public StructType encodeTlv() { + ArrayList<StructElement> values = new ArrayList<>(); + values.add(new StructElement(SESSION_I_D_ID, new UIntType(sessionID))); + values.add(new StructElement(STATE_ID, new UIntType(state))); + values.add(new StructElement(FAULT_STATE_PREVIOUS_STATE_ID, new UIntType(faultStatePreviousState))); + values.add(new StructElement(FAULT_STATE_CURRENT_STATE_ID, new UIntType(faultStateCurrentState))); + + return new StructType(values); + } + + public static EnergyEvseClusterFaultEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Long sessionID = null; + Integer state = null; + Integer faultStatePreviousState = null; + Integer faultStateCurrentState = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == SESSION_I_D_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + sessionID = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == STATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + state = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == FAULT_STATE_PREVIOUS_STATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + faultStatePreviousState = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == FAULT_STATE_CURRENT_STATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + faultStateCurrentState = castingValue.value(Integer.class); + } + } + } + return new EnergyEvseClusterFaultEvent( + sessionID, + state, + faultStatePreviousState, + faultStateCurrentState + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("EnergyEvseClusterFaultEvent {\n"); + output.append("\tsessionID: "); + output.append(sessionID); + output.append("\n"); + output.append("\tstate: "); + output.append(state); + output.append("\n"); + output.append("\tfaultStatePreviousState: "); + output.append(faultStatePreviousState); + output.append("\n"); + output.append("\tfaultStateCurrentState: "); + output.append(faultStateCurrentState); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class EnergyEvseClusterRFIDEvent { + public byte[] uid; + private static final long UID_ID = 0L; + + public EnergyEvseClusterRFIDEvent( + byte[] uid + ) { + this.uid = uid; + } + + public StructType encodeTlv() { + ArrayList<StructElement> values = new ArrayList<>(); + values.add(new StructElement(UID_ID, new ByteArrayType(uid))); + + return new StructType(values); + } + + public static EnergyEvseClusterRFIDEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + byte[] uid = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == UID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.ByteArray) { + ByteArrayType castingValue = element.value(ByteArrayType.class); + uid = castingValue.value(byte[].class); + } + } + } + return new EnergyEvseClusterRFIDEvent( + uid + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("EnergyEvseClusterRFIDEvent {\n"); + output.append("\tuid: "); + output.append(Arrays.toString(uid)); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class DoorLockClusterDoorLockAlarmEvent { public Integer alarmCode; private static final long ALARM_CODE_ID = 0L; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index 843b68318831b9..404e1d1c76c643 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -5959,6 +5959,82 @@ public String toString() { return output.toString(); } } +public static class EnergyEvseClusterChargingTargetStruct { + public Integer targetTime; + public Optional<Integer> targetSoC; + public Optional<Long> addedEnergy; + private static final long TARGET_TIME_ID = 0L; + private static final long TARGET_SO_C_ID = 1L; + private static final long ADDED_ENERGY_ID = 2L; + + public EnergyEvseClusterChargingTargetStruct( + Integer targetTime, + Optional<Integer> targetSoC, + Optional<Long> addedEnergy + ) { + this.targetTime = targetTime; + this.targetSoC = targetSoC; + this.addedEnergy = addedEnergy; + } + + public StructType encodeTlv() { + ArrayList<StructElement> values = new ArrayList<>(); + values.add(new StructElement(TARGET_TIME_ID, new UIntType(targetTime))); + values.add(new StructElement(TARGET_SO_C_ID, targetSoC.<BaseTLVType>map((nonOptionaltargetSoC) -> new UIntType(nonOptionaltargetSoC)).orElse(new EmptyType()))); + values.add(new StructElement(ADDED_ENERGY_ID, addedEnergy.<BaseTLVType>map((nonOptionaladdedEnergy) -> new IntType(nonOptionaladdedEnergy)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static EnergyEvseClusterChargingTargetStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer targetTime = null; + Optional<Integer> targetSoC = Optional.empty(); + Optional<Long> addedEnergy = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == TARGET_TIME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + targetTime = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == TARGET_SO_C_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + targetSoC = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == ADDED_ENERGY_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + addedEnergy = Optional.of(castingValue.value(Long.class)); + } + } + } + return new EnergyEvseClusterChargingTargetStruct( + targetTime, + targetSoC, + addedEnergy + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("EnergyEvseClusterChargingTargetStruct {\n"); + output.append("\ttargetTime: "); + output.append(targetTime); + output.append("\n"); + output.append("\ttargetSoC: "); + output.append(targetSoC); + output.append("\n"); + output.append("\taddedEnergy: "); + output.append(addedEnergy); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class DoorLockClusterCredentialStruct { public Integer credentialType; public Integer credentialIndex; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index 89ea408254a0c7..95cf77037d5f08 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -223,6 +223,9 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == DemandResponseLoadControl.ID) { return new DemandResponseLoadControl(); } + if (clusterId == EnergyEvse.ID) { + return new EnergyEvse(); + } if (clusterId == DoorLock.ID) { return new DoorLock(); } @@ -9093,6 +9096,212 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } + public static class EnergyEvse implements BaseCluster { + public static final long ID = 153L; + public long getID() { + return ID; + } + + public enum Attribute { + State(0L), + SupplyState(1L), + FaultState(2L), + ChargingEnabledUntil(3L), + DischargingEnabledUntil(4L), + CircuitCapacity(5L), + MinimumChargeCurrent(6L), + MaximumChargeCurrent(7L), + MaximumDischargeCurrent(8L), + UserMaximumChargeCurrent(9L), + RandomizationDelayWindow(10L), + NumberOfWeeklyTargets(33L), + NumberOfDailyTargets(34L), + NextChargeStartTime(35L), + NextChargeTargetTime(36L), + NextChargeRequiredEnergy(37L), + NextChargeTargetSoC(38L), + ApproximateEVEfficiency(39L), + StateOfCharge(48L), + BatteryCapacity(49L), + VehicleID(50L), + SessionID(64L), + SessionDuration(65L), + SessionEnergyCharged(66L), + SessionEnergyDischarged(67L), + GeneratedCommandList(65528L), + AcceptedCommandList(65529L), + EventList(65530L), + AttributeList(65531L), + FeatureMap(65532L), + ClusterRevision(65533L),; + private final long id; + Attribute(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Attribute value(long id) throws NoSuchFieldError { + for (Attribute attribute : Attribute.values()) { + if (attribute.getID() == id) { + return attribute; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Event { + EVConnected(0L), + EVNotDetected(1L), + EnergyTransferStarted(2L), + EnergyTransferStopped(3L), + Fault(4L), + RFID(5L),; + private final long id; + Event(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Event value(long id) throws NoSuchFieldError { + for (Event event : Event.values()) { + if (event.getID() == id) { + return event; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Command { + Disable(1L), + EnableCharging(2L), + EnableDischarging(3L), + StartDiagnostics(4L), + SetTargets(5L), + GetTargets(6L), + ClearTargets(7L),; + private final long id; + Command(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Command value(long id) throws NoSuchFieldError { + for (Command command : Command.values()) { + if (command.getID() == id) { + return command; + } + } + throw new NoSuchFieldError(); + } + }public enum EnableChargingCommandField {ChargingEnabledUntil(0),MinimumChargeCurrent(1),MaximumChargeCurrent(2),; + private final int id; + EnableChargingCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static EnableChargingCommandField value(int id) throws NoSuchFieldError { + for (EnableChargingCommandField field : EnableChargingCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum EnableDischargingCommandField {DischargingEnabledUntil(0),MaximumDischargeCurrent(1),; + private final int id; + EnableDischargingCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static EnableDischargingCommandField value(int id) throws NoSuchFieldError { + for (EnableDischargingCommandField field : EnableDischargingCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum SetTargetsCommandField {DayOfWeekforSequence(0),ChargingTargets(1),; + private final int id; + SetTargetsCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SetTargetsCommandField value(int id) throws NoSuchFieldError { + for (SetTargetsCommandField field : SetTargetsCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + 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(); + } + + @Override + public String getEventName(long id) throws NoSuchFieldError { + return Event.value(id).toString(); + } + + @Override + public String getCommandName(long id) throws NoSuchFieldError { + return Command.value(id).toString(); + } + + @Override + public long getAttributeID(String name) throws IllegalArgumentException { + return Attribute.valueOf(name).getID(); + } + + @Override + public long getEventID(String name) throws IllegalArgumentException { + return Event.valueOf(name).getID(); + } + + @Override + public long getCommandID(String name) throws IllegalArgumentException { + return Command.valueOf(name).getID(); + } + } public static class DoorLock implements BaseCluster { public static final long ID = 257L; public long getID() { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index ba0190ef3abdfd..d544a8da73ace3 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -9945,6 +9945,367 @@ public void onError(Exception ex) { } + public static class DelegatedEnergyEvseClusterGetTargetsResponseCallback implements ChipClusters.EnergyEvseCluster.GetTargetsResponseCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(Integer dayOfWeekforSequence, ArrayList<ChipStructs.EnergyEvseClusterChargingTargetStruct> chargingTargets) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + + CommandResponseInfo dayOfWeekforSequenceResponseValue = new CommandResponseInfo("dayOfWeekforSequence", "Integer"); + responseValues.put(dayOfWeekforSequenceResponseValue, dayOfWeekforSequence); + // chargingTargets: ChargingTargetStruct + // Conversion from this type to Java is not properly implemented yet + + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + public static class DelegatedEnergyEvseClusterStateAttributeCallback implements ChipClusters.EnergyEvseCluster.StateAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyEvseClusterChargingEnabledUntilAttributeCallback implements ChipClusters.EnergyEvseCluster.ChargingEnabledUntilAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Long value) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyEvseClusterDischargingEnabledUntilAttributeCallback implements ChipClusters.EnergyEvseCluster.DischargingEnabledUntilAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Long value) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyEvseClusterNextChargeStartTimeAttributeCallback implements ChipClusters.EnergyEvseCluster.NextChargeStartTimeAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Long value) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyEvseClusterNextChargeTargetTimeAttributeCallback implements ChipClusters.EnergyEvseCluster.NextChargeTargetTimeAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Long value) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyEvseClusterNextChargeRequiredEnergyAttributeCallback implements ChipClusters.EnergyEvseCluster.NextChargeRequiredEnergyAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Long value) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyEvseClusterNextChargeTargetSoCAttributeCallback implements ChipClusters.EnergyEvseCluster.NextChargeTargetSoCAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyEvseClusterApproximateEVEfficiencyAttributeCallback implements ChipClusters.EnergyEvseCluster.ApproximateEVEfficiencyAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyEvseClusterStateOfChargeAttributeCallback implements ChipClusters.EnergyEvseCluster.StateOfChargeAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyEvseClusterBatteryCapacityAttributeCallback implements ChipClusters.EnergyEvseCluster.BatteryCapacityAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Long value) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyEvseClusterVehicleIDAttributeCallback implements ChipClusters.EnergyEvseCluster.VehicleIDAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable String value) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "String"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyEvseClusterSessionIDAttributeCallback implements ChipClusters.EnergyEvseCluster.SessionIDAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Long value) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyEvseClusterGeneratedCommandListAttributeCallback implements ChipClusters.EnergyEvseCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List<Long> valueList) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List<Long>"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyEvseClusterAcceptedCommandListAttributeCallback implements ChipClusters.EnergyEvseCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List<Long> valueList) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List<Long>"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyEvseClusterEventListAttributeCallback implements ChipClusters.EnergyEvseCluster.EventListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List<Long> valueList) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List<Long>"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedEnergyEvseClusterAttributeListAttributeCallback implements ChipClusters.EnergyEvseCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List<Long> valueList) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List<Long>"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedDoorLockClusterGetWeekDayScheduleResponseCallback implements ChipClusters.DoorLockCluster.GetWeekDayScheduleResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -18237,6 +18598,10 @@ public Map<String, ClusterInfo> initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.DemandResponseLoadControlCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("demandResponseLoadControl", demandResponseLoadControlClusterInfo); + ClusterInfo energyEvseClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.EnergyEvseCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("energyEvse", energyEvseClusterInfo); + ClusterInfo doorLockClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.DoorLockCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("doorLock", doorLockClusterInfo); @@ -18470,6 +18835,7 @@ public void combineCommand(Map<String, ClusterInfo> destination, Map<String, Map destination.get("booleanSensorConfiguration").combineCommands(source.get("booleanSensorConfiguration")); destination.get("valveConfigurationAndControl").combineCommands(source.get("valveConfigurationAndControl")); destination.get("demandResponseLoadControl").combineCommands(source.get("demandResponseLoadControl")); + destination.get("energyEvse").combineCommands(source.get("energyEvse")); destination.get("doorLock").combineCommands(source.get("doorLock")); destination.get("windowCovering").combineCommands(source.get("windowCovering")); destination.get("barrierControl").combineCommands(source.get("barrierControl")); @@ -21425,6 +21791,133 @@ public Map<String, Map<String, InteractionInfo>> getCommandMap() { commandMap.put("demandResponseLoadControl", demandResponseLoadControlClusterInteractionInfoMap); + Map<String, InteractionInfo> energyEvseClusterInteractionInfoMap = new LinkedHashMap<>(); + + Map<String, CommandParameterInfo> energyEvsedisableCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo energyEvsedisableInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster) + .disable((DefaultClusterCallback) callback, 10000 + ); + }, + () -> new DelegatedDefaultClusterCallback(), + energyEvsedisableCommandParams + ); + energyEvseClusterInteractionInfoMap.put("disable", energyEvsedisableInteractionInfo); + + Map<String, CommandParameterInfo> energyEvseenableChargingCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + + CommandParameterInfo energyEvseenableChargingchargingEnabledUntilCommandParameterInfo = new CommandParameterInfo("chargingEnabledUntil", Long.class, Long.class); + energyEvseenableChargingCommandParams.put("chargingEnabledUntil",energyEvseenableChargingchargingEnabledUntilCommandParameterInfo); + + CommandParameterInfo energyEvseenableChargingminimumChargeCurrentCommandParameterInfo = new CommandParameterInfo("minimumChargeCurrent", Long.class, Long.class); + energyEvseenableChargingCommandParams.put("minimumChargeCurrent",energyEvseenableChargingminimumChargeCurrentCommandParameterInfo); + + CommandParameterInfo energyEvseenableChargingmaximumChargeCurrentCommandParameterInfo = new CommandParameterInfo("maximumChargeCurrent", Long.class, Long.class); + energyEvseenableChargingCommandParams.put("maximumChargeCurrent",energyEvseenableChargingmaximumChargeCurrentCommandParameterInfo); + InteractionInfo energyEvseenableChargingInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster) + .enableCharging((DefaultClusterCallback) callback + , (Long) + commandArguments.get("chargingEnabledUntil") + , (Long) + commandArguments.get("minimumChargeCurrent") + , (Long) + commandArguments.get("maximumChargeCurrent"), 10000 + ); + }, + () -> new DelegatedDefaultClusterCallback(), + energyEvseenableChargingCommandParams + ); + energyEvseClusterInteractionInfoMap.put("enableCharging", energyEvseenableChargingInteractionInfo); + + Map<String, CommandParameterInfo> energyEvseenableDischargingCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + + CommandParameterInfo energyEvseenableDischargingdischargingEnabledUntilCommandParameterInfo = new CommandParameterInfo("dischargingEnabledUntil", Long.class, Long.class); + energyEvseenableDischargingCommandParams.put("dischargingEnabledUntil",energyEvseenableDischargingdischargingEnabledUntilCommandParameterInfo); + + CommandParameterInfo energyEvseenableDischargingmaximumDischargeCurrentCommandParameterInfo = new CommandParameterInfo("maximumDischargeCurrent", Long.class, Long.class); + energyEvseenableDischargingCommandParams.put("maximumDischargeCurrent",energyEvseenableDischargingmaximumDischargeCurrentCommandParameterInfo); + InteractionInfo energyEvseenableDischargingInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster) + .enableDischarging((DefaultClusterCallback) callback + , (Long) + commandArguments.get("dischargingEnabledUntil") + , (Long) + commandArguments.get("maximumDischargeCurrent"), 10000 + ); + }, + () -> new DelegatedDefaultClusterCallback(), + energyEvseenableDischargingCommandParams + ); + energyEvseClusterInteractionInfoMap.put("enableDischarging", energyEvseenableDischargingInteractionInfo); + + Map<String, CommandParameterInfo> energyEvsestartDiagnosticsCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo energyEvsestartDiagnosticsInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster) + .startDiagnostics((DefaultClusterCallback) callback, 10000 + ); + }, + () -> new DelegatedDefaultClusterCallback(), + energyEvsestartDiagnosticsCommandParams + ); + energyEvseClusterInteractionInfoMap.put("startDiagnostics", energyEvsestartDiagnosticsInteractionInfo); + + Map<String, CommandParameterInfo> energyEvsesetTargetsCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + + 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<ChipStructs.EnergyEvseClusterChargingTargetStruct>) + commandArguments.get("chargingTargets"), 10000 + ); + }, + () -> new DelegatedDefaultClusterCallback(), + energyEvsesetTargetsCommandParams + ); + energyEvseClusterInteractionInfoMap.put("setTargets", energyEvsesetTargetsInteractionInfo); + + Map<String, CommandParameterInfo> energyEvsegetTargetsCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + + 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(), + energyEvsegetTargetsCommandParams + ); + energyEvseClusterInteractionInfoMap.put("getTargets", energyEvsegetTargetsInteractionInfo); + + Map<String, CommandParameterInfo> energyEvseclearTargetsCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo energyEvseclearTargetsInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster) + .clearTargets((DefaultClusterCallback) callback, 10000 + ); + }, + () -> new DelegatedDefaultClusterCallback(), + energyEvseclearTargetsCommandParams + ); + energyEvseClusterInteractionInfoMap.put("clearTargets", energyEvseclearTargetsInteractionInfo); + + commandMap.put("energyEvse", energyEvseClusterInteractionInfoMap); + Map<String, InteractionInfo> doorLockClusterInteractionInfoMap = new LinkedHashMap<>(); Map<String, CommandParameterInfo> doorLocklockDoorCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 7219a083cad761..0f9c22e2ccd7d4 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -8964,6 +8964,351 @@ private static Map<String, InteractionInfo> readDemandResponseLoadControlInterac return result; } + private static Map<String, InteractionInfo> readEnergyEvseInteractionInfo() { + Map<String, InteractionInfo> result = new LinkedHashMap<>();Map<String, CommandParameterInfo> readEnergyEvseStateCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseStateAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readStateAttribute( + (ChipClusters.EnergyEvseCluster.StateAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyEvseClusterStateAttributeCallback(), + readEnergyEvseStateCommandParams + ); + result.put("readStateAttribute", readEnergyEvseStateAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseSupplyStateCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseSupplyStateAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readSupplyStateAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readEnergyEvseSupplyStateCommandParams + ); + result.put("readSupplyStateAttribute", readEnergyEvseSupplyStateAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseFaultStateCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseFaultStateAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readFaultStateAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readEnergyEvseFaultStateCommandParams + ); + result.put("readFaultStateAttribute", readEnergyEvseFaultStateAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseChargingEnabledUntilCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseChargingEnabledUntilAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readChargingEnabledUntilAttribute( + (ChipClusters.EnergyEvseCluster.ChargingEnabledUntilAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyEvseClusterChargingEnabledUntilAttributeCallback(), + readEnergyEvseChargingEnabledUntilCommandParams + ); + result.put("readChargingEnabledUntilAttribute", readEnergyEvseChargingEnabledUntilAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseDischargingEnabledUntilCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseDischargingEnabledUntilAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readDischargingEnabledUntilAttribute( + (ChipClusters.EnergyEvseCluster.DischargingEnabledUntilAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyEvseClusterDischargingEnabledUntilAttributeCallback(), + readEnergyEvseDischargingEnabledUntilCommandParams + ); + result.put("readDischargingEnabledUntilAttribute", readEnergyEvseDischargingEnabledUntilAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseCircuitCapacityCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseCircuitCapacityAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readCircuitCapacityAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readEnergyEvseCircuitCapacityCommandParams + ); + result.put("readCircuitCapacityAttribute", readEnergyEvseCircuitCapacityAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseMinimumChargeCurrentCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseMinimumChargeCurrentAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readMinimumChargeCurrentAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readEnergyEvseMinimumChargeCurrentCommandParams + ); + result.put("readMinimumChargeCurrentAttribute", readEnergyEvseMinimumChargeCurrentAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseMaximumChargeCurrentCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseMaximumChargeCurrentAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readMaximumChargeCurrentAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readEnergyEvseMaximumChargeCurrentCommandParams + ); + result.put("readMaximumChargeCurrentAttribute", readEnergyEvseMaximumChargeCurrentAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseMaximumDischargeCurrentCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseMaximumDischargeCurrentAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readMaximumDischargeCurrentAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readEnergyEvseMaximumDischargeCurrentCommandParams + ); + result.put("readMaximumDischargeCurrentAttribute", readEnergyEvseMaximumDischargeCurrentAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseUserMaximumChargeCurrentCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseUserMaximumChargeCurrentAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readUserMaximumChargeCurrentAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readEnergyEvseUserMaximumChargeCurrentCommandParams + ); + result.put("readUserMaximumChargeCurrentAttribute", readEnergyEvseUserMaximumChargeCurrentAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseRandomizationDelayWindowCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseRandomizationDelayWindowAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readRandomizationDelayWindowAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readEnergyEvseRandomizationDelayWindowCommandParams + ); + result.put("readRandomizationDelayWindowAttribute", readEnergyEvseRandomizationDelayWindowAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseNumberOfWeeklyTargetsCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseNumberOfWeeklyTargetsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readNumberOfWeeklyTargetsAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readEnergyEvseNumberOfWeeklyTargetsCommandParams + ); + result.put("readNumberOfWeeklyTargetsAttribute", readEnergyEvseNumberOfWeeklyTargetsAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseNumberOfDailyTargetsCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseNumberOfDailyTargetsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readNumberOfDailyTargetsAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readEnergyEvseNumberOfDailyTargetsCommandParams + ); + result.put("readNumberOfDailyTargetsAttribute", readEnergyEvseNumberOfDailyTargetsAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseNextChargeStartTimeCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseNextChargeStartTimeAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readNextChargeStartTimeAttribute( + (ChipClusters.EnergyEvseCluster.NextChargeStartTimeAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyEvseClusterNextChargeStartTimeAttributeCallback(), + readEnergyEvseNextChargeStartTimeCommandParams + ); + result.put("readNextChargeStartTimeAttribute", readEnergyEvseNextChargeStartTimeAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseNextChargeTargetTimeCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseNextChargeTargetTimeAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readNextChargeTargetTimeAttribute( + (ChipClusters.EnergyEvseCluster.NextChargeTargetTimeAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyEvseClusterNextChargeTargetTimeAttributeCallback(), + readEnergyEvseNextChargeTargetTimeCommandParams + ); + result.put("readNextChargeTargetTimeAttribute", readEnergyEvseNextChargeTargetTimeAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseNextChargeRequiredEnergyCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseNextChargeRequiredEnergyAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readNextChargeRequiredEnergyAttribute( + (ChipClusters.EnergyEvseCluster.NextChargeRequiredEnergyAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyEvseClusterNextChargeRequiredEnergyAttributeCallback(), + readEnergyEvseNextChargeRequiredEnergyCommandParams + ); + result.put("readNextChargeRequiredEnergyAttribute", readEnergyEvseNextChargeRequiredEnergyAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseNextChargeTargetSoCCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseNextChargeTargetSoCAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readNextChargeTargetSoCAttribute( + (ChipClusters.EnergyEvseCluster.NextChargeTargetSoCAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyEvseClusterNextChargeTargetSoCAttributeCallback(), + readEnergyEvseNextChargeTargetSoCCommandParams + ); + result.put("readNextChargeTargetSoCAttribute", readEnergyEvseNextChargeTargetSoCAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseApproximateEVEfficiencyCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseApproximateEVEfficiencyAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readApproximateEVEfficiencyAttribute( + (ChipClusters.EnergyEvseCluster.ApproximateEVEfficiencyAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyEvseClusterApproximateEVEfficiencyAttributeCallback(), + readEnergyEvseApproximateEVEfficiencyCommandParams + ); + result.put("readApproximateEVEfficiencyAttribute", readEnergyEvseApproximateEVEfficiencyAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseStateOfChargeCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseStateOfChargeAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readStateOfChargeAttribute( + (ChipClusters.EnergyEvseCluster.StateOfChargeAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyEvseClusterStateOfChargeAttributeCallback(), + readEnergyEvseStateOfChargeCommandParams + ); + result.put("readStateOfChargeAttribute", readEnergyEvseStateOfChargeAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseBatteryCapacityCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseBatteryCapacityAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readBatteryCapacityAttribute( + (ChipClusters.EnergyEvseCluster.BatteryCapacityAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyEvseClusterBatteryCapacityAttributeCallback(), + readEnergyEvseBatteryCapacityCommandParams + ); + result.put("readBatteryCapacityAttribute", readEnergyEvseBatteryCapacityAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseVehicleIDCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseVehicleIDAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readVehicleIDAttribute( + (ChipClusters.EnergyEvseCluster.VehicleIDAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyEvseClusterVehicleIDAttributeCallback(), + readEnergyEvseVehicleIDCommandParams + ); + result.put("readVehicleIDAttribute", readEnergyEvseVehicleIDAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseSessionIDCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseSessionIDAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readSessionIDAttribute( + (ChipClusters.EnergyEvseCluster.SessionIDAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyEvseClusterSessionIDAttributeCallback(), + readEnergyEvseSessionIDCommandParams + ); + result.put("readSessionIDAttribute", readEnergyEvseSessionIDAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseSessionDurationCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseSessionDurationAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readSessionDurationAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readEnergyEvseSessionDurationCommandParams + ); + result.put("readSessionDurationAttribute", readEnergyEvseSessionDurationAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseSessionEnergyChargedCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseSessionEnergyChargedAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readSessionEnergyChargedAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readEnergyEvseSessionEnergyChargedCommandParams + ); + result.put("readSessionEnergyChargedAttribute", readEnergyEvseSessionEnergyChargedAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseSessionEnergyDischargedCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseSessionEnergyDischargedAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readSessionEnergyDischargedAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readEnergyEvseSessionEnergyDischargedCommandParams + ); + result.put("readSessionEnergyDischargedAttribute", readEnergyEvseSessionEnergyDischargedAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseGeneratedCommandListCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.EnergyEvseCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyEvseClusterGeneratedCommandListAttributeCallback(), + readEnergyEvseGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readEnergyEvseGeneratedCommandListAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseAcceptedCommandListCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.EnergyEvseCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyEvseClusterAcceptedCommandListAttributeCallback(), + readEnergyEvseAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readEnergyEvseAcceptedCommandListAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseEventListCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readEventListAttribute( + (ChipClusters.EnergyEvseCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyEvseClusterEventListAttributeCallback(), + readEnergyEvseEventListCommandParams + ); + result.put("readEventListAttribute", readEnergyEvseEventListAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseAttributeListCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readAttributeListAttribute( + (ChipClusters.EnergyEvseCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedEnergyEvseClusterAttributeListAttributeCallback(), + readEnergyEvseAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readEnergyEvseAttributeListAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseFeatureMapCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readEnergyEvseFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readEnergyEvseFeatureMapAttributeInteractionInfo); + Map<String, CommandParameterInfo> readEnergyEvseClusterRevisionCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readEnergyEvseClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readEnergyEvseClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readEnergyEvseClusterRevisionAttributeInteractionInfo); + + return result; + } private static Map<String, InteractionInfo> readDoorLockInteractionInfo() { Map<String, InteractionInfo> result = new LinkedHashMap<>();Map<String, CommandParameterInfo> readDoorLockLockStateCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); InteractionInfo readDoorLockLockStateAttributeInteractionInfo = new InteractionInfo( @@ -18536,6 +18881,7 @@ public Map<String, Map<String, InteractionInfo>> getReadAttributeMap() { put("booleanSensorConfiguration", readBooleanSensorConfigurationInteractionInfo()); put("valveConfigurationAndControl", readValveConfigurationAndControlInteractionInfo()); put("demandResponseLoadControl", readDemandResponseLoadControlInteractionInfo()); + put("energyEvse", readEnergyEvseInteractionInfo()); put("doorLock", readDoorLockInteractionInfo()); put("windowCovering", readWindowCoveringInteractionInfo()); put("barrierControl", readBarrierControlInteractionInfo()); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index 1516fa1a7efa9a..5b4238c63be532 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -1322,6 +1322,74 @@ public Map<String, Map<String, InteractionInfo>> getWriteAttributeMap() { ); writeDemandResponseLoadControlInteractionInfo.put("writeDefaultRandomDurationAttribute", writeDemandResponseLoadControlDefaultRandomDurationAttributeInteractionInfo); writeAttributeMap.put("demandResponseLoadControl", writeDemandResponseLoadControlInteractionInfo); + Map<String, InteractionInfo> writeEnergyEvseInteractionInfo = new LinkedHashMap<>(); + Map<String, CommandParameterInfo> writeEnergyEvseUserMaximumChargeCurrentCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + CommandParameterInfo energyEvseuserMaximumChargeCurrentCommandParameterInfo = + new CommandParameterInfo( + "value", + Long.class, + Long.class + ); + writeEnergyEvseUserMaximumChargeCurrentCommandParams.put( + "value", + energyEvseuserMaximumChargeCurrentCommandParameterInfo + ); + InteractionInfo writeEnergyEvseUserMaximumChargeCurrentAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).writeUserMaximumChargeCurrentAttribute( + (DefaultClusterCallback) callback, + (Long) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeEnergyEvseUserMaximumChargeCurrentCommandParams + ); + writeEnergyEvseInteractionInfo.put("writeUserMaximumChargeCurrentAttribute", writeEnergyEvseUserMaximumChargeCurrentAttributeInteractionInfo); + Map<String, CommandParameterInfo> writeEnergyEvseRandomizationDelayWindowCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + CommandParameterInfo energyEvserandomizationDelayWindowCommandParameterInfo = + new CommandParameterInfo( + "value", + Long.class, + Long.class + ); + writeEnergyEvseRandomizationDelayWindowCommandParams.put( + "value", + energyEvserandomizationDelayWindowCommandParameterInfo + ); + InteractionInfo writeEnergyEvseRandomizationDelayWindowAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).writeRandomizationDelayWindowAttribute( + (DefaultClusterCallback) callback, + (Long) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeEnergyEvseRandomizationDelayWindowCommandParams + ); + writeEnergyEvseInteractionInfo.put("writeRandomizationDelayWindowAttribute", writeEnergyEvseRandomizationDelayWindowAttributeInteractionInfo); + Map<String, CommandParameterInfo> writeEnergyEvseApproximateEVEfficiencyCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + CommandParameterInfo energyEvseapproximateEVEfficiencyCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeEnergyEvseApproximateEVEfficiencyCommandParams.put( + "value", + energyEvseapproximateEVEfficiencyCommandParameterInfo + ); + InteractionInfo writeEnergyEvseApproximateEVEfficiencyAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.EnergyEvseCluster) cluster).writeApproximateEVEfficiencyAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeEnergyEvseApproximateEVEfficiencyCommandParams + ); + writeEnergyEvseInteractionInfo.put("writeApproximateEVEfficiencyAttribute", writeEnergyEvseApproximateEVEfficiencyAttributeInteractionInfo); + writeAttributeMap.put("energyEvse", writeEnergyEvseInteractionInfo); Map<String, InteractionInfo> writeDoorLockInteractionInfo = new LinkedHashMap<>(); Map<String, CommandParameterInfo> writeDoorLockDoorOpenEventsCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); CommandParameterInfo doorLockdoorOpenEventsCommandParameterInfo = diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEVConnectedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEVConnectedEvent.kt new file mode 100644 index 00000000000000..37d91a3291a9f2 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEVConnectedEvent.kt @@ -0,0 +1,52 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class EnergyEvseClusterEVConnectedEvent(val sessionID: ULong) { + override fun toString(): String = buildString { + append("EnergyEvseClusterEVConnectedEvent {\n") + append("\tsessionID : $sessionID\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SESSION_I_D), sessionID) + endStructure() + } + } + + companion object { + private const val TAG_SESSION_I_D = 0 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterEVConnectedEvent { + tlvReader.enterStructure(tlvTag) + val sessionID = tlvReader.getULong(ContextSpecificTag(TAG_SESSION_I_D)) + + tlvReader.exitContainer() + + return EnergyEvseClusterEVConnectedEvent(sessionID) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEVNotDetectedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEVNotDetectedEvent.kt new file mode 100644 index 00000000000000..5720d4469df39c --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEVNotDetectedEvent.kt @@ -0,0 +1,89 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class EnergyEvseClusterEVNotDetectedEvent( + val sessionID: ULong, + val state: UInt, + val sessionDuration: ULong, + val sessionEnergyCharged: Long, + val sessionEnergyDischarged: Optional<Long> +) { + override fun toString(): String = buildString { + append("EnergyEvseClusterEVNotDetectedEvent {\n") + append("\tsessionID : $sessionID\n") + append("\tstate : $state\n") + append("\tsessionDuration : $sessionDuration\n") + append("\tsessionEnergyCharged : $sessionEnergyCharged\n") + append("\tsessionEnergyDischarged : $sessionEnergyDischarged\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SESSION_I_D), sessionID) + put(ContextSpecificTag(TAG_STATE), state) + put(ContextSpecificTag(TAG_SESSION_DURATION), sessionDuration) + put(ContextSpecificTag(TAG_SESSION_ENERGY_CHARGED), sessionEnergyCharged) + if (sessionEnergyDischarged.isPresent) { + val optsessionEnergyDischarged = sessionEnergyDischarged.get() + put(ContextSpecificTag(TAG_SESSION_ENERGY_DISCHARGED), optsessionEnergyDischarged) + } + endStructure() + } + } + + companion object { + private const val TAG_SESSION_I_D = 0 + private const val TAG_STATE = 1 + private const val TAG_SESSION_DURATION = 2 + private const val TAG_SESSION_ENERGY_CHARGED = 3 + private const val TAG_SESSION_ENERGY_DISCHARGED = 4 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterEVNotDetectedEvent { + tlvReader.enterStructure(tlvTag) + val sessionID = tlvReader.getULong(ContextSpecificTag(TAG_SESSION_I_D)) + val state = tlvReader.getUInt(ContextSpecificTag(TAG_STATE)) + val sessionDuration = tlvReader.getULong(ContextSpecificTag(TAG_SESSION_DURATION)) + val sessionEnergyCharged = tlvReader.getLong(ContextSpecificTag(TAG_SESSION_ENERGY_CHARGED)) + val sessionEnergyDischarged = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_SESSION_ENERGY_DISCHARGED))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_SESSION_ENERGY_DISCHARGED))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return EnergyEvseClusterEVNotDetectedEvent( + sessionID, + state, + sessionDuration, + sessionEnergyCharged, + sessionEnergyDischarged + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt new file mode 100644 index 00000000000000..7843215518c11d --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt @@ -0,0 +1,64 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class EnergyEvseClusterEnergyTransferStartedEvent( + val sessionID: ULong, + val state: UInt, + val maximumCurrent: Long +) { + override fun toString(): String = buildString { + append("EnergyEvseClusterEnergyTransferStartedEvent {\n") + append("\tsessionID : $sessionID\n") + append("\tstate : $state\n") + append("\tmaximumCurrent : $maximumCurrent\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SESSION_I_D), sessionID) + put(ContextSpecificTag(TAG_STATE), state) + put(ContextSpecificTag(TAG_MAXIMUM_CURRENT), maximumCurrent) + endStructure() + } + } + + companion object { + private const val TAG_SESSION_I_D = 0 + private const val TAG_STATE = 1 + private const val TAG_MAXIMUM_CURRENT = 2 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterEnergyTransferStartedEvent { + tlvReader.enterStructure(tlvTag) + val sessionID = tlvReader.getULong(ContextSpecificTag(TAG_SESSION_I_D)) + val state = tlvReader.getUInt(ContextSpecificTag(TAG_STATE)) + val maximumCurrent = tlvReader.getLong(ContextSpecificTag(TAG_MAXIMUM_CURRENT)) + + tlvReader.exitContainer() + + return EnergyEvseClusterEnergyTransferStartedEvent(sessionID, state, maximumCurrent) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt new file mode 100644 index 00000000000000..642bbc9b5e7a04 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt @@ -0,0 +1,74 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class EnergyEvseClusterEnergyTransferStoppedEvent( + val sessionID: ULong, + val state: UInt, + val reason: UInt, + val energyTransferred: Long +) { + override fun toString(): String = buildString { + append("EnergyEvseClusterEnergyTransferStoppedEvent {\n") + append("\tsessionID : $sessionID\n") + append("\tstate : $state\n") + append("\treason : $reason\n") + append("\tenergyTransferred : $energyTransferred\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SESSION_I_D), sessionID) + put(ContextSpecificTag(TAG_STATE), state) + put(ContextSpecificTag(TAG_REASON), reason) + put(ContextSpecificTag(TAG_ENERGY_TRANSFERRED), energyTransferred) + endStructure() + } + } + + companion object { + private const val TAG_SESSION_I_D = 0 + private const val TAG_STATE = 1 + private const val TAG_REASON = 2 + private const val TAG_ENERGY_TRANSFERRED = 4 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterEnergyTransferStoppedEvent { + tlvReader.enterStructure(tlvTag) + val sessionID = tlvReader.getULong(ContextSpecificTag(TAG_SESSION_I_D)) + val state = tlvReader.getUInt(ContextSpecificTag(TAG_STATE)) + val reason = tlvReader.getUInt(ContextSpecificTag(TAG_REASON)) + val energyTransferred = tlvReader.getLong(ContextSpecificTag(TAG_ENERGY_TRANSFERRED)) + + tlvReader.exitContainer() + + return EnergyEvseClusterEnergyTransferStoppedEvent( + sessionID, + state, + reason, + energyTransferred + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterFaultEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterFaultEvent.kt new file mode 100644 index 00000000000000..2b82c363aa442c --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterFaultEvent.kt @@ -0,0 +1,76 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class EnergyEvseClusterFaultEvent( + val sessionID: ULong, + val state: UInt, + val faultStatePreviousState: UInt, + val faultStateCurrentState: UInt +) { + override fun toString(): String = buildString { + append("EnergyEvseClusterFaultEvent {\n") + append("\tsessionID : $sessionID\n") + append("\tstate : $state\n") + append("\tfaultStatePreviousState : $faultStatePreviousState\n") + append("\tfaultStateCurrentState : $faultStateCurrentState\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SESSION_I_D), sessionID) + put(ContextSpecificTag(TAG_STATE), state) + put(ContextSpecificTag(TAG_FAULT_STATE_PREVIOUS_STATE), faultStatePreviousState) + put(ContextSpecificTag(TAG_FAULT_STATE_CURRENT_STATE), faultStateCurrentState) + endStructure() + } + } + + companion object { + private const val TAG_SESSION_I_D = 0 + private const val TAG_STATE = 1 + private const val TAG_FAULT_STATE_PREVIOUS_STATE = 2 + private const val TAG_FAULT_STATE_CURRENT_STATE = 4 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterFaultEvent { + tlvReader.enterStructure(tlvTag) + val sessionID = tlvReader.getULong(ContextSpecificTag(TAG_SESSION_I_D)) + val state = tlvReader.getUInt(ContextSpecificTag(TAG_STATE)) + val faultStatePreviousState = + tlvReader.getUInt(ContextSpecificTag(TAG_FAULT_STATE_PREVIOUS_STATE)) + val faultStateCurrentState = + tlvReader.getUInt(ContextSpecificTag(TAG_FAULT_STATE_CURRENT_STATE)) + + tlvReader.exitContainer() + + return EnergyEvseClusterFaultEvent( + sessionID, + state, + faultStatePreviousState, + faultStateCurrentState + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterRFIDEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterRFIDEvent.kt new file mode 100644 index 00000000000000..760bc2cd92b2eb --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterRFIDEvent.kt @@ -0,0 +1,52 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class EnergyEvseClusterRFIDEvent(val uid: ByteArray) { + override fun toString(): String = buildString { + append("EnergyEvseClusterRFIDEvent {\n") + append("\tuid : $uid\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_UID), uid) + endStructure() + } + } + + companion object { + private const val TAG_UID = 0 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterRFIDEvent { + tlvReader.enterStructure(tlvTag) + val uid = tlvReader.getByteArray(ContextSpecificTag(TAG_UID)) + + tlvReader.exitContainer() + + return EnergyEvseClusterRFIDEvent(uid) + } + } +} 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 3efc1df1f73f16..5e4c85f35334ea 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni @@ -37,6 +37,7 @@ structs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DishwasherModeClusterModeOptionStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DishwasherModeClusterModeTagStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DoorLockClusterCredentialStruct.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/FixedLabelClusterLabelStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GeneralCommissioningClusterBasicCommissioningInfo.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GeneralDiagnosticsClusterNetworkInterface.kt", @@ -117,6 +118,12 @@ eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockOperationEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockOperationErrorEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockUserChangeEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEVConnectedEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEVNotDetectedEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterFaultEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterRFIDEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterBootReasonEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterHardwareFaultChangeEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterNetworkFaultChangeEvent.kt", diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyEvseClusterChargingTargetStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyEvseClusterChargingTargetStruct.kt new file mode 100644 index 00000000000000..f457f066ff27bc --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyEvseClusterChargingTargetStruct.kt @@ -0,0 +1,81 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class EnergyEvseClusterChargingTargetStruct( + val targetTime: UInt, + val targetSoC: Optional<UInt>, + val addedEnergy: Optional<Long> +) { + override fun toString(): String = buildString { + append("EnergyEvseClusterChargingTargetStruct {\n") + append("\ttargetTime : $targetTime\n") + append("\ttargetSoC : $targetSoC\n") + append("\taddedEnergy : $addedEnergy\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_TARGET_TIME), targetTime) + if (targetSoC.isPresent) { + val opttargetSoC = targetSoC.get() + put(ContextSpecificTag(TAG_TARGET_SO_C), opttargetSoC) + } + if (addedEnergy.isPresent) { + val optaddedEnergy = addedEnergy.get() + put(ContextSpecificTag(TAG_ADDED_ENERGY), optaddedEnergy) + } + endStructure() + } + } + + companion object { + private const val TAG_TARGET_TIME = 0 + private const val TAG_TARGET_SO_C = 1 + private const val TAG_ADDED_ENERGY = 2 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterChargingTargetStruct { + tlvReader.enterStructure(tlvTag) + val targetTime = tlvReader.getUInt(ContextSpecificTag(TAG_TARGET_TIME)) + val targetSoC = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_TARGET_SO_C))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_TARGET_SO_C))) + } else { + Optional.empty() + } + val addedEnergy = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_ADDED_ENERGY))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_ADDED_ENERGY))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return EnergyEvseClusterChargingTargetStruct(targetTime, targetSoC, addedEnergy) + } + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/EnergyEvseCluster.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/EnergyEvseCluster.kt new file mode 100644 index 00000000000000..8e5208cee1d2b4 --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/EnergyEvseCluster.kt @@ -0,0 +1,436 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package matter.devicecontroller.cluster.clusters + +import matter.controller.MatterController +import matter.devicecontroller.cluster.structs.* + +class EnergyEvseCluster(private val controller: MatterController, private val endpointId: UShort) { + class GetTargetsResponse( + val dayOfWeekforSequence: UInt, + val chargingTargets: List<EnergyEvseClusterChargingTargetStruct> + ) + + class StateAttribute(val value: UInt?) + + class ChargingEnabledUntilAttribute(val value: UInt?) + + class DischargingEnabledUntilAttribute(val value: UInt?) + + class NextChargeStartTimeAttribute(val value: UInt?) + + class NextChargeTargetTimeAttribute(val value: UInt?) + + class NextChargeRequiredEnergyAttribute(val value: Long?) + + class NextChargeTargetSoCAttribute(val value: UByte?) + + class ApproximateEVEfficiencyAttribute(val value: UShort?) + + class StateOfChargeAttribute(val value: UByte?) + + class BatteryCapacityAttribute(val value: Long?) + + class VehicleIDAttribute(val value: String?) + + class SessionIDAttribute(val value: UInt?) + + class GeneratedCommandListAttribute(val value: List<UInt>) + + class AcceptedCommandListAttribute(val value: List<UInt>) + + class EventListAttribute(val value: List<UInt>) + + class AttributeListAttribute(val value: List<UInt>) + + suspend fun disable(timedInvokeTimeoutMs: Int) { + val commandId = 1L + + // Implementation needs to be added here + } + + suspend fun enableCharging( + chargingEnabledUntil: UInt?, + minimumChargeCurrent: Long, + maximumChargeCurrent: Long, + timedInvokeTimeoutMs: Int + ) { + val commandId = 2L + + // Implementation needs to be added here + } + + suspend fun enableDischarging( + dischargingEnabledUntil: UInt?, + maximumDischargeCurrent: Long, + timedInvokeTimeoutMs: Int + ) { + val commandId = 3L + + // Implementation needs to be added here + } + + suspend fun startDiagnostics(timedInvokeTimeoutMs: Int) { + val commandId = 4L + + // Implementation needs to be added here + } + + suspend fun setTargets( + dayOfWeekforSequence: UInt, + chargingTargets: List<EnergyEvseClusterChargingTargetStruct>, + timedInvokeTimeoutMs: Int + ) { + val commandId = 5L + + // Implementation needs to be added here + } + + suspend fun getTargets(daysToReturn: UInt, timedInvokeTimeoutMs: Int): GetTargetsResponse { + val commandId = 6L + + // Implementation needs to be added here + } + + suspend fun clearTargets(timedInvokeTimeoutMs: Int) { + val commandId = 7L + + // Implementation needs to be added here + } + + suspend fun readStateAttribute(): StateAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeStateAttribute(minInterval: Int, maxInterval: Int): StateAttribute { + // Implementation needs to be added here + } + + suspend fun readSupplyStateAttribute(): UByte { + // Implementation needs to be added here + } + + suspend fun subscribeSupplyStateAttribute(minInterval: Int, maxInterval: Int): UByte { + // Implementation needs to be added here + } + + suspend fun readFaultStateAttribute(): UByte { + // Implementation needs to be added here + } + + suspend fun subscribeFaultStateAttribute(minInterval: Int, maxInterval: Int): UByte { + // Implementation needs to be added here + } + + suspend fun readChargingEnabledUntilAttribute(): ChargingEnabledUntilAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeChargingEnabledUntilAttribute( + minInterval: Int, + maxInterval: Int + ): ChargingEnabledUntilAttribute { + // Implementation needs to be added here + } + + suspend fun readDischargingEnabledUntilAttribute(): DischargingEnabledUntilAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeDischargingEnabledUntilAttribute( + minInterval: Int, + maxInterval: Int + ): DischargingEnabledUntilAttribute { + // Implementation needs to be added here + } + + suspend fun readCircuitCapacityAttribute(): Long { + // Implementation needs to be added here + } + + suspend fun subscribeCircuitCapacityAttribute(minInterval: Int, maxInterval: Int): Long { + // Implementation needs to be added here + } + + suspend fun readMinimumChargeCurrentAttribute(): Long { + // Implementation needs to be added here + } + + suspend fun subscribeMinimumChargeCurrentAttribute(minInterval: Int, maxInterval: Int): Long { + // Implementation needs to be added here + } + + suspend fun readMaximumChargeCurrentAttribute(): Long { + // Implementation needs to be added here + } + + suspend fun subscribeMaximumChargeCurrentAttribute(minInterval: Int, maxInterval: Int): Long { + // Implementation needs to be added here + } + + suspend fun readMaximumDischargeCurrentAttribute(): Long { + // Implementation needs to be added here + } + + suspend fun subscribeMaximumDischargeCurrentAttribute(minInterval: Int, maxInterval: Int): Long { + // Implementation needs to be added here + } + + suspend fun readUserMaximumChargeCurrentAttribute(): Long { + // Implementation needs to be added here + } + + suspend fun writeUserMaximumChargeCurrentAttribute( + value: Long, + timedWriteTimeoutMs: Int? = null + ) { + if (timedWriteTimeoutMs != null) { + // Do the action with timedWriteTimeoutMs + } else { + // Do the action without timedWriteTimeoutMs + } + } + + suspend fun subscribeUserMaximumChargeCurrentAttribute(minInterval: Int, maxInterval: Int): Long { + // Implementation needs to be added here + } + + suspend fun readRandomizationDelayWindowAttribute(): UInt { + // Implementation needs to be added here + } + + suspend fun writeRandomizationDelayWindowAttribute( + value: UInt, + timedWriteTimeoutMs: Int? = null + ) { + if (timedWriteTimeoutMs != null) { + // Do the action with timedWriteTimeoutMs + } else { + // Do the action without timedWriteTimeoutMs + } + } + + suspend fun subscribeRandomizationDelayWindowAttribute(minInterval: Int, maxInterval: Int): UInt { + // Implementation needs to be added here + } + + suspend fun readNumberOfWeeklyTargetsAttribute(): UByte { + // Implementation needs to be added here + } + + suspend fun subscribeNumberOfWeeklyTargetsAttribute(minInterval: Int, maxInterval: Int): UByte { + // Implementation needs to be added here + } + + suspend fun readNumberOfDailyTargetsAttribute(): UByte { + // Implementation needs to be added here + } + + suspend fun subscribeNumberOfDailyTargetsAttribute(minInterval: Int, maxInterval: Int): UByte { + // Implementation needs to be added here + } + + suspend fun readNextChargeStartTimeAttribute(): NextChargeStartTimeAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeNextChargeStartTimeAttribute( + minInterval: Int, + maxInterval: Int + ): NextChargeStartTimeAttribute { + // Implementation needs to be added here + } + + suspend fun readNextChargeTargetTimeAttribute(): NextChargeTargetTimeAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeNextChargeTargetTimeAttribute( + minInterval: Int, + maxInterval: Int + ): NextChargeTargetTimeAttribute { + // Implementation needs to be added here + } + + suspend fun readNextChargeRequiredEnergyAttribute(): NextChargeRequiredEnergyAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeNextChargeRequiredEnergyAttribute( + minInterval: Int, + maxInterval: Int + ): NextChargeRequiredEnergyAttribute { + // Implementation needs to be added here + } + + suspend fun readNextChargeTargetSoCAttribute(): NextChargeTargetSoCAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeNextChargeTargetSoCAttribute( + minInterval: Int, + maxInterval: Int + ): NextChargeTargetSoCAttribute { + // Implementation needs to be added here + } + + suspend fun readApproximateEVEfficiencyAttribute(): ApproximateEVEfficiencyAttribute { + // Implementation needs to be added here + } + + suspend fun writeApproximateEVEfficiencyAttribute( + value: UShort, + timedWriteTimeoutMs: Int? = null + ) { + if (timedWriteTimeoutMs != null) { + // Do the action with timedWriteTimeoutMs + } else { + // Do the action without timedWriteTimeoutMs + } + } + + suspend fun subscribeApproximateEVEfficiencyAttribute( + minInterval: Int, + maxInterval: Int + ): ApproximateEVEfficiencyAttribute { + // Implementation needs to be added here + } + + suspend fun readStateOfChargeAttribute(): StateOfChargeAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeStateOfChargeAttribute( + minInterval: Int, + maxInterval: Int + ): StateOfChargeAttribute { + // Implementation needs to be added here + } + + suspend fun readBatteryCapacityAttribute(): BatteryCapacityAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeBatteryCapacityAttribute( + minInterval: Int, + maxInterval: Int + ): BatteryCapacityAttribute { + // Implementation needs to be added here + } + + suspend fun readVehicleIDAttribute(): VehicleIDAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeVehicleIDAttribute(minInterval: Int, maxInterval: Int): VehicleIDAttribute { + // Implementation needs to be added here + } + + suspend fun readSessionIDAttribute(): SessionIDAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeSessionIDAttribute(minInterval: Int, maxInterval: Int): SessionIDAttribute { + // Implementation needs to be added here + } + + suspend fun readSessionDurationAttribute(): UInt { + // Implementation needs to be added here + } + + suspend fun subscribeSessionDurationAttribute(minInterval: Int, maxInterval: Int): UInt { + // Implementation needs to be added here + } + + suspend fun readSessionEnergyChargedAttribute(): Long { + // Implementation needs to be added here + } + + suspend fun subscribeSessionEnergyChargedAttribute(minInterval: Int, maxInterval: Int): Long { + // Implementation needs to be added here + } + + suspend fun readSessionEnergyDischargedAttribute(): Long { + // Implementation needs to be added here + } + + suspend fun subscribeSessionEnergyDischargedAttribute(minInterval: Int, maxInterval: Int): Long { + // Implementation needs to be added here + } + + suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeGeneratedCommandListAttribute( + minInterval: Int, + maxInterval: Int + ): GeneratedCommandListAttribute { + // Implementation needs to be added here + } + + suspend fun readAcceptedCommandListAttribute(): AcceptedCommandListAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeAcceptedCommandListAttribute( + minInterval: Int, + maxInterval: Int + ): AcceptedCommandListAttribute { + // Implementation needs to be added here + } + + suspend fun readEventListAttribute(): EventListAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeEventListAttribute(minInterval: Int, maxInterval: Int): EventListAttribute { + // Implementation needs to be added here + } + + suspend fun readAttributeListAttribute(): AttributeListAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeAttributeListAttribute( + minInterval: Int, + maxInterval: Int + ): AttributeListAttribute { + // Implementation needs to be added here + } + + suspend fun readFeatureMapAttribute(): UInt { + // Implementation needs to be added here + } + + suspend fun subscribeFeatureMapAttribute(minInterval: Int, maxInterval: Int): UInt { + // Implementation needs to be added here + } + + suspend fun readClusterRevisionAttribute(): UShort { + // Implementation needs to be added here + } + + suspend fun subscribeClusterRevisionAttribute(minInterval: Int, maxInterval: Int): UShort { + // Implementation needs to be added here + } + + companion object { + const val CLUSTER_ID: UInt = 153u + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterEVConnectedEvent.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterEVConnectedEvent.kt new file mode 100644 index 00000000000000..d3357439368b80 --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterEVConnectedEvent.kt @@ -0,0 +1,52 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.devicecontroller.cluster.eventstructs + +import matter.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class EnergyEvseClusterEVConnectedEvent(val sessionID: UInt) { + override fun toString(): String = buildString { + append("EnergyEvseClusterEVConnectedEvent {\n") + append("\tsessionID : $sessionID\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SESSION_I_D), sessionID) + endStructure() + } + } + + companion object { + private const val TAG_SESSION_I_D = 0 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterEVConnectedEvent { + tlvReader.enterStructure(tlvTag) + val sessionID = tlvReader.getUInt(ContextSpecificTag(TAG_SESSION_I_D)) + + tlvReader.exitContainer() + + return EnergyEvseClusterEVConnectedEvent(sessionID) + } + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterEVNotDetectedEvent.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterEVNotDetectedEvent.kt new file mode 100644 index 00000000000000..8f38fc18fdbacf --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterEVNotDetectedEvent.kt @@ -0,0 +1,89 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.devicecontroller.cluster.eventstructs + +import java.util.Optional +import matter.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class EnergyEvseClusterEVNotDetectedEvent( + val sessionID: UInt, + val state: UInt, + val sessionDuration: UInt, + val sessionEnergyCharged: Long, + val sessionEnergyDischarged: Optional<Long> +) { + override fun toString(): String = buildString { + append("EnergyEvseClusterEVNotDetectedEvent {\n") + append("\tsessionID : $sessionID\n") + append("\tstate : $state\n") + append("\tsessionDuration : $sessionDuration\n") + append("\tsessionEnergyCharged : $sessionEnergyCharged\n") + append("\tsessionEnergyDischarged : $sessionEnergyDischarged\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SESSION_I_D), sessionID) + put(ContextSpecificTag(TAG_STATE), state) + put(ContextSpecificTag(TAG_SESSION_DURATION), sessionDuration) + put(ContextSpecificTag(TAG_SESSION_ENERGY_CHARGED), sessionEnergyCharged) + if (sessionEnergyDischarged.isPresent) { + val optsessionEnergyDischarged = sessionEnergyDischarged.get() + put(ContextSpecificTag(TAG_SESSION_ENERGY_DISCHARGED), optsessionEnergyDischarged) + } + endStructure() + } + } + + companion object { + private const val TAG_SESSION_I_D = 0 + private const val TAG_STATE = 1 + private const val TAG_SESSION_DURATION = 2 + private const val TAG_SESSION_ENERGY_CHARGED = 3 + private const val TAG_SESSION_ENERGY_DISCHARGED = 4 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterEVNotDetectedEvent { + tlvReader.enterStructure(tlvTag) + val sessionID = tlvReader.getUInt(ContextSpecificTag(TAG_SESSION_I_D)) + val state = tlvReader.getUInt(ContextSpecificTag(TAG_STATE)) + val sessionDuration = tlvReader.getUInt(ContextSpecificTag(TAG_SESSION_DURATION)) + val sessionEnergyCharged = tlvReader.getLong(ContextSpecificTag(TAG_SESSION_ENERGY_CHARGED)) + val sessionEnergyDischarged = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_SESSION_ENERGY_DISCHARGED))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_SESSION_ENERGY_DISCHARGED))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return EnergyEvseClusterEVNotDetectedEvent( + sessionID, + state, + sessionDuration, + sessionEnergyCharged, + sessionEnergyDischarged + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt new file mode 100644 index 00000000000000..14630d9043c38d --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt @@ -0,0 +1,64 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.devicecontroller.cluster.eventstructs + +import matter.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class EnergyEvseClusterEnergyTransferStartedEvent( + val sessionID: UInt, + val state: UInt, + val maximumCurrent: Long +) { + override fun toString(): String = buildString { + append("EnergyEvseClusterEnergyTransferStartedEvent {\n") + append("\tsessionID : $sessionID\n") + append("\tstate : $state\n") + append("\tmaximumCurrent : $maximumCurrent\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SESSION_I_D), sessionID) + put(ContextSpecificTag(TAG_STATE), state) + put(ContextSpecificTag(TAG_MAXIMUM_CURRENT), maximumCurrent) + endStructure() + } + } + + companion object { + private const val TAG_SESSION_I_D = 0 + private const val TAG_STATE = 1 + private const val TAG_MAXIMUM_CURRENT = 2 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterEnergyTransferStartedEvent { + tlvReader.enterStructure(tlvTag) + val sessionID = tlvReader.getUInt(ContextSpecificTag(TAG_SESSION_I_D)) + val state = tlvReader.getUInt(ContextSpecificTag(TAG_STATE)) + val maximumCurrent = tlvReader.getLong(ContextSpecificTag(TAG_MAXIMUM_CURRENT)) + + tlvReader.exitContainer() + + return EnergyEvseClusterEnergyTransferStartedEvent(sessionID, state, maximumCurrent) + } + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt new file mode 100644 index 00000000000000..8ce39cc2ccef2c --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt @@ -0,0 +1,74 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.devicecontroller.cluster.eventstructs + +import matter.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class EnergyEvseClusterEnergyTransferStoppedEvent( + val sessionID: UInt, + val state: UInt, + val reason: UInt, + val energyTransferred: Long +) { + override fun toString(): String = buildString { + append("EnergyEvseClusterEnergyTransferStoppedEvent {\n") + append("\tsessionID : $sessionID\n") + append("\tstate : $state\n") + append("\treason : $reason\n") + append("\tenergyTransferred : $energyTransferred\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SESSION_I_D), sessionID) + put(ContextSpecificTag(TAG_STATE), state) + put(ContextSpecificTag(TAG_REASON), reason) + put(ContextSpecificTag(TAG_ENERGY_TRANSFERRED), energyTransferred) + endStructure() + } + } + + companion object { + private const val TAG_SESSION_I_D = 0 + private const val TAG_STATE = 1 + private const val TAG_REASON = 2 + private const val TAG_ENERGY_TRANSFERRED = 4 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterEnergyTransferStoppedEvent { + tlvReader.enterStructure(tlvTag) + val sessionID = tlvReader.getUInt(ContextSpecificTag(TAG_SESSION_I_D)) + val state = tlvReader.getUInt(ContextSpecificTag(TAG_STATE)) + val reason = tlvReader.getUInt(ContextSpecificTag(TAG_REASON)) + val energyTransferred = tlvReader.getLong(ContextSpecificTag(TAG_ENERGY_TRANSFERRED)) + + tlvReader.exitContainer() + + return EnergyEvseClusterEnergyTransferStoppedEvent( + sessionID, + state, + reason, + energyTransferred + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterFaultEvent.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterFaultEvent.kt new file mode 100644 index 00000000000000..71cdcae9dc193f --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterFaultEvent.kt @@ -0,0 +1,76 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.devicecontroller.cluster.eventstructs + +import matter.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class EnergyEvseClusterFaultEvent( + val sessionID: UInt, + val state: UInt, + val faultStatePreviousState: UInt, + val faultStateCurrentState: UInt +) { + override fun toString(): String = buildString { + append("EnergyEvseClusterFaultEvent {\n") + append("\tsessionID : $sessionID\n") + append("\tstate : $state\n") + append("\tfaultStatePreviousState : $faultStatePreviousState\n") + append("\tfaultStateCurrentState : $faultStateCurrentState\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SESSION_I_D), sessionID) + put(ContextSpecificTag(TAG_STATE), state) + put(ContextSpecificTag(TAG_FAULT_STATE_PREVIOUS_STATE), faultStatePreviousState) + put(ContextSpecificTag(TAG_FAULT_STATE_CURRENT_STATE), faultStateCurrentState) + endStructure() + } + } + + companion object { + private const val TAG_SESSION_I_D = 0 + private const val TAG_STATE = 1 + private const val TAG_FAULT_STATE_PREVIOUS_STATE = 2 + private const val TAG_FAULT_STATE_CURRENT_STATE = 4 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterFaultEvent { + tlvReader.enterStructure(tlvTag) + val sessionID = tlvReader.getUInt(ContextSpecificTag(TAG_SESSION_I_D)) + val state = tlvReader.getUInt(ContextSpecificTag(TAG_STATE)) + val faultStatePreviousState = + tlvReader.getUInt(ContextSpecificTag(TAG_FAULT_STATE_PREVIOUS_STATE)) + val faultStateCurrentState = + tlvReader.getUInt(ContextSpecificTag(TAG_FAULT_STATE_CURRENT_STATE)) + + tlvReader.exitContainer() + + return EnergyEvseClusterFaultEvent( + sessionID, + state, + faultStatePreviousState, + faultStateCurrentState + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterRFIDEvent.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterRFIDEvent.kt new file mode 100644 index 00000000000000..65558cac9a6b7a --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterRFIDEvent.kt @@ -0,0 +1,52 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.devicecontroller.cluster.eventstructs + +import matter.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class EnergyEvseClusterRFIDEvent(val uid: ByteArray) { + override fun toString(): String = buildString { + append("EnergyEvseClusterRFIDEvent {\n") + append("\tuid : $uid\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_UID), uid) + endStructure() + } + } + + companion object { + private const val TAG_UID = 0 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterRFIDEvent { + tlvReader.enterStructure(tlvTag) + val uid = tlvReader.getByteArray(ContextSpecificTag(TAG_UID)) + + tlvReader.exitContainer() + + return EnergyEvseClusterRFIDEvent(uid) + } + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/files.gni b/src/controller/java/generated/java/matter/devicecontroller/cluster/files.gni index b7b954def5b75e..ff4d4116b610cc 100644 --- a/src/controller/java/generated/java/matter/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/files.gni @@ -37,6 +37,7 @@ matter_structs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/DishwasherModeClusterModeOptionStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/DishwasherModeClusterModeTagStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/DoorLockClusterCredentialStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/EnergyEvseClusterChargingTargetStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/FixedLabelClusterLabelStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/GeneralCommissioningClusterBasicCommissioningInfo.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/GeneralDiagnosticsClusterNetworkInterface.kt", @@ -117,6 +118,12 @@ matter_eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/DoorLockClusterLockOperationEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/DoorLockClusterLockOperationErrorEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/DoorLockClusterLockUserChangeEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterEVConnectedEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterEVNotDetectedEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterFaultEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/EnergyEvseClusterRFIDEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterBootReasonEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterHardwareFaultChangeEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterNetworkFaultChangeEvent.kt", @@ -188,6 +195,7 @@ matter_clusters_sources = [ "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/DishwasherModeCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/DoorLockCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ElectricalMeasurementCluster.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/EnergyEvseCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/EthernetNetworkDiagnosticsCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/FanControlCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/FaultInjectionCluster.kt", diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/EnergyEvseClusterChargingTargetStruct.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/EnergyEvseClusterChargingTargetStruct.kt new file mode 100644 index 00000000000000..a81f4c8716c8e8 --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/EnergyEvseClusterChargingTargetStruct.kt @@ -0,0 +1,81 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.devicecontroller.cluster.structs + +import java.util.Optional +import matter.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class EnergyEvseClusterChargingTargetStruct( + val targetTime: UShort, + val targetSoC: Optional<UByte>, + val addedEnergy: Optional<Long> +) { + override fun toString(): String = buildString { + append("EnergyEvseClusterChargingTargetStruct {\n") + append("\ttargetTime : $targetTime\n") + append("\ttargetSoC : $targetSoC\n") + append("\taddedEnergy : $addedEnergy\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_TARGET_TIME), targetTime) + if (targetSoC.isPresent) { + val opttargetSoC = targetSoC.get() + put(ContextSpecificTag(TAG_TARGET_SO_C), opttargetSoC) + } + if (addedEnergy.isPresent) { + val optaddedEnergy = addedEnergy.get() + put(ContextSpecificTag(TAG_ADDED_ENERGY), optaddedEnergy) + } + endStructure() + } + } + + companion object { + private const val TAG_TARGET_TIME = 0 + private const val TAG_TARGET_SO_C = 1 + private const val TAG_ADDED_ENERGY = 2 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterChargingTargetStruct { + tlvReader.enterStructure(tlvTag) + val targetTime = tlvReader.getUShort(ContextSpecificTag(TAG_TARGET_TIME)) + val targetSoC = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_TARGET_SO_C))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_TARGET_SO_C))) + } else { + Optional.empty() + } + val addedEnergy = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_ADDED_ENERGY))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_ADDED_ENERGY))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return EnergyEvseClusterChargingTargetStruct(targetTime, targetSoC, addedEnergy) + } + } +} diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 578272e2e515c4..f9f0cb6e56e6d4 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -20357,6 +20357,628 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::EnergyEvse::Id: { + using namespace app::Clusters::EnergyEvse; + switch (aPath.mAttributeId) + { + case Attributes::State::Id: { + using TypeInfo = Attributes::State::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast<jint>(cppValue.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + } + return value; + } + case Attributes::SupplyState::Id: { + using TypeInfo = Attributes::SupplyState::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<jint>(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::FaultState::Id: { + using TypeInfo = Attributes::FaultState::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<jint>(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::ChargingEnabledUntil::Id: { + using TypeInfo = Attributes::ChargingEnabledUntil::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast<jlong>(cppValue.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + } + return value; + } + case Attributes::DischargingEnabledUntil::Id: { + using TypeInfo = Attributes::DischargingEnabledUntil::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast<jlong>(cppValue.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + } + return value; + } + case Attributes::CircuitCapacity::Id: { + using TypeInfo = Attributes::CircuitCapacity::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast<jlong>(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::MinimumChargeCurrent::Id: { + using TypeInfo = Attributes::MinimumChargeCurrent::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast<jlong>(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::MaximumChargeCurrent::Id: { + using TypeInfo = Attributes::MaximumChargeCurrent::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast<jlong>(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::MaximumDischargeCurrent::Id: { + using TypeInfo = Attributes::MaximumDischargeCurrent::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast<jlong>(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::UserMaximumChargeCurrent::Id: { + using TypeInfo = Attributes::UserMaximumChargeCurrent::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast<jlong>(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::RandomizationDelayWindow::Id: { + using TypeInfo = Attributes::RandomizationDelayWindow::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast<jlong>(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(valueClassName.c_str(), valueCtorSignature.c_str(), + 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<jint>(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>(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<jint>(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::NextChargeStartTime::Id: { + using TypeInfo = Attributes::NextChargeStartTime::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast<jlong>(cppValue.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + } + return value; + } + case Attributes::NextChargeTargetTime::Id: { + using TypeInfo = Attributes::NextChargeTargetTime::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast<jlong>(cppValue.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + } + return value; + } + case Attributes::NextChargeRequiredEnergy::Id: { + using TypeInfo = Attributes::NextChargeRequiredEnergy::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast<jlong>(cppValue.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + } + return value; + } + case Attributes::NextChargeTargetSoC::Id: { + using TypeInfo = Attributes::NextChargeTargetSoC::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast<jint>(cppValue.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + } + return value; + } + case Attributes::ApproximateEVEfficiency::Id: { + using TypeInfo = Attributes::ApproximateEVEfficiency::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast<jint>(cppValue.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + } + return value; + } + case Attributes::StateOfCharge::Id: { + using TypeInfo = Attributes::StateOfCharge::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast<jint>(cppValue.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + } + return value; + } + case Attributes::BatteryCapacity::Id: { + using TypeInfo = Attributes::BatteryCapacity::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast<jlong>(cppValue.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + } + return value; + } + case Attributes::VehicleID::Id: { + using TypeInfo = Attributes::VehicleID::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value(), value)); + } + return value; + } + case Attributes::SessionID::Id: { + using TypeInfo = Attributes::SessionID::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast<jlong>(cppValue.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + } + return value; + } + case Attributes::SessionDuration::Id: { + using TypeInfo = Attributes::SessionDuration::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast<jlong>(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::SessionEnergyCharged::Id: { + using TypeInfo = Attributes::SessionEnergyCharged::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast<jlong>(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::SessionEnergyDischarged::Id: { + using TypeInfo = Attributes::SessionEnergyDischarged::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast<jlong>(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast<jlong>(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast<jlong>(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast<jlong>(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast<jlong>(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast<jlong>(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast<jint>(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } case app::Clusters::DoorLock::Id: { using namespace app::Clusters::DoorLock; switch (aPath.mAttributeId) diff --git a/src/controller/java/zap-generated/CHIPClientCallbacks.h b/src/controller/java/zap-generated/CHIPClientCallbacks.h index 4c0cabbb1152d4..b2ad57495245dd 100644 --- a/src/controller/java/zap-generated/CHIPClientCallbacks.h +++ b/src/controller/java/zap-generated/CHIPClientCallbacks.h @@ -735,6 +735,14 @@ typedef void (*DemandResponseLoadControlEventListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList<chip::EventId> & data); typedef void (*DemandResponseLoadControlAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList<chip::AttributeId> & data); +typedef void (*EnergyEvseGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & data); +typedef void (*EnergyEvseAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & data); +typedef void (*EnergyEvseEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList<chip::EventId> & data); +typedef void (*EnergyEvseAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList<chip::AttributeId> & data); typedef void (*DoorLockGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & data); typedef void (*DoorLockAcceptedCommandListListAttributeCallback)(void * context, diff --git a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp index 579273d56daea5..e55f6a63f9297c 100644 --- a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp @@ -3668,6 +3668,168 @@ JNI_METHOD(void, DemandResponseLoadControlCluster, writeDefaultRandomDurationAtt onFailure.release(); } +JNI_METHOD(void, EnergyEvseCluster, writeUserMaximumChargeCurrentAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::EnergyEvse::Attributes::UserMaximumChargeCurrent::TypeInfo; + TypeInfo::Type cppValue; + + std::vector<Platform::UniquePtr<JniByteArray>> cleanupByteArrays; + std::vector<Platform::UniquePtr<JniUtfString>> cleanupStrings; + + cppValue = static_cast<std::remove_reference_t<decltype(cppValue)>>(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr<CHIPDefaultSuccessCallback, void (*)(CHIPDefaultSuccessCallback *)> onSuccess( + Platform::New<CHIPDefaultSuccessCallback>(callback), Platform::Delete<CHIPDefaultSuccessCallback>); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr<CHIPDefaultFailureCallback, void (*)(CHIPDefaultFailureCallback *)> onFailure( + Platform::New<CHIPDefaultFailureCallback>(callback), Platform::Delete<CHIPDefaultFailureCallback>); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + EnergyEvseCluster * cppCluster = reinterpret_cast<EnergyEvseCluster *>(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback<CHIPDefaultWriteSuccessCallbackType>::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback<CHIPDefaultFailureCallbackType>::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute<TypeInfo>(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute<TypeInfo>(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, EnergyEvseCluster, writeRandomizationDelayWindowAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::EnergyEvse::Attributes::RandomizationDelayWindow::TypeInfo; + TypeInfo::Type cppValue; + + std::vector<Platform::UniquePtr<JniByteArray>> cleanupByteArrays; + std::vector<Platform::UniquePtr<JniUtfString>> cleanupStrings; + + cppValue = static_cast<std::remove_reference_t<decltype(cppValue)>>(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr<CHIPDefaultSuccessCallback, void (*)(CHIPDefaultSuccessCallback *)> onSuccess( + Platform::New<CHIPDefaultSuccessCallback>(callback), Platform::Delete<CHIPDefaultSuccessCallback>); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr<CHIPDefaultFailureCallback, void (*)(CHIPDefaultFailureCallback *)> onFailure( + Platform::New<CHIPDefaultFailureCallback>(callback), Platform::Delete<CHIPDefaultFailureCallback>); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + EnergyEvseCluster * cppCluster = reinterpret_cast<EnergyEvseCluster *>(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback<CHIPDefaultWriteSuccessCallbackType>::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback<CHIPDefaultFailureCallbackType>::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute<TypeInfo>(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute<TypeInfo>(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, EnergyEvseCluster, writeApproximateEVEfficiencyAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::EnergyEvse::Attributes::ApproximateEVEfficiency::TypeInfo; + TypeInfo::Type cppValue; + + std::vector<Platform::UniquePtr<JniByteArray>> cleanupByteArrays; + std::vector<Platform::UniquePtr<JniUtfString>> cleanupStrings; + + if (value == nullptr) + { + cppValue.SetNull(); + } + else + { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = static_cast<std::remove_reference_t<decltype(nonNullValue_0)>>( + chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + } + + std::unique_ptr<CHIPDefaultSuccessCallback, void (*)(CHIPDefaultSuccessCallback *)> onSuccess( + Platform::New<CHIPDefaultSuccessCallback>(callback), Platform::Delete<CHIPDefaultSuccessCallback>); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr<CHIPDefaultFailureCallback, void (*)(CHIPDefaultFailureCallback *)> onFailure( + Platform::New<CHIPDefaultFailureCallback>(callback), Platform::Delete<CHIPDefaultFailureCallback>); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + EnergyEvseCluster * cppCluster = reinterpret_cast<EnergyEvseCluster *>(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback<CHIPDefaultWriteSuccessCallbackType>::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback<CHIPDefaultFailureCallbackType>::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute<TypeInfo>(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute<TypeInfo>(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, DoorLockCluster, writeDoorOpenEventsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 75d224af705e7d..6c1f46be6badf9 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -4116,6 +4116,327 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::EnergyEvse::Id: { + using namespace app::Clusters::EnergyEvse; + switch (aPath.mEventId) + { + case Events::EVConnected::Id: { + Events::EVConnected::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_sessionID; + std::string value_sessionIDClassName = "java/lang/Long"; + std::string value_sessionIDCtorSignature = "(J)V"; + jlong jnivalue_sessionID = static_cast<jlong>(cppValue.sessionID); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>( + value_sessionIDClassName.c_str(), value_sessionIDCtorSignature.c_str(), jnivalue_sessionID, value_sessionID); + + jclass EVConnectedStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$EnergyEvseClusterEVConnectedEvent", EVConnectedStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$EnergyEvseClusterEVConnectedEvent"); + return nullptr; + } + jmethodID EVConnectedStructCtor = env->GetMethodID(EVConnectedStructClass, "<init>", "(Ljava/lang/Long;)V"); + if (EVConnectedStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$EnergyEvseClusterEVConnectedEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(EVConnectedStructClass, EVConnectedStructCtor, value_sessionID); + + return value; + } + case Events::EVNotDetected::Id: { + Events::EVNotDetected::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_sessionID; + std::string value_sessionIDClassName = "java/lang/Long"; + std::string value_sessionIDCtorSignature = "(J)V"; + jlong jnivalue_sessionID = static_cast<jlong>(cppValue.sessionID); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>( + value_sessionIDClassName.c_str(), value_sessionIDCtorSignature.c_str(), jnivalue_sessionID, value_sessionID); + + jobject value_state; + std::string value_stateClassName = "java/lang/Integer"; + std::string value_stateCtorSignature = "(I)V"; + jint jnivalue_state = static_cast<jint>(cppValue.state); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>( + value_stateClassName.c_str(), value_stateCtorSignature.c_str(), jnivalue_state, value_state); + + jobject value_sessionDuration; + std::string value_sessionDurationClassName = "java/lang/Long"; + std::string value_sessionDurationCtorSignature = "(J)V"; + jlong jnivalue_sessionDuration = static_cast<jlong>(cppValue.sessionDuration); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(value_sessionDurationClassName.c_str(), + value_sessionDurationCtorSignature.c_str(), + jnivalue_sessionDuration, value_sessionDuration); + + jobject value_sessionEnergyCharged; + std::string value_sessionEnergyChargedClassName = "java/lang/Long"; + std::string value_sessionEnergyChargedCtorSignature = "(J)V"; + jlong jnivalue_sessionEnergyCharged = static_cast<jlong>(cppValue.sessionEnergyCharged); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(value_sessionEnergyChargedClassName.c_str(), + value_sessionEnergyChargedCtorSignature.c_str(), + jnivalue_sessionEnergyCharged, value_sessionEnergyCharged); + + jobject value_sessionEnergyDischarged; + if (!cppValue.sessionEnergyDischarged.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_sessionEnergyDischarged); + } + else + { + jobject value_sessionEnergyDischargedInsideOptional; + std::string value_sessionEnergyDischargedInsideOptionalClassName = "java/lang/Long"; + std::string value_sessionEnergyDischargedInsideOptionalCtorSignature = "(J)V"; + jlong jnivalue_sessionEnergyDischargedInsideOptional = static_cast<jlong>(cppValue.sessionEnergyDischarged.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>( + value_sessionEnergyDischargedInsideOptionalClassName.c_str(), + value_sessionEnergyDischargedInsideOptionalCtorSignature.c_str(), + jnivalue_sessionEnergyDischargedInsideOptional, value_sessionEnergyDischargedInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_sessionEnergyDischargedInsideOptional, + value_sessionEnergyDischarged); + } + + jclass EVNotDetectedStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$EnergyEvseClusterEVNotDetectedEvent", EVNotDetectedStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$EnergyEvseClusterEVNotDetectedEvent"); + return nullptr; + } + jmethodID EVNotDetectedStructCtor = + env->GetMethodID(EVNotDetectedStructClass, "<init>", + "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;)V"); + if (EVNotDetectedStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$EnergyEvseClusterEVNotDetectedEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(EVNotDetectedStructClass, EVNotDetectedStructCtor, value_sessionID, value_state, + value_sessionDuration, value_sessionEnergyCharged, value_sessionEnergyDischarged); + + return value; + } + case Events::EnergyTransferStarted::Id: { + Events::EnergyTransferStarted::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_sessionID; + std::string value_sessionIDClassName = "java/lang/Long"; + std::string value_sessionIDCtorSignature = "(J)V"; + jlong jnivalue_sessionID = static_cast<jlong>(cppValue.sessionID); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>( + value_sessionIDClassName.c_str(), value_sessionIDCtorSignature.c_str(), jnivalue_sessionID, value_sessionID); + + jobject value_state; + std::string value_stateClassName = "java/lang/Integer"; + std::string value_stateCtorSignature = "(I)V"; + jint jnivalue_state = static_cast<jint>(cppValue.state); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>( + value_stateClassName.c_str(), value_stateCtorSignature.c_str(), jnivalue_state, value_state); + + jobject value_maximumCurrent; + std::string value_maximumCurrentClassName = "java/lang/Long"; + std::string value_maximumCurrentCtorSignature = "(J)V"; + jlong jnivalue_maximumCurrent = static_cast<jlong>(cppValue.maximumCurrent); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(value_maximumCurrentClassName.c_str(), + value_maximumCurrentCtorSignature.c_str(), + jnivalue_maximumCurrent, value_maximumCurrent); + + jclass energyTransferStartedStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$EnergyEvseClusterEnergyTransferStartedEvent", + energyTransferStartedStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$EnergyEvseClusterEnergyTransferStartedEvent"); + return nullptr; + } + jmethodID energyTransferStartedStructCtor = env->GetMethodID(energyTransferStartedStructClass, "<init>", + "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;)V"); + if (energyTransferStartedStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$EnergyEvseClusterEnergyTransferStartedEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(energyTransferStartedStructClass, energyTransferStartedStructCtor, value_sessionID, + value_state, value_maximumCurrent); + + return value; + } + case Events::EnergyTransferStopped::Id: { + Events::EnergyTransferStopped::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_sessionID; + std::string value_sessionIDClassName = "java/lang/Long"; + std::string value_sessionIDCtorSignature = "(J)V"; + jlong jnivalue_sessionID = static_cast<jlong>(cppValue.sessionID); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>( + value_sessionIDClassName.c_str(), value_sessionIDCtorSignature.c_str(), jnivalue_sessionID, value_sessionID); + + jobject value_state; + std::string value_stateClassName = "java/lang/Integer"; + std::string value_stateCtorSignature = "(I)V"; + jint jnivalue_state = static_cast<jint>(cppValue.state); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>( + value_stateClassName.c_str(), value_stateCtorSignature.c_str(), jnivalue_state, value_state); + + jobject value_reason; + std::string value_reasonClassName = "java/lang/Integer"; + std::string value_reasonCtorSignature = "(I)V"; + jint jnivalue_reason = static_cast<jint>(cppValue.reason); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>( + value_reasonClassName.c_str(), value_reasonCtorSignature.c_str(), jnivalue_reason, value_reason); + + jobject value_energyTransferred; + std::string value_energyTransferredClassName = "java/lang/Long"; + std::string value_energyTransferredCtorSignature = "(J)V"; + jlong jnivalue_energyTransferred = static_cast<jlong>(cppValue.energyTransferred); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(value_energyTransferredClassName.c_str(), + value_energyTransferredCtorSignature.c_str(), + jnivalue_energyTransferred, value_energyTransferred); + + jclass energyTransferStoppedStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$EnergyEvseClusterEnergyTransferStoppedEvent", + energyTransferStoppedStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$EnergyEvseClusterEnergyTransferStoppedEvent"); + return nullptr; + } + jmethodID energyTransferStoppedStructCtor = + env->GetMethodID(energyTransferStoppedStructClass, "<init>", + "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;)V"); + if (energyTransferStoppedStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$EnergyEvseClusterEnergyTransferStoppedEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(energyTransferStoppedStructClass, energyTransferStoppedStructCtor, value_sessionID, + value_state, value_reason, value_energyTransferred); + + return value; + } + case Events::Fault::Id: { + Events::Fault::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_sessionID; + std::string value_sessionIDClassName = "java/lang/Long"; + std::string value_sessionIDCtorSignature = "(J)V"; + jlong jnivalue_sessionID = static_cast<jlong>(cppValue.sessionID); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>( + value_sessionIDClassName.c_str(), value_sessionIDCtorSignature.c_str(), jnivalue_sessionID, value_sessionID); + + jobject value_state; + std::string value_stateClassName = "java/lang/Integer"; + std::string value_stateCtorSignature = "(I)V"; + jint jnivalue_state = static_cast<jint>(cppValue.state); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>( + value_stateClassName.c_str(), value_stateCtorSignature.c_str(), jnivalue_state, value_state); + + jobject value_faultStatePreviousState; + std::string value_faultStatePreviousStateClassName = "java/lang/Integer"; + std::string value_faultStatePreviousStateCtorSignature = "(I)V"; + jint jnivalue_faultStatePreviousState = static_cast<jint>(cppValue.faultStatePreviousState); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>( + value_faultStatePreviousStateClassName.c_str(), value_faultStatePreviousStateCtorSignature.c_str(), + jnivalue_faultStatePreviousState, value_faultStatePreviousState); + + jobject value_faultStateCurrentState; + std::string value_faultStateCurrentStateClassName = "java/lang/Integer"; + std::string value_faultStateCurrentStateCtorSignature = "(I)V"; + jint jnivalue_faultStateCurrentState = static_cast<jint>(cppValue.faultStateCurrentState); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>( + value_faultStateCurrentStateClassName.c_str(), value_faultStateCurrentStateCtorSignature.c_str(), + jnivalue_faultStateCurrentState, value_faultStateCurrentState); + + jclass faultStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$EnergyEvseClusterFaultEvent", faultStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$EnergyEvseClusterFaultEvent"); + return nullptr; + } + jmethodID faultStructCtor = env->GetMethodID( + faultStructClass, "<init>", "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); + if (faultStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$EnergyEvseClusterFaultEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(faultStructClass, faultStructCtor, value_sessionID, value_state, + value_faultStatePreviousState, value_faultStateCurrentState); + + return value; + } + case Events::Rfid::Id: { + Events::Rfid::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_uid; + jbyteArray value_uidByteArray = env->NewByteArray(static_cast<jsize>(cppValue.uid.size())); + env->SetByteArrayRegion(value_uidByteArray, 0, static_cast<jsize>(cppValue.uid.size()), + reinterpret_cast<const jbyte *>(cppValue.uid.data())); + value_uid = value_uidByteArray; + + jclass rfidStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$EnergyEvseClusterRfidEvent", rfidStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$EnergyEvseClusterRfidEvent"); + return nullptr; + } + jmethodID rfidStructCtor = env->GetMethodID(rfidStructClass, "<init>", "([B)V"); + if (rfidStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$EnergyEvseClusterRfidEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(rfidStructClass, rfidStructCtor, value_uid); + + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::DoorLock::Id: { using namespace app::Clusters::DoorLock; switch (aPath.mEventId) diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index 918f36641e0ea3..6355b7df097310 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -3778,6 +3778,137 @@ void CHIPRvcOperationalStateClusterOperationalCommandResponseCallback::CallbackF env->CallVoidMethod(javaCallbackRef, javaMethod, CommandResponseState); } +CHIPEnergyEvseClusterGetTargetsResponseCallback::CHIPEnergyEvseClusterGetTargetsResponseCallback(jobject javaCallback) : + Callback::Callback<CHIPEnergyEvseClusterGetTargetsResponseCallbackType>(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPEnergyEvseClusterGetTargetsResponseCallback::~CHIPEnergyEvseClusterGetTargetsResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPEnergyEvseClusterGetTargetsResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::EnergyEvse::Commands::GetTargetsResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr<CHIPEnergyEvseClusterGetTargetsResponseCallback, void (*)(CHIPEnergyEvseClusterGetTargetsResponseCallback *)> + cppCallback(reinterpret_cast<CHIPEnergyEvseClusterGetTargetsResponseCallback *>(context), + chip::Platform::Delete<CHIPEnergyEvseClusterGetTargetsResponseCallback>); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // 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); + 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<jint>(dataResponse.dayOfWeekforSequence.Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>(DayOfWeekforSequenceClassName.c_str(), + DayOfWeekforSequenceCtorSignature.c_str(), jniDayOfWeekforSequence, + DayOfWeekforSequence); + jobject ChargingTargets; + chip::JniReferences::GetInstance().CreateArrayList(ChargingTargets); + + auto iter_ChargingTargets_0 = dataResponse.chargingTargets.begin(); + while (iter_ChargingTargets_0.Next()) + { + auto & entry_0 = iter_ChargingTargets_0.GetValue(); + jobject newElement_0; + jobject newElement_0_targetTime; + std::string newElement_0_targetTimeClassName = "java/lang/Integer"; + std::string newElement_0_targetTimeCtorSignature = "(I)V"; + jint jninewElement_0_targetTime = static_cast<jint>(entry_0.targetTime); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>(newElement_0_targetTimeClassName.c_str(), + newElement_0_targetTimeCtorSignature.c_str(), + jninewElement_0_targetTime, newElement_0_targetTime); + jobject newElement_0_targetSoC; + if (!entry_0.targetSoC.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_targetSoC); + } + 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<jint>(entry_0.targetSoC.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>( + 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); + } + jobject newElement_0_addedEnergy; + if (!entry_0.addedEnergy.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_addedEnergy); + } + 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<jlong>(entry_0.addedEnergy.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(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); + } + + jclass chargingTargetStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$EnergyEvseClusterChargingTargetStruct", chargingTargetStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EnergyEvseClusterChargingTargetStruct"); + return; + } + jmethodID chargingTargetStructStructCtor_1 = env->GetMethodID( + chargingTargetStructStructClass_1, "<init>", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); + if (chargingTargetStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$EnergyEvseClusterChargingTargetStruct constructor"); + return; + } + + newElement_0 = env->NewObject(chargingTargetStructStructClass_1, chargingTargetStructStructCtor_1, newElement_0_targetTime, + newElement_0_targetSoC, newElement_0_addedEnergy); + chip::JniReferences::GetInstance().AddToList(ChargingTargets, newElement_0); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, DayOfWeekforSequence, ChargingTargets); +} CHIPDoorLockClusterGetWeekDayScheduleResponseCallback::CHIPDoorLockClusterGetWeekDayScheduleResponseCallback(jobject javaCallback) : Callback::Callback<CHIPDoorLockClusterGetWeekDayScheduleResponseCallbackType>(CallbackFn, this) { diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h index 10a51c524cda8b..a7c792a7e7b341 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h @@ -632,6 +632,21 @@ class CHIPRvcOperationalStateClusterOperationalCommandResponseCallback jobject javaCallbackRef; }; +class CHIPEnergyEvseClusterGetTargetsResponseCallback + : public Callback::Callback<CHIPEnergyEvseClusterGetTargetsResponseCallbackType> +{ +public: + CHIPEnergyEvseClusterGetTargetsResponseCallback(jobject javaCallback); + + ~CHIPEnergyEvseClusterGetTargetsResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::EnergyEvse::Commands::GetTargetsResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + class CHIPDoorLockClusterGetWeekDayScheduleResponseCallback : public Callback::Callback<CHIPDoorLockClusterGetWeekDayScheduleResponseCallbackType> { diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 40e108266c0fe9..9dce2e559f7dab 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -31762,6 +31762,1086 @@ void CHIPDemandResponseLoadControlAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPEnergyEvseStateAttributeCallback::CHIPEnergyEvseStateAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback<CHIPEnergyEvseClusterStateAttributeCallbackType>(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPEnergyEvseStateAttributeCallback::~CHIPEnergyEvseStateAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPEnergyEvseStateAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable<chip::app::Clusters::EnergyEvse::StateEnum> & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr<CHIPEnergyEvseStateAttributeCallback, decltype(&maybeDestroy)> cppCallback( + reinterpret_cast<CHIPEnergyEvseStateAttributeCallback *>(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + jint jnijavaValue = static_cast<jint>(value.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + jnijavaValue, javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPEnergyEvseChargingEnabledUntilAttributeCallback::CHIPEnergyEvseChargingEnabledUntilAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback<CHIPEnergyEvseClusterChargingEnabledUntilAttributeCallbackType>(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPEnergyEvseChargingEnabledUntilAttributeCallback::~CHIPEnergyEvseChargingEnabledUntilAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPEnergyEvseChargingEnabledUntilAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable<uint32_t> & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr<CHIPEnergyEvseChargingEnabledUntilAttributeCallback, decltype(&maybeDestroy)> cppCallback( + reinterpret_cast<CHIPEnergyEvseChargingEnabledUntilAttributeCallback *>(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + jlong jnijavaValue = static_cast<jlong>(value.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + jnijavaValue, javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPEnergyEvseDischargingEnabledUntilAttributeCallback::CHIPEnergyEvseDischargingEnabledUntilAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback<CHIPEnergyEvseClusterDischargingEnabledUntilAttributeCallbackType>(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPEnergyEvseDischargingEnabledUntilAttributeCallback::~CHIPEnergyEvseDischargingEnabledUntilAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPEnergyEvseDischargingEnabledUntilAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable<uint32_t> & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr<CHIPEnergyEvseDischargingEnabledUntilAttributeCallback, decltype(&maybeDestroy)> cppCallback( + reinterpret_cast<CHIPEnergyEvseDischargingEnabledUntilAttributeCallback *>(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + jlong jnijavaValue = static_cast<jlong>(value.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + jnijavaValue, javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPEnergyEvseNextChargeStartTimeAttributeCallback::CHIPEnergyEvseNextChargeStartTimeAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback<CHIPEnergyEvseClusterNextChargeStartTimeAttributeCallbackType>(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPEnergyEvseNextChargeStartTimeAttributeCallback::~CHIPEnergyEvseNextChargeStartTimeAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPEnergyEvseNextChargeStartTimeAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable<uint32_t> & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr<CHIPEnergyEvseNextChargeStartTimeAttributeCallback, decltype(&maybeDestroy)> cppCallback( + reinterpret_cast<CHIPEnergyEvseNextChargeStartTimeAttributeCallback *>(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + jlong jnijavaValue = static_cast<jlong>(value.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + jnijavaValue, javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPEnergyEvseNextChargeTargetTimeAttributeCallback::CHIPEnergyEvseNextChargeTargetTimeAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback<CHIPEnergyEvseClusterNextChargeTargetTimeAttributeCallbackType>(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPEnergyEvseNextChargeTargetTimeAttributeCallback::~CHIPEnergyEvseNextChargeTargetTimeAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPEnergyEvseNextChargeTargetTimeAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable<uint32_t> & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr<CHIPEnergyEvseNextChargeTargetTimeAttributeCallback, decltype(&maybeDestroy)> cppCallback( + reinterpret_cast<CHIPEnergyEvseNextChargeTargetTimeAttributeCallback *>(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + jlong jnijavaValue = static_cast<jlong>(value.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + jnijavaValue, javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPEnergyEvseNextChargeRequiredEnergyAttributeCallback::CHIPEnergyEvseNextChargeRequiredEnergyAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback<CHIPEnergyEvseClusterNextChargeRequiredEnergyAttributeCallbackType>(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPEnergyEvseNextChargeRequiredEnergyAttributeCallback::~CHIPEnergyEvseNextChargeRequiredEnergyAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPEnergyEvseNextChargeRequiredEnergyAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable<int64_t> & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr<CHIPEnergyEvseNextChargeRequiredEnergyAttributeCallback, decltype(&maybeDestroy)> cppCallback( + reinterpret_cast<CHIPEnergyEvseNextChargeRequiredEnergyAttributeCallback *>(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + jlong jnijavaValue = static_cast<jlong>(value.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + jnijavaValue, javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPEnergyEvseNextChargeTargetSoCAttributeCallback::CHIPEnergyEvseNextChargeTargetSoCAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback<CHIPEnergyEvseClusterNextChargeTargetSoCAttributeCallbackType>(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPEnergyEvseNextChargeTargetSoCAttributeCallback::~CHIPEnergyEvseNextChargeTargetSoCAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPEnergyEvseNextChargeTargetSoCAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable<chip::Percent> & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr<CHIPEnergyEvseNextChargeTargetSoCAttributeCallback, decltype(&maybeDestroy)> cppCallback( + reinterpret_cast<CHIPEnergyEvseNextChargeTargetSoCAttributeCallback *>(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + jint jnijavaValue = static_cast<jint>(value.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + jnijavaValue, javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPEnergyEvseApproximateEVEfficiencyAttributeCallback::CHIPEnergyEvseApproximateEVEfficiencyAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback<CHIPEnergyEvseClusterApproximateEVEfficiencyAttributeCallbackType>(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPEnergyEvseApproximateEVEfficiencyAttributeCallback::~CHIPEnergyEvseApproximateEVEfficiencyAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPEnergyEvseApproximateEVEfficiencyAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable<uint16_t> & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr<CHIPEnergyEvseApproximateEVEfficiencyAttributeCallback, decltype(&maybeDestroy)> cppCallback( + reinterpret_cast<CHIPEnergyEvseApproximateEVEfficiencyAttributeCallback *>(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + jint jnijavaValue = static_cast<jint>(value.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + jnijavaValue, javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPEnergyEvseStateOfChargeAttributeCallback::CHIPEnergyEvseStateOfChargeAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback<CHIPEnergyEvseClusterStateOfChargeAttributeCallbackType>(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPEnergyEvseStateOfChargeAttributeCallback::~CHIPEnergyEvseStateOfChargeAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPEnergyEvseStateOfChargeAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable<chip::Percent> & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr<CHIPEnergyEvseStateOfChargeAttributeCallback, decltype(&maybeDestroy)> cppCallback( + reinterpret_cast<CHIPEnergyEvseStateOfChargeAttributeCallback *>(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + jint jnijavaValue = static_cast<jint>(value.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jint>(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + jnijavaValue, javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPEnergyEvseBatteryCapacityAttributeCallback::CHIPEnergyEvseBatteryCapacityAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback<CHIPEnergyEvseClusterBatteryCapacityAttributeCallbackType>(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPEnergyEvseBatteryCapacityAttributeCallback::~CHIPEnergyEvseBatteryCapacityAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPEnergyEvseBatteryCapacityAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable<int64_t> & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr<CHIPEnergyEvseBatteryCapacityAttributeCallback, decltype(&maybeDestroy)> cppCallback( + reinterpret_cast<CHIPEnergyEvseBatteryCapacityAttributeCallback *>(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + jlong jnijavaValue = static_cast<jlong>(value.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + jnijavaValue, javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPEnergyEvseVehicleIDAttributeCallback::CHIPEnergyEvseVehicleIDAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback<CHIPEnergyEvseClusterVehicleIDAttributeCallbackType>(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPEnergyEvseVehicleIDAttributeCallback::~CHIPEnergyEvseVehicleIDAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPEnergyEvseVehicleIDAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable<chip::CharSpan> & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr<CHIPEnergyEvseVehicleIDAttributeCallback, decltype(&maybeDestroy)> cppCallback( + reinterpret_cast<CHIPEnergyEvseVehicleIDAttributeCallback *>(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/String;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(value.Value(), javaValue)); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPEnergyEvseSessionIDAttributeCallback::CHIPEnergyEvseSessionIDAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback<CHIPEnergyEvseClusterSessionIDAttributeCallbackType>(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPEnergyEvseSessionIDAttributeCallback::~CHIPEnergyEvseSessionIDAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPEnergyEvseSessionIDAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::Nullable<uint32_t> & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr<CHIPEnergyEvseSessionIDAttributeCallback, decltype(&maybeDestroy)> cppCallback( + reinterpret_cast<CHIPEnergyEvseSessionIDAttributeCallback *>(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + jlong jnijavaValue = static_cast<jlong>(value.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + jnijavaValue, javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPEnergyEvseGeneratedCommandListAttributeCallback::CHIPEnergyEvseGeneratedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback<CHIPEnergyEvseClusterGeneratedCommandListAttributeCallbackType>(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPEnergyEvseGeneratedCommandListAttributeCallback::~CHIPEnergyEvseGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPEnergyEvseGeneratedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr<CHIPEnergyEvseGeneratedCommandListAttributeCallback, decltype(&maybeDestroy)> cppCallback( + reinterpret_cast<CHIPEnergyEvseGeneratedCommandListAttributeCallback *>(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast<jlong>(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPEnergyEvseAcceptedCommandListAttributeCallback::CHIPEnergyEvseAcceptedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback<CHIPEnergyEvseClusterAcceptedCommandListAttributeCallbackType>(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPEnergyEvseAcceptedCommandListAttributeCallback::~CHIPEnergyEvseAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPEnergyEvseAcceptedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList<chip::CommandId> & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr<CHIPEnergyEvseAcceptedCommandListAttributeCallback, decltype(&maybeDestroy)> cppCallback( + reinterpret_cast<CHIPEnergyEvseAcceptedCommandListAttributeCallback *>(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast<jlong>(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPEnergyEvseEventListAttributeCallback::CHIPEnergyEvseEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback<CHIPEnergyEvseClusterEventListAttributeCallbackType>(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPEnergyEvseEventListAttributeCallback::~CHIPEnergyEvseEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPEnergyEvseEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList<chip::EventId> & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr<CHIPEnergyEvseEventListAttributeCallback, decltype(&maybeDestroy)> cppCallback( + reinterpret_cast<CHIPEnergyEvseEventListAttributeCallback *>(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast<jlong>(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPEnergyEvseAttributeListAttributeCallback::CHIPEnergyEvseAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback<CHIPEnergyEvseClusterAttributeListAttributeCallbackType>(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPEnergyEvseAttributeListAttributeCallback::~CHIPEnergyEvseAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPEnergyEvseAttributeListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList<chip::AttributeId> & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr<CHIPEnergyEvseAttributeListAttributeCallback, decltype(&maybeDestroy)> cppCallback( + reinterpret_cast<CHIPEnergyEvseAttributeListAttributeCallback *>(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast<jlong>(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject<jlong>( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + CHIPDoorLockLockStateAttributeCallback::CHIPDoorLockLockStateAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback<CHIPDoorLockClusterLockStateAttributeCallbackType>(CallbackFn, this), keepAlive(keepAlive) { diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index c515369590f17a..e073763fcc3250 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -6365,6 +6365,253 @@ class ChipClusters: }, }, } + _ENERGY_EVSE_CLUSTER_INFO = { + "clusterName": "EnergyEvse", + "clusterId": 0x00000099, + "commands": { + 0x00000001: { + "commandId": 0x00000001, + "commandName": "Disable", + "args": { + }, + }, + 0x00000002: { + "commandId": 0x00000002, + "commandName": "EnableCharging", + "args": { + "chargingEnabledUntil": "int", + "minimumChargeCurrent": "int", + "maximumChargeCurrent": "int", + }, + }, + 0x00000003: { + "commandId": 0x00000003, + "commandName": "EnableDischarging", + "args": { + "dischargingEnabledUntil": "int", + "maximumDischargeCurrent": "int", + }, + }, + 0x00000004: { + "commandId": 0x00000004, + "commandName": "StartDiagnostics", + "args": { + }, + }, + 0x00000005: { + "commandId": 0x00000005, + "commandName": "SetTargets", + "args": { + "dayOfWeekforSequence": "int", + "chargingTargets": "ChargingTargetStruct", + }, + }, + 0x00000006: { + "commandId": 0x00000006, + "commandName": "GetTargets", + "args": { + "daysToReturn": "int", + }, + }, + 0x00000007: { + "commandId": 0x00000007, + "commandName": "ClearTargets", + "args": { + }, + }, + }, + "attributes": { + 0x00000000: { + "attributeName": "State", + "attributeId": 0x00000000, + "type": "int", + "reportable": True, + }, + 0x00000001: { + "attributeName": "SupplyState", + "attributeId": 0x00000001, + "type": "int", + "reportable": True, + }, + 0x00000002: { + "attributeName": "FaultState", + "attributeId": 0x00000002, + "type": "int", + "reportable": True, + }, + 0x00000003: { + "attributeName": "ChargingEnabledUntil", + "attributeId": 0x00000003, + "type": "int", + "reportable": True, + }, + 0x00000004: { + "attributeName": "DischargingEnabledUntil", + "attributeId": 0x00000004, + "type": "int", + "reportable": True, + }, + 0x00000005: { + "attributeName": "CircuitCapacity", + "attributeId": 0x00000005, + "type": "int", + "reportable": True, + }, + 0x00000006: { + "attributeName": "MinimumChargeCurrent", + "attributeId": 0x00000006, + "type": "int", + "reportable": True, + }, + 0x00000007: { + "attributeName": "MaximumChargeCurrent", + "attributeId": 0x00000007, + "type": "int", + "reportable": True, + }, + 0x00000008: { + "attributeName": "MaximumDischargeCurrent", + "attributeId": 0x00000008, + "type": "int", + "reportable": True, + }, + 0x00000009: { + "attributeName": "UserMaximumChargeCurrent", + "attributeId": 0x00000009, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x0000000A: { + "attributeName": "RandomizationDelayWindow", + "attributeId": 0x0000000A, + "type": "int", + "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, + "type": "int", + "reportable": True, + }, + 0x00000024: { + "attributeName": "NextChargeTargetTime", + "attributeId": 0x00000024, + "type": "int", + "reportable": True, + }, + 0x00000025: { + "attributeName": "NextChargeRequiredEnergy", + "attributeId": 0x00000025, + "type": "int", + "reportable": True, + }, + 0x00000026: { + "attributeName": "NextChargeTargetSoC", + "attributeId": 0x00000026, + "type": "int", + "reportable": True, + }, + 0x00000027: { + "attributeName": "ApproximateEVEfficiency", + "attributeId": 0x00000027, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000030: { + "attributeName": "StateOfCharge", + "attributeId": 0x00000030, + "type": "int", + "reportable": True, + }, + 0x00000031: { + "attributeName": "BatteryCapacity", + "attributeId": 0x00000031, + "type": "int", + "reportable": True, + }, + 0x00000032: { + "attributeName": "VehicleID", + "attributeId": 0x00000032, + "type": "str", + "reportable": True, + }, + 0x00000040: { + "attributeName": "SessionID", + "attributeId": 0x00000040, + "type": "int", + "reportable": True, + }, + 0x00000041: { + "attributeName": "SessionDuration", + "attributeId": 0x00000041, + "type": "int", + "reportable": True, + }, + 0x00000042: { + "attributeName": "SessionEnergyCharged", + "attributeId": 0x00000042, + "type": "int", + "reportable": True, + }, + 0x00000043: { + "attributeName": "SessionEnergyDischarged", + "attributeId": 0x00000043, + "type": "int", + "reportable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } _DOOR_LOCK_CLUSTER_INFO = { "clusterName": "DoorLock", "clusterId": 0x00000101, @@ -12983,6 +13230,7 @@ class ChipClusters: 0x00000080: _BOOLEAN_SENSOR_CONFIGURATION_CLUSTER_INFO, 0x00000081: _VALVE_CONFIGURATION_AND_CONTROL_CLUSTER_INFO, 0x00000096: _DEMAND_RESPONSE_LOAD_CONTROL_CLUSTER_INFO, + 0x00000099: _ENERGY_EVSE_CLUSTER_INFO, 0x00000101: _DOOR_LOCK_CLUSTER_INFO, 0x00000102: _WINDOW_COVERING_CLUSTER_INFO, 0x00000103: _BARRIER_CONTROL_CLUSTER_INFO, @@ -13092,6 +13340,7 @@ class ChipClusters: "BooleanSensorConfiguration": _BOOLEAN_SENSOR_CONFIGURATION_CLUSTER_INFO, "ValveConfigurationAndControl": _VALVE_CONFIGURATION_AND_CONTROL_CLUSTER_INFO, "DemandResponseLoadControl": _DEMAND_RESPONSE_LOAD_CONTROL_CLUSTER_INFO, + "EnergyEvse": _ENERGY_EVSE_CLUSTER_INFO, "DoorLock": _DOOR_LOCK_CLUSTER_INFO, "WindowCovering": _WINDOW_COVERING_CLUSTER_INFO, "BarrierControl": _BARRIER_CONTROL_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 0fb0d524670e80..9260f5db92d5f5 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -22373,6 +22373,968 @@ def descriptor(cls) -> ClusterObjectDescriptor: heatingSourceControl: 'typing.Union[None, Nullable, DemandResponseLoadControl.Structs.HeatingSourceControlStruct]' = None +@dataclass +class EnergyEvse(Cluster): + id: typing.ClassVar[int] = 0x00000099 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="state", Tag=0x00000000, Type=typing.Union[Nullable, EnergyEvse.Enums.StateEnum]), + ClusterObjectFieldDescriptor(Label="supplyState", Tag=0x00000001, Type=EnergyEvse.Enums.SupplyStateEnum), + ClusterObjectFieldDescriptor(Label="faultState", Tag=0x00000002, Type=EnergyEvse.Enums.FaultStateEnum), + ClusterObjectFieldDescriptor(Label="chargingEnabledUntil", Tag=0x00000003, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="dischargingEnabledUntil", Tag=0x00000004, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="circuitCapacity", Tag=0x00000005, Type=int), + ClusterObjectFieldDescriptor(Label="minimumChargeCurrent", Tag=0x00000006, Type=int), + ClusterObjectFieldDescriptor(Label="maximumChargeCurrent", Tag=0x00000007, Type=int), + 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]), + ClusterObjectFieldDescriptor(Label="nextChargeTargetSoC", Tag=0x00000026, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="approximateEVEfficiency", Tag=0x00000027, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="stateOfCharge", Tag=0x00000030, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="batteryCapacity", Tag=0x00000031, Type=typing.Union[None, Nullable, int]), + ClusterObjectFieldDescriptor(Label="vehicleID", Tag=0x00000032, Type=typing.Union[None, Nullable, str]), + ClusterObjectFieldDescriptor(Label="sessionID", Tag=0x00000040, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="sessionDuration", Tag=0x00000041, Type=uint), + ClusterObjectFieldDescriptor(Label="sessionEnergyCharged", Tag=0x00000042, Type=int), + ClusterObjectFieldDescriptor(Label="sessionEnergyDischarged", Tag=0x00000043, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), + ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), + ]) + + state: 'typing.Union[Nullable, EnergyEvse.Enums.StateEnum]' = None + supplyState: 'EnergyEvse.Enums.SupplyStateEnum' = None + faultState: 'EnergyEvse.Enums.FaultStateEnum' = None + chargingEnabledUntil: 'typing.Union[Nullable, uint]' = None + dischargingEnabledUntil: 'typing.Union[None, Nullable, uint]' = None + circuitCapacity: 'int' = None + minimumChargeCurrent: 'int' = None + maximumChargeCurrent: 'int' = None + 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 + nextChargeTargetSoC: 'typing.Union[None, Nullable, uint]' = None + approximateEVEfficiency: 'typing.Union[None, Nullable, uint]' = None + stateOfCharge: 'typing.Union[None, Nullable, uint]' = None + batteryCapacity: 'typing.Union[None, Nullable, int]' = None + vehicleID: 'typing.Union[None, Nullable, str]' = None + sessionID: 'typing.Union[Nullable, uint]' = None + sessionDuration: 'uint' = None + sessionEnergyCharged: 'int' = None + sessionEnergyDischarged: 'typing.Optional[int]' = None + generatedCommandList: 'typing.List[uint]' = None + acceptedCommandList: 'typing.List[uint]' = None + eventList: 'typing.List[uint]' = None + attributeList: 'typing.List[uint]' = None + featureMap: 'uint' = None + clusterRevision: 'uint' = None + + class Enums: + class EnergyTransferStoppedReasonEnum(MatterIntEnum): + kEVStopped = 0x00 + kEVSEStopped = 0x01 + kOther = 0x02 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving and unknown + # enum value. This specific should never be transmitted. + kUnknownEnumValue = 3, + + class FaultStateEnum(MatterIntEnum): + kNoError = 0x00 + kMeterFailure = 0x01 + kOverVoltage = 0x02 + kUnderVoltage = 0x03 + kOverCurrent = 0x04 + kContactWetFailure = 0x05 + kContactDryFailure = 0x06 + kGroundFault = 0x07 + kPowerLoss = 0x08 + kPowerQuality = 0x09 + kPilotShortCircuit = 0x0A + kEmergencyStop = 0x0B + kEVDisconnected = 0x0C + kWrongPowerSupply = 0x0D + kLiveNeutralSwap = 0x0E + kOverTemperature = 0x0F + kOther = 0xFF + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving and unknown + # enum value. This specific should never be transmitted. + kUnknownEnumValue = 16, + + class StateEnum(MatterIntEnum): + kNotPluggedIn = 0x00 + kPluggedInNoDemand = 0x01 + kPluggedInDemand = 0x02 + kPluggedInCharging = 0x03 + kPluggedInDischarging = 0x04 + kSessionEnding = 0x05 + kFault = 0x06 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving and unknown + # enum value. This specific should never be transmitted. + kUnknownEnumValue = 7, + + class SupplyStateEnum(MatterIntEnum): + kDisabled = 0x00 + kChargingEnabled = 0x01 + kDischargingEnabled = 0x02 + kDisabledError = 0x03 + kDisabledDiagnostics = 0x04 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving and unknown + # enum value. This specific should never be transmitted. + kUnknownEnumValue = 5, + + class Bitmaps: + class Feature(IntFlag): + kChargingPreferences = 0x1 + kSoCReporting = 0x2 + kPlugAndCharge = 0x4 + kRfid = 0x8 + kV2x = 0x10 + + class TargetDayOfWeekBitmap(IntFlag): + kSunday = 0x1 + kMonday = 0x2 + kTuesday = 0x4 + kWednesday = 0x8 + kThursday = 0x10 + kFriday = 0x20 + kSaturday = 0x40 + + class Structs: + @dataclass + class ChargingTargetStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="targetTime", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="targetSoC", Tag=1, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="addedEnergy", Tag=2, Type=typing.Optional[int]), + ]) + + targetTime: 'uint' = 0 + targetSoC: 'typing.Optional[uint]' = None + addedEnergy: 'typing.Optional[int]' = None + + class Commands: + @dataclass + class GetTargetsResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000099 + command_id: typing.ClassVar[int] = 0x00000000 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + 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]), + ]) + + dayOfWeekforSequence: 'uint' = 0 + chargingTargets: 'typing.List[EnergyEvse.Structs.ChargingTargetStruct]' = field(default_factory=lambda: []) + + @dataclass + class Disable(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000099 + command_id: typing.ClassVar[int] = 0x00000001 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @ChipUtility.classproperty + def must_use_timed_invoke(cls) -> bool: + return True + + @dataclass + class EnableCharging(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000099 + command_id: typing.ClassVar[int] = 0x00000002 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="chargingEnabledUntil", Tag=0, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="minimumChargeCurrent", Tag=1, Type=int), + ClusterObjectFieldDescriptor(Label="maximumChargeCurrent", Tag=2, Type=int), + ]) + + @ChipUtility.classproperty + def must_use_timed_invoke(cls) -> bool: + return True + + chargingEnabledUntil: 'typing.Union[Nullable, uint]' = NullValue + minimumChargeCurrent: 'int' = 0 + maximumChargeCurrent: 'int' = 0 + + @dataclass + class EnableDischarging(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000099 + command_id: typing.ClassVar[int] = 0x00000003 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="dischargingEnabledUntil", Tag=0, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="maximumDischargeCurrent", Tag=1, Type=int), + ]) + + @ChipUtility.classproperty + def must_use_timed_invoke(cls) -> bool: + return True + + dischargingEnabledUntil: 'typing.Union[Nullable, uint]' = NullValue + maximumDischargeCurrent: 'int' = 0 + + @dataclass + class StartDiagnostics(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000099 + command_id: typing.ClassVar[int] = 0x00000004 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @ChipUtility.classproperty + def must_use_timed_invoke(cls) -> bool: + return True + + @dataclass + class SetTargets(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000099 + command_id: typing.ClassVar[int] = 0x00000005 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + 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]), + ]) + + @ChipUtility.classproperty + def must_use_timed_invoke(cls) -> bool: + return True + + dayOfWeekforSequence: 'uint' = 0 + chargingTargets: 'typing.List[EnergyEvse.Structs.ChargingTargetStruct]' = field(default_factory=lambda: []) + + @dataclass + class GetTargets(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000099 + command_id: typing.ClassVar[int] = 0x00000006 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'GetTargetsResponse' + + @ChipUtility.classproperty + 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 + command_id: typing.ClassVar[int] = 0x00000007 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @ChipUtility.classproperty + def must_use_timed_invoke(cls) -> bool: + return True + + class Attributes: + @dataclass + class State(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, EnergyEvse.Enums.StateEnum]) + + value: 'typing.Union[Nullable, EnergyEvse.Enums.StateEnum]' = NullValue + + @dataclass + class SupplyState(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=EnergyEvse.Enums.SupplyStateEnum) + + value: 'EnergyEvse.Enums.SupplyStateEnum' = 0 + + @dataclass + class FaultState(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=EnergyEvse.Enums.FaultStateEnum) + + value: 'EnergyEvse.Enums.FaultStateEnum' = 0 + + @dataclass + class ChargingEnabledUntil(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, uint]) + + value: 'typing.Union[Nullable, uint]' = NullValue + + @dataclass + class DischargingEnabledUntil(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000004 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) + + value: 'typing.Union[None, Nullable, uint]' = None + + @dataclass + class CircuitCapacity(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000005 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=int) + + value: 'int' = 0 + + @dataclass + class MinimumChargeCurrent(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000006 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=int) + + value: 'int' = 0 + + @dataclass + class MaximumChargeCurrent(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000007 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=int) + + value: 'int' = 0 + + @dataclass + class MaximumDischargeCurrent(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000008 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) + + value: 'typing.Optional[int]' = None + + @dataclass + class UserMaximumChargeCurrent(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000009 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) + + value: 'typing.Optional[int]' = None + + @dataclass + class RandomizationDelayWindow(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000000A + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class 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 + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000023 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) + + value: 'typing.Union[None, Nullable, uint]' = None + + @dataclass + class NextChargeTargetTime(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000024 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) + + value: 'typing.Union[None, Nullable, uint]' = None + + @dataclass + class NextChargeRequiredEnergy(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000025 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, int]) + + value: 'typing.Union[None, Nullable, int]' = None + + @dataclass + class NextChargeTargetSoC(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000026 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) + + value: 'typing.Union[None, Nullable, uint]' = None + + @dataclass + class ApproximateEVEfficiency(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000027 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) + + value: 'typing.Union[None, Nullable, uint]' = None + + @dataclass + class StateOfCharge(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000030 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) + + value: 'typing.Union[None, Nullable, uint]' = None + + @dataclass + class BatteryCapacity(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000031 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, int]) + + value: 'typing.Union[None, Nullable, int]' = None + + @dataclass + class VehicleID(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000032 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, str]) + + value: 'typing.Union[None, Nullable, str]' = None + + @dataclass + class SessionID(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000040 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, uint]) + + value: 'typing.Union[Nullable, uint]' = NullValue + + @dataclass + class SessionDuration(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000041 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class SessionEnergyCharged(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000042 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=int) + + value: 'int' = 0 + + @dataclass + class SessionEnergyDischarged(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000043 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) + + value: 'typing.Optional[int]' = None + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF8 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AcceptedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF9 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class EventList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFA + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AttributeList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFB + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class FeatureMap(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFC + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ClusterRevision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + class Events: + @dataclass + class EVConnected(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="sessionID", Tag=0, Type=uint), + ]) + + sessionID: 'uint' = 0 + + @dataclass + class EVNotDetected(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="sessionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="state", Tag=1, Type=EnergyEvse.Enums.StateEnum), + ClusterObjectFieldDescriptor(Label="sessionDuration", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="sessionEnergyCharged", Tag=3, Type=int), + ClusterObjectFieldDescriptor(Label="sessionEnergyDischarged", Tag=4, Type=typing.Optional[int]), + ]) + + sessionID: 'uint' = 0 + state: 'EnergyEvse.Enums.StateEnum' = 0 + sessionDuration: 'uint' = 0 + sessionEnergyCharged: 'int' = 0 + sessionEnergyDischarged: 'typing.Optional[int]' = None + + @dataclass + class EnergyTransferStarted(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="sessionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="state", Tag=1, Type=EnergyEvse.Enums.StateEnum), + ClusterObjectFieldDescriptor(Label="maximumCurrent", Tag=2, Type=int), + ]) + + sessionID: 'uint' = 0 + state: 'EnergyEvse.Enums.StateEnum' = 0 + maximumCurrent: 'int' = 0 + + @dataclass + class EnergyTransferStopped(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="sessionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="state", Tag=1, Type=EnergyEvse.Enums.StateEnum), + ClusterObjectFieldDescriptor(Label="reason", Tag=2, Type=EnergyEvse.Enums.EnergyTransferStoppedReasonEnum), + ClusterObjectFieldDescriptor(Label="energyTransferred", Tag=4, Type=int), + ]) + + sessionID: 'uint' = 0 + state: 'EnergyEvse.Enums.StateEnum' = 0 + reason: 'EnergyEvse.Enums.EnergyTransferStoppedReasonEnum' = 0 + energyTransferred: 'int' = 0 + + @dataclass + class Fault(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000004 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="sessionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="state", Tag=1, Type=EnergyEvse.Enums.StateEnum), + ClusterObjectFieldDescriptor(Label="faultStatePreviousState", Tag=2, Type=EnergyEvse.Enums.FaultStateEnum), + ClusterObjectFieldDescriptor(Label="faultStateCurrentState", Tag=4, Type=EnergyEvse.Enums.FaultStateEnum), + ]) + + sessionID: 'uint' = 0 + state: 'EnergyEvse.Enums.StateEnum' = 0 + faultStatePreviousState: 'EnergyEvse.Enums.FaultStateEnum' = 0 + faultStateCurrentState: 'EnergyEvse.Enums.FaultStateEnum' = 0 + + @dataclass + class Rfid(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000099 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000005 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="uid", Tag=0, Type=bytes), + ]) + + uid: 'bytes' = b"" + + @dataclass class DoorLock(Cluster): id: typing.ClassVar[int] = 0x00000101 diff --git a/src/controller/python/chip/clusters/__init__.py b/src/controller/python/chip/clusters/__init__.py index 0cbe22842924ca..6e846c68f5cb08 100644 --- a/src/controller/python/chip/clusters/__init__.py +++ b/src/controller/python/chip/clusters/__init__.py @@ -27,10 +27,10 @@ ApplicationBasic, ApplicationLauncher, AudioOutput, BallastConfiguration, BarrierControl, BasicInformation, BinaryInputBasic, Binding, BooleanState, BridgedDeviceBasicInformation, CarbonDioxideConcentrationMeasurement, CarbonMonoxideConcentrationMeasurement, Channel, ColorControl, ContentLauncher, Descriptor, DiagnosticLogs, - DishwasherAlarm, DishwasherMode, DoorLock, ElectricalMeasurement, EthernetNetworkDiagnostics, FanControl, - FaultInjection, FixedLabel, FlowMeasurement, FormaldehydeConcentrationMeasurement, GeneralCommissioning, - GeneralDiagnostics, GroupKeyManagement, Groups, HepaFilterMonitoring, IcdManagement, Identify, - IlluminanceMeasurement, KeypadInput, LaundryWasherControls, LaundryWasherMode, LevelControl, + DishwasherAlarm, DishwasherMode, DoorLock, ElectricalMeasurement, EnergyEvse, EthernetNetworkDiagnostics, + FanControl, FaultInjection, FixedLabel, FlowMeasurement, FormaldehydeConcentrationMeasurement, + GeneralCommissioning, GeneralDiagnostics, GroupKeyManagement, Groups, HepaFilterMonitoring, IcdManagement, + Identify, IlluminanceMeasurement, KeypadInput, LaundryWasherControls, LaundryWasherMode, LevelControl, LocalizationConfiguration, LowPower, MediaInput, MediaPlayback, ModeSelect, NetworkCommissioning, NitrogenDioxideConcentrationMeasurement, OccupancySensing, OnOff, OnOffSwitchConfiguration, OperationalCredentials, OperationalState, OtaSoftwareUpdateProvider, OtaSoftwareUpdateRequestor, @@ -49,7 +49,7 @@ BinaryInputBasic, Binding, BooleanState, BridgedDeviceBasicInformation, CarbonDioxideConcentrationMeasurement, CarbonMonoxideConcentrationMeasurement, Channel, ColorControl, ContentLauncher, Descriptor, DiagnosticLogs, DishwasherAlarm, DishwasherMode, - DoorLock, ElectricalMeasurement, EthernetNetworkDiagnostics, FanControl, FaultInjection, FixedLabel, FlowMeasurement, + DoorLock, ElectricalMeasurement, EnergyEvse, EthernetNetworkDiagnostics, FanControl, FaultInjection, FixedLabel, FlowMeasurement, FormaldehydeConcentrationMeasurement, GeneralCommissioning, GeneralDiagnostics, GroupKeyManagement, Groups, HepaFilterMonitoring, IcdManagement, Identify, IlluminanceMeasurement, KeypadInput, LaundryWasherControls, LaundryWasherMode, LevelControl, LocalizationConfiguration, LowPower, MediaInput, MediaPlayback, ModeSelect, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index e3218dec479a89..55633e6bacc956 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -2921,6 +2921,108 @@ static BOOL AttributeIsSpecifiedInDemandResponseLoadControlCluster(AttributeId a } } } +static BOOL AttributeIsSpecifiedInEnergyEVSECluster(AttributeId aAttributeId) +{ + using namespace Clusters::EnergyEvse; + switch (aAttributeId) { + case Attributes::State::Id: { + return YES; + } + case Attributes::SupplyState::Id: { + return YES; + } + case Attributes::FaultState::Id: { + return YES; + } + case Attributes::ChargingEnabledUntil::Id: { + return YES; + } + case Attributes::DischargingEnabledUntil::Id: { + return YES; + } + case Attributes::CircuitCapacity::Id: { + return YES; + } + case Attributes::MinimumChargeCurrent::Id: { + return YES; + } + case Attributes::MaximumChargeCurrent::Id: { + return YES; + } + case Attributes::MaximumDischargeCurrent::Id: { + return YES; + } + case Attributes::UserMaximumChargeCurrent::Id: { + return YES; + } + case Attributes::RandomizationDelayWindow::Id: { + return YES; + } + case Attributes::NumberOfWeeklyTargets::Id: { + return YES; + } + case Attributes::NumberOfDailyTargets::Id: { + return YES; + } + case Attributes::NextChargeStartTime::Id: { + return YES; + } + case Attributes::NextChargeTargetTime::Id: { + return YES; + } + case Attributes::NextChargeRequiredEnergy::Id: { + return YES; + } + case Attributes::NextChargeTargetSoC::Id: { + return YES; + } + case Attributes::ApproximateEVEfficiency::Id: { + return YES; + } + case Attributes::StateOfCharge::Id: { + return YES; + } + case Attributes::BatteryCapacity::Id: { + return YES; + } + case Attributes::VehicleID::Id: { + return YES; + } + case Attributes::SessionID::Id: { + return YES; + } + case Attributes::SessionDuration::Id: { + return YES; + } + case Attributes::SessionEnergyCharged::Id: { + return YES; + } + case Attributes::SessionEnergyDischarged::Id: { + return YES; + } + case Attributes::GeneratedCommandList::Id: { + return YES; + } + case Attributes::AcceptedCommandList::Id: { + return YES; + } + case Attributes::EventList::Id: { + return YES; + } + case Attributes::AttributeList::Id: { + return YES; + } + case Attributes::FeatureMap::Id: { + return YES; + } + case Attributes::ClusterRevision::Id: { + return YES; + } + default: { + return NO; + } + } +} static BOOL AttributeIsSpecifiedInDoorLockCluster(AttributeId aAttributeId) { using namespace Clusters::DoorLock; @@ -6021,6 +6123,9 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::DemandResponseLoadControl::Id: { return AttributeIsSpecifiedInDemandResponseLoadControlCluster(aAttributeId); } + case Clusters::EnergyEvse::Id: { + return AttributeIsSpecifiedInEnergyEVSECluster(aAttributeId); + } case Clusters::DoorLock::Id: { return AttributeIsSpecifiedInDoorLockCluster(aAttributeId); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 525a1de60544d6..1b70e7d8911d44 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -7805,6 +7805,346 @@ static id _Nullable DecodeAttributeValueForDemandResponseLoadControlCluster(Attr *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } +static id _Nullable DecodeAttributeValueForEnergyEVSECluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::EnergyEvse; + switch (aAttributeId) { + case Attributes::State::Id: { + using TypeInfo = Attributes::State::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; + } + return value; + } + case Attributes::SupplyState::Id: { + using TypeInfo = Attributes::SupplyState::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::FaultState::Id: { + using TypeInfo = Attributes::FaultState::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::ChargingEnabledUntil::Id: { + using TypeInfo = Attributes::ChargingEnabledUntil::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } + return value; + } + case Attributes::DischargingEnabledUntil::Id: { + using TypeInfo = Attributes::DischargingEnabledUntil::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } + return value; + } + case Attributes::CircuitCapacity::Id: { + using TypeInfo = Attributes::CircuitCapacity::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithLongLong:cppValue]; + return value; + } + case Attributes::MinimumChargeCurrent::Id: { + using TypeInfo = Attributes::MinimumChargeCurrent::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithLongLong:cppValue]; + return value; + } + case Attributes::MaximumChargeCurrent::Id: { + using TypeInfo = Attributes::MaximumChargeCurrent::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithLongLong:cppValue]; + return value; + } + case Attributes::MaximumDischargeCurrent::Id: { + using TypeInfo = Attributes::MaximumDischargeCurrent::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithLongLong:cppValue]; + return value; + } + case Attributes::UserMaximumChargeCurrent::Id: { + using TypeInfo = Attributes::UserMaximumChargeCurrent::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithLongLong:cppValue]; + return value; + } + case Attributes::RandomizationDelayWindow::Id: { + using TypeInfo = Attributes::RandomizationDelayWindow::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + case Attributes::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; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } + return value; + } + case Attributes::NextChargeTargetTime::Id: { + using TypeInfo = Attributes::NextChargeTargetTime::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } + return value; + } + case Attributes::NextChargeRequiredEnergy::Id: { + using TypeInfo = Attributes::NextChargeRequiredEnergy::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithLongLong:cppValue.Value()]; + } + return value; + } + case Attributes::NextChargeTargetSoC::Id: { + using TypeInfo = Attributes::NextChargeTargetSoC::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } + return value; + } + case Attributes::ApproximateEVEfficiency::Id: { + using TypeInfo = Attributes::ApproximateEVEfficiency::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } + return value; + } + case Attributes::StateOfCharge::Id: { + using TypeInfo = Attributes::StateOfCharge::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } + return value; + } + case Attributes::BatteryCapacity::Id: { + using TypeInfo = Attributes::BatteryCapacity::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithLongLong:cppValue.Value()]; + } + return value; + } + case Attributes::VehicleID::Id: { + using TypeInfo = Attributes::VehicleID::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = AsString(cppValue.Value()); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } + return value; + } + case Attributes::SessionID::Id: { + using TypeInfo = Attributes::SessionID::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } + return value; + } + case Attributes::SessionDuration::Id: { + using TypeInfo = Attributes::SessionDuration::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + case Attributes::SessionEnergyCharged::Id: { + using TypeInfo = Attributes::SessionEnergyCharged::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithLongLong:cppValue]; + return value; + } + case Attributes::SessionEnergyDischarged::Id: { + using TypeInfo = Attributes::SessionEnergyDischarged::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithLongLong:cppValue]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} static id _Nullable DecodeAttributeValueForDoorLockCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::DoorLock; @@ -16518,6 +16858,9 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::DemandResponseLoadControl::Id: { return DecodeAttributeValueForDemandResponseLoadControlCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::EnergyEvse::Id: { + return DecodeAttributeValueForEnergyEVSECluster(aPath.mAttributeId, aReader, aError); + } case Clusters::DoorLock::Id: { return DecodeAttributeValueForDoorLockCluster(aPath.mAttributeId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 286623f906a560..8e3c86f3fc313c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -7244,6 +7244,272 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster Energy EVSE + * + * 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. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRBaseClusterEnergyEVSE : MTRGenericBaseCluster + +/** + * Command Disable + * + * Allows a client to disable the EVSE from charging and discharging. + */ +- (void)disableWithParams:(MTREnergyEVSEClusterDisableParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)disableWithCompletion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; +/** + * Command EnableCharging + * + * Allows a client to enable the EVSE to charge an EV. + */ +- (void)enableChargingWithParams:(MTREnergyEVSEClusterEnableChargingParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command EnableDischarging + * + * Allows a client to enable the EVSE to discharge an EV. + */ +- (void)enableDischargingWithParams:(MTREnergyEVSEClusterEnableDischargingParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command StartDiagnostics + * + * Allows a client to put the EVSE into a self-diagnostics mode. + */ +- (void)startDiagnosticsWithParams:(MTREnergyEVSEClusterStartDiagnosticsParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)startDiagnosticsWithCompletion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; +/** + * Command SetTargets + * + * Allows a client to set the user specified charging targets. + */ +- (void)setTargetsWithParams:(MTREnergyEVSEClusterSetTargetsParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command GetTargets + * + * 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; +/** + * Command ClearTargets + * + * Allows a client to clear all stored charging targets. + */ +- (void)clearTargetsWithParams:(MTREnergyEVSEClusterClearTargetsParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)clearTargetsWithCompletion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeStateWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSupplyStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSupplyStateWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSupplyStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeFaultStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeFaultStateWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeFaultStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeChargingEnabledUntilWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeChargingEnabledUntilWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeChargingEnabledUntilWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeDischargingEnabledUntilWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeDischargingEnabledUntilWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeDischargingEnabledUntilWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeCircuitCapacityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeCircuitCapacityWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeCircuitCapacityWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMinimumChargeCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMinimumChargeCurrentWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMinimumChargeCurrentWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMaximumChargeCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMaximumChargeCurrentWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMaximumChargeCurrentWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMaximumDischargeCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMaximumDischargeCurrentWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMaximumDischargeCurrentWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeUserMaximumChargeCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeUserMaximumChargeCurrentWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeUserMaximumChargeCurrentWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeUserMaximumChargeCurrentWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeUserMaximumChargeCurrentWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeRandomizationDelayWindowWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeRandomizationDelayWindowWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeRandomizationDelayWindowWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeRandomizationDelayWindowWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + 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 + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeNextChargeStartTimeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeNextChargeTargetTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeNextChargeTargetTimeWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeNextChargeTargetTimeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeNextChargeRequiredEnergyWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeNextChargeRequiredEnergyWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeNextChargeRequiredEnergyWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeNextChargeTargetSoCWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeNextChargeTargetSoCWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeNextChargeTargetSoCWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeApproximateEVEfficiencyWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeApproximateEVEfficiencyWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeApproximateEVEfficiencyWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeApproximateEVEfficiencyWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeApproximateEVEfficiencyWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeStateOfChargeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeStateOfChargeWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeStateOfChargeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeBatteryCapacityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeBatteryCapacityWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeBatteryCapacityWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeVehicleIDWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeVehicleIDWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeVehicleIDWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSessionIDWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSessionIDWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSessionIDWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSessionDurationWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSessionDurationWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSessionDurationWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSessionEnergyChargedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSessionEnergyChargedWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSessionEnergyChargedWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSessionEnergyDischargedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSessionEnergyDischargedWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSessionEnergyDischargedWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRBaseClusterEnergyEVSE (Availability) + +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster Door Lock * @@ -15971,6 +16237,68 @@ typedef NS_OPTIONS(uint32_t, MTRDemandResponseLoadControlFeature) { MTRDemandResponseLoadControlFeatureHeatingSource MTR_PROVISIONALLY_AVAILABLE = 0x40, } MTR_PROVISIONALLY_AVAILABLE; +typedef NS_ENUM(uint8_t, MTREnergyEVSEEnergyTransferStoppedReason) { + MTREnergyEVSEEnergyTransferStoppedReasonEVStopped MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTREnergyEVSEEnergyTransferStoppedReasonEVSEStopped MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTREnergyEVSEEnergyTransferStoppedReasonOther MTR_PROVISIONALLY_AVAILABLE = 0x02, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTREnergyEVSEFaultState) { + MTREnergyEVSEFaultStateNoError MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTREnergyEVSEFaultStateMeterFailure MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTREnergyEVSEFaultStateOverVoltage MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTREnergyEVSEFaultStateUnderVoltage MTR_PROVISIONALLY_AVAILABLE = 0x03, + MTREnergyEVSEFaultStateOverCurrent MTR_PROVISIONALLY_AVAILABLE = 0x04, + MTREnergyEVSEFaultStateContactWetFailure MTR_PROVISIONALLY_AVAILABLE = 0x05, + MTREnergyEVSEFaultStateContactDryFailure MTR_PROVISIONALLY_AVAILABLE = 0x06, + MTREnergyEVSEFaultStateGroundFault MTR_PROVISIONALLY_AVAILABLE = 0x07, + MTREnergyEVSEFaultStatePowerLoss MTR_PROVISIONALLY_AVAILABLE = 0x08, + MTREnergyEVSEFaultStatePowerQuality MTR_PROVISIONALLY_AVAILABLE = 0x09, + MTREnergyEVSEFaultStatePilotShortCircuit MTR_PROVISIONALLY_AVAILABLE = 0x0A, + MTREnergyEVSEFaultStateEmergencyStop MTR_PROVISIONALLY_AVAILABLE = 0x0B, + MTREnergyEVSEFaultStateEVDisconnected MTR_PROVISIONALLY_AVAILABLE = 0x0C, + MTREnergyEVSEFaultStateWrongPowerSupply MTR_PROVISIONALLY_AVAILABLE = 0x0D, + MTREnergyEVSEFaultStateLiveNeutralSwap MTR_PROVISIONALLY_AVAILABLE = 0x0E, + MTREnergyEVSEFaultStateOverTemperature MTR_PROVISIONALLY_AVAILABLE = 0x0F, + MTREnergyEVSEFaultStateOther MTR_PROVISIONALLY_AVAILABLE = 0xFF, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTREnergyEVSEState) { + MTREnergyEVSEStateNotPluggedIn MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTREnergyEVSEStatePluggedInNoDemand MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTREnergyEVSEStatePluggedInDemand MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTREnergyEVSEStatePluggedInCharging MTR_PROVISIONALLY_AVAILABLE = 0x03, + MTREnergyEVSEStatePluggedInDischarging MTR_PROVISIONALLY_AVAILABLE = 0x04, + MTREnergyEVSEStateSessionEnding MTR_PROVISIONALLY_AVAILABLE = 0x05, + MTREnergyEVSEStateFault MTR_PROVISIONALLY_AVAILABLE = 0x06, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTREnergyEVSESupplyState) { + MTREnergyEVSESupplyStateDisabled MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTREnergyEVSESupplyStateChargingEnabled MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTREnergyEVSESupplyStateDischargingEnabled MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTREnergyEVSESupplyStateDisabledError MTR_PROVISIONALLY_AVAILABLE = 0x03, + MTREnergyEVSESupplyStateDisabledDiagnostics MTR_PROVISIONALLY_AVAILABLE = 0x04, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_OPTIONS(uint32_t, MTREnergyEVSEFeature) { + MTREnergyEVSEFeatureChargingPreferences MTR_PROVISIONALLY_AVAILABLE = 0x1, + MTREnergyEVSEFeatureSoCReporting MTR_PROVISIONALLY_AVAILABLE = 0x2, + MTREnergyEVSEFeaturePlugAndCharge MTR_PROVISIONALLY_AVAILABLE = 0x4, + MTREnergyEVSEFeatureRFID MTR_PROVISIONALLY_AVAILABLE = 0x8, + MTREnergyEVSEFeatureV2X MTR_PROVISIONALLY_AVAILABLE = 0x10, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_OPTIONS(uint8_t, MTREnergyEVSETargetDayOfWeekBitmap) { + MTREnergyEVSETargetDayOfWeekBitmapSunday MTR_PROVISIONALLY_AVAILABLE = 0x1, + MTREnergyEVSETargetDayOfWeekBitmapMonday MTR_PROVISIONALLY_AVAILABLE = 0x2, + MTREnergyEVSETargetDayOfWeekBitmapTuesday MTR_PROVISIONALLY_AVAILABLE = 0x4, + MTREnergyEVSETargetDayOfWeekBitmapWednesday MTR_PROVISIONALLY_AVAILABLE = 0x8, + MTREnergyEVSETargetDayOfWeekBitmapThursday MTR_PROVISIONALLY_AVAILABLE = 0x10, + MTREnergyEVSETargetDayOfWeekBitmapFriday MTR_PROVISIONALLY_AVAILABLE = 0x20, + MTREnergyEVSETargetDayOfWeekBitmapSaturday MTR_PROVISIONALLY_AVAILABLE = 0x40, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRDoorLockAlarmCode) { MTRDoorLockAlarmCodeLockJammed MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00, MTRDoorLockAlarmCodeLockFactoryReset MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x01, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 9d0ea6348d8ccb..c08c0435c6d7f5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -50418,6 +50418,1417 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end +@implementation MTRBaseClusterEnergyEVSE + +- (void)disableWithCompletion:(MTRStatusCompletion)completion +{ + [self disableWithParams:nil completion:completion]; +} +- (void)disableWithParams:(MTREnergyEVSEClusterDisableParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTREnergyEVSEClusterDisableParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(MTR_DEFAULT_TIMED_INTERACTION_TIMEOUT_MS); + } + + using RequestType = EnergyEvse::Commands::Disable::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)enableChargingWithParams:(MTREnergyEVSEClusterEnableChargingParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTREnergyEVSEClusterEnableChargingParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(MTR_DEFAULT_TIMED_INTERACTION_TIMEOUT_MS); + } + + using RequestType = EnergyEvse::Commands::EnableCharging::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)enableDischargingWithParams:(MTREnergyEVSEClusterEnableDischargingParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTREnergyEVSEClusterEnableDischargingParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(MTR_DEFAULT_TIMED_INTERACTION_TIMEOUT_MS); + } + + using RequestType = EnergyEvse::Commands::EnableDischarging::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)startDiagnosticsWithCompletion:(MTRStatusCompletion)completion +{ + [self startDiagnosticsWithParams:nil completion:completion]; +} +- (void)startDiagnosticsWithParams:(MTREnergyEVSEClusterStartDiagnosticsParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTREnergyEVSEClusterStartDiagnosticsParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(MTR_DEFAULT_TIMED_INTERACTION_TIMEOUT_MS); + } + + using RequestType = EnergyEvse::Commands::StartDiagnostics::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)setTargetsWithParams:(MTREnergyEVSEClusterSetTargetsParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTREnergyEVSEClusterSetTargetsParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(MTR_DEFAULT_TIMED_INTERACTION_TIMEOUT_MS); + } + + using RequestType = EnergyEvse::Commands::SetTargets::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)getTargetsWithParams:(MTREnergyEVSEClusterGetTargetsParams *)params completion:(void (^)(MTREnergyEVSEClusterGetTargetsResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTREnergyEVSEClusterGetTargetsParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(MTR_DEFAULT_TIMED_INTERACTION_TIMEOUT_MS); + } + + using RequestType = EnergyEvse::Commands::GetTargets::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTREnergyEVSEClusterGetTargetsResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)clearTargetsWithCompletion:(MTRStatusCompletion)completion +{ + [self clearTargetsWithParams:nil completion:completion]; +} +- (void)clearTargetsWithParams:(MTREnergyEVSEClusterClearTargetsParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTREnergyEVSEClusterClearTargetsParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(MTR_DEFAULT_TIMED_INTERACTION_TIMEOUT_MS); + } + + using RequestType = EnergyEvse::Commands::ClearTargets::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)readAttributeStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::State::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeStateWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::State::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::State::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSupplyStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::SupplyState::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeSupplyStateWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::SupplyState::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSupplyStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::SupplyState::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeFaultStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::FaultState::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeFaultStateWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::FaultState::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeFaultStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::FaultState::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeChargingEnabledUntilWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::ChargingEnabledUntil::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeChargingEnabledUntilWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::ChargingEnabledUntil::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeChargingEnabledUntilWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::ChargingEnabledUntil::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeDischargingEnabledUntilWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::DischargingEnabledUntil::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeDischargingEnabledUntilWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::DischargingEnabledUntil::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeDischargingEnabledUntilWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::DischargingEnabledUntil::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeCircuitCapacityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::CircuitCapacity::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeCircuitCapacityWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::CircuitCapacity::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeCircuitCapacityWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::CircuitCapacity::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMinimumChargeCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::MinimumChargeCurrent::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMinimumChargeCurrentWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::MinimumChargeCurrent::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMinimumChargeCurrentWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::MinimumChargeCurrent::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMaximumChargeCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::MaximumChargeCurrent::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMaximumChargeCurrentWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::MaximumChargeCurrent::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMaximumChargeCurrentWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::MaximumChargeCurrent::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMaximumDischargeCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::MaximumDischargeCurrent::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMaximumDischargeCurrentWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::MaximumDischargeCurrent::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMaximumDischargeCurrentWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::MaximumDischargeCurrent::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeUserMaximumChargeCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::UserMaximumChargeCurrent::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeUserMaximumChargeCurrentWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeUserMaximumChargeCurrentWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeUserMaximumChargeCurrentWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional<uint16_t> timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = EnergyEvse::Attributes::UserMaximumChargeCurrent::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.longLongValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpoint); + return cppCluster.WriteAttribute<TypeInfo>(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeUserMaximumChargeCurrentWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::UserMaximumChargeCurrent::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeUserMaximumChargeCurrentWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::UserMaximumChargeCurrent::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeRandomizationDelayWindowWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::RandomizationDelayWindow::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeRandomizationDelayWindowWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeRandomizationDelayWindowWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeRandomizationDelayWindowWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional<uint16_t> timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = EnergyEvse::Attributes::RandomizationDelayWindow::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpoint); + return cppCluster.WriteAttribute<TypeInfo>(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeRandomizationDelayWindowWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::RandomizationDelayWindow::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeRandomizationDelayWindowWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::RandomizationDelayWindow::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + 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<chip::EndpointId>([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<chip::EndpointId>([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; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeNextChargeStartTimeWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::NextChargeStartTime::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeNextChargeStartTimeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::NextChargeStartTime::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeNextChargeTargetTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::NextChargeTargetTime::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeNextChargeTargetTimeWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::NextChargeTargetTime::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeNextChargeTargetTimeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::NextChargeTargetTime::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeNextChargeRequiredEnergyWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::NextChargeRequiredEnergy::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeNextChargeRequiredEnergyWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::NextChargeRequiredEnergy::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeNextChargeRequiredEnergyWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::NextChargeRequiredEnergy::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeNextChargeTargetSoCWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::NextChargeTargetSoC::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeNextChargeTargetSoCWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::NextChargeTargetSoC::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeNextChargeTargetSoCWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::NextChargeTargetSoC::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeApproximateEVEfficiencyWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::ApproximateEVEfficiency::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeApproximateEVEfficiencyWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeApproximateEVEfficiencyWithValue:(NSNumber * _Nullable) value params:nil completion:completion]; +} +- (void)writeAttributeApproximateEVEfficiencyWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional<uint16_t> timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = EnergyEvse::Attributes::ApproximateEVEfficiency::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedShortValue; + } + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpoint); + return cppCluster.WriteAttribute<TypeInfo>(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeApproximateEVEfficiencyWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::ApproximateEVEfficiency::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeApproximateEVEfficiencyWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::ApproximateEVEfficiency::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeStateOfChargeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::StateOfCharge::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeStateOfChargeWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::StateOfCharge::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeStateOfChargeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::StateOfCharge::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeBatteryCapacityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::BatteryCapacity::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeBatteryCapacityWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::BatteryCapacity::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeBatteryCapacityWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::BatteryCapacity::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeVehicleIDWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::VehicleID::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeVehicleIDWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::VehicleID::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeVehicleIDWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::VehicleID::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSessionIDWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::SessionID::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeSessionIDWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::SessionID::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSessionIDWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::SessionID::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSessionDurationWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::SessionDuration::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeSessionDurationWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::SessionDuration::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSessionDurationWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::SessionDuration::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSessionEnergyChargedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::SessionEnergyCharged::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeSessionEnergyChargedWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::SessionEnergyCharged::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSessionEnergyChargedWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::SessionEnergyCharged::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSessionEnergyDischargedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::SessionEnergyDischarged::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeSessionEnergyDischargedWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::SessionEnergyDischarged::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSessionEnergyDischargedWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::SessionEnergyDischarged::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::GeneratedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::GeneratedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::GeneratedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::AcceptedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::AcceptedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::AcceptedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::EventList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::EventList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::EventList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::AttributeList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::AttributeList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::AttributeList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::FeatureMap::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::FeatureMap::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::FeatureMap::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::ClusterRevision::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = EnergyEvse::Attributes::ClusterRevision::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = EnergyEvse::Attributes::ClusterRevision::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +@end + @implementation MTRBaseClusterDoorLock - (void)lockDoorWithParams:(MTRDoorLockClusterLockDoorParams * _Nullable)params completion:(MTRStatusCompletion)completion diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 1c84c35a6db617..b36fa4948b372f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -150,6 +150,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeBooleanSensorConfigurationID MTR_PROVISIONALLY_AVAILABLE = 0x00000080, MTRClusterIDTypeValveConfigurationAndControlID MTR_PROVISIONALLY_AVAILABLE = 0x00000081, MTRClusterIDTypeDemandResponseLoadControlID MTR_PROVISIONALLY_AVAILABLE = 0x00000096, + MTRClusterIDTypeEnergyEVSEID MTR_PROVISIONALLY_AVAILABLE = 0x00000099, MTRClusterIDTypeDoorLockID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000101, MTRClusterIDTypeWindowCoveringID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000102, MTRClusterIDTypeBarrierControlID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000103, @@ -2602,6 +2603,39 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterDemandResponseLoadControlAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, MTRAttributeIDTypeClusterDemandResponseLoadControlAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster EnergyEVSE attributes + MTRAttributeIDTypeClusterEnergyEVSEAttributeStateID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterEnergyEVSEAttributeSupplyStateID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterEnergyEVSEAttributeFaultStateID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterEnergyEVSEAttributeChargingEnabledUntilID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRAttributeIDTypeClusterEnergyEVSEAttributeDischargingEnabledUntilID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + MTRAttributeIDTypeClusterEnergyEVSEAttributeCircuitCapacityID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, + MTRAttributeIDTypeClusterEnergyEVSEAttributeMinimumChargeCurrentID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, + MTRAttributeIDTypeClusterEnergyEVSEAttributeMaximumChargeCurrentID MTR_PROVISIONALLY_AVAILABLE = 0x00000007, + 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, + MTRAttributeIDTypeClusterEnergyEVSEAttributeNextChargeTargetSoCID MTR_PROVISIONALLY_AVAILABLE = 0x00000026, + MTRAttributeIDTypeClusterEnergyEVSEAttributeApproximateEVEfficiencyID MTR_PROVISIONALLY_AVAILABLE = 0x00000027, + MTRAttributeIDTypeClusterEnergyEVSEAttributeStateOfChargeID MTR_PROVISIONALLY_AVAILABLE = 0x00000030, + MTRAttributeIDTypeClusterEnergyEVSEAttributeBatteryCapacityID MTR_PROVISIONALLY_AVAILABLE = 0x00000031, + MTRAttributeIDTypeClusterEnergyEVSEAttributeVehicleIDID MTR_PROVISIONALLY_AVAILABLE = 0x00000032, + MTRAttributeIDTypeClusterEnergyEVSEAttributeSessionIDID MTR_PROVISIONALLY_AVAILABLE = 0x00000040, + MTRAttributeIDTypeClusterEnergyEVSEAttributeSessionDurationID MTR_PROVISIONALLY_AVAILABLE = 0x00000041, + MTRAttributeIDTypeClusterEnergyEVSEAttributeSessionEnergyChargedID MTR_PROVISIONALLY_AVAILABLE = 0x00000042, + MTRAttributeIDTypeClusterEnergyEVSEAttributeSessionEnergyDischargedID MTR_PROVISIONALLY_AVAILABLE = 0x00000043, + MTRAttributeIDTypeClusterEnergyEVSEAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterEnergyEVSEAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterEnergyEVSEAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, + MTRAttributeIDTypeClusterEnergyEVSEAttributeAttributeListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterEnergyEVSEAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterEnergyEVSEAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster DoorLock deprecated attribute names MTRClusterDoorLockAttributeLockStateID MTR_DEPRECATED("Please use MTRAttributeIDTypeClusterDoorLockAttributeLockStateID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) @@ -6145,6 +6179,16 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterDemandResponseLoadControlCommandRemoveLoadControlEventRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, MTRCommandIDTypeClusterDemandResponseLoadControlCommandClearLoadControlEventsRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + // Cluster EnergyEVSE commands + MTRCommandIDTypeClusterEnergyEVSECommandGetTargetsResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRCommandIDTypeClusterEnergyEVSECommandDisableID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRCommandIDTypeClusterEnergyEVSECommandEnableChargingID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRCommandIDTypeClusterEnergyEVSECommandEnableDischargingID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRCommandIDTypeClusterEnergyEVSECommandStartDiagnosticsID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + MTRCommandIDTypeClusterEnergyEVSECommandSetTargetsID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, + MTRCommandIDTypeClusterEnergyEVSECommandGetTargetsID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, + MTRCommandIDTypeClusterEnergyEVSECommandClearTargetsID MTR_PROVISIONALLY_AVAILABLE = 0x00000007, + // Cluster DoorLock deprecated command id names MTRClusterDoorLockCommandLockDoorID MTR_DEPRECATED("Please use MTRCommandIDTypeClusterDoorLockCommandLockDoorID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) @@ -6992,6 +7036,14 @@ typedef NS_ENUM(uint32_t, MTREventIDType) { // Cluster DemandResponseLoadControl events MTREventIDTypeClusterDemandResponseLoadControlEventLoadControlEventStatusChangeID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + // Cluster EnergyEVSE events + MTREventIDTypeClusterEnergyEVSEEventEVConnectedID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTREventIDTypeClusterEnergyEVSEEventEVNotDetectedID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTREventIDTypeClusterEnergyEVSEEventEnergyTransferStartedID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTREventIDTypeClusterEnergyEVSEEventEnergyTransferStoppedID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTREventIDTypeClusterEnergyEVSEEventFaultID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + MTREventIDTypeClusterEnergyEVSEEventRFIDID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, + // Cluster DoorLock deprecated event names MTRClusterDoorLockEventDoorLockAlarmID MTR_DEPRECATED("Please use MTREventIDTypeClusterDoorLockEventDoorLockAlarmID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index fa14a4326e7262..f70800db5bc5e9 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -3431,6 +3431,112 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster Energy EVSE + * 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. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRClusterEnergyEVSE : MTRGenericCluster + +- (void)disableWithParams:(MTREnergyEVSEClusterDisableParams * _Nullable)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)disableWithExpectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; +- (void)enableChargingWithParams:(MTREnergyEVSEClusterEnableChargingParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)enableDischargingWithParams:(MTREnergyEVSEClusterEnableDischargingParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)startDiagnosticsWithParams:(MTREnergyEVSEClusterStartDiagnosticsParams * _Nullable)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)startDiagnosticsWithExpectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; +- (void)setTargetsWithParams:(MTREnergyEVSEClusterSetTargetsParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)getTargetsWithParams:(MTREnergyEVSEClusterGetTargetsParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTREnergyEVSEClusterGetTargetsResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)clearTargetsWithParams:(MTREnergyEVSEClusterClearTargetsParams * _Nullable)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)clearTargetsWithExpectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeStateWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeSupplyStateWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeFaultStateWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeChargingEnabledUntilWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeDischargingEnabledUntilWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeCircuitCapacityWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeMinimumChargeCurrentWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeMaximumChargeCurrentWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeMaximumDischargeCurrentWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeUserMaximumChargeCurrentWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeUserMaximumChargeCurrentWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeUserMaximumChargeCurrentWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeRandomizationDelayWindowWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeRandomizationDelayWindowWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeRandomizationDelayWindowWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeNumberOfWeeklyTargetsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeNumberOfDailyTargetsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeNextChargeStartTimeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeNextChargeTargetTimeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeNextChargeRequiredEnergyWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeNextChargeTargetSoCWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeApproximateEVEfficiencyWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeApproximateEVEfficiencyWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeApproximateEVEfficiencyWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeStateOfChargeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeBatteryCapacityWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeVehicleIDWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeSessionIDWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeSessionDurationWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeSessionEnergyChargedWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeSessionEnergyDischargedWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRClusterEnergyEVSE (Availability) + +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster Door Lock * An interface to a generic way to secure a door diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 4d9af8e770ad79..e750c27b95103a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -9300,6 +9300,420 @@ - (void)writeAttributeDefaultRandomDurationWithValue:(NSDictionary<NSString *, i @end +@implementation MTRClusterEnergyEVSE + +- (void)disableWithExpectedValues:(NSArray<NSDictionary<NSString *, id> *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + [self disableWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)disableWithParams:(MTREnergyEVSEClusterDisableParams * _Nullable)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTREnergyEVSEClusterDisableParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(MTR_DEFAULT_TIMED_INTERACTION_TIMEOUT_MS); + } + + using RequestType = EnergyEvse::Commands::Disable::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)enableChargingWithParams:(MTREnergyEVSEClusterEnableChargingParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTREnergyEVSEClusterEnableChargingParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(MTR_DEFAULT_TIMED_INTERACTION_TIMEOUT_MS); + } + + using RequestType = EnergyEvse::Commands::EnableCharging::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)enableDischargingWithParams:(MTREnergyEVSEClusterEnableDischargingParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTREnergyEVSEClusterEnableDischargingParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(MTR_DEFAULT_TIMED_INTERACTION_TIMEOUT_MS); + } + + using RequestType = EnergyEvse::Commands::EnableDischarging::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)startDiagnosticsWithExpectedValues:(NSArray<NSDictionary<NSString *, id> *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + [self startDiagnosticsWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)startDiagnosticsWithParams:(MTREnergyEVSEClusterStartDiagnosticsParams * _Nullable)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTREnergyEVSEClusterStartDiagnosticsParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(MTR_DEFAULT_TIMED_INTERACTION_TIMEOUT_MS); + } + + using RequestType = EnergyEvse::Commands::StartDiagnostics::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)setTargetsWithParams:(MTREnergyEVSEClusterSetTargetsParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTREnergyEVSEClusterSetTargetsParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(MTR_DEFAULT_TIMED_INTERACTION_TIMEOUT_MS); + } + + using RequestType = EnergyEvse::Commands::SetTargets::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)getTargetsWithParams:(MTREnergyEVSEClusterGetTargetsParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTREnergyEVSEClusterGetTargetsResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTREnergyEVSEClusterGetTargetsParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(MTR_DEFAULT_TIMED_INTERACTION_TIMEOUT_MS); + } + + using RequestType = EnergyEvse::Commands::GetTargets::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTREnergyEVSEClusterGetTargetsResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)clearTargetsWithExpectedValues:(NSArray<NSDictionary<NSString *, id> *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + [self clearTargetsWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)clearTargetsWithParams:(MTREnergyEVSEClusterClearTargetsParams * _Nullable)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTREnergyEVSEClusterClearTargetsParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMs == nil) { + timedInvokeTimeoutMs = @(MTR_DEFAULT_TIMED_INTERACTION_TIMEOUT_MS); + } + + using RequestType = EnergyEvse::Commands::ClearTargets::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeStateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeStateID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeSupplyStateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeSupplyStateID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeFaultStateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeFaultStateID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeChargingEnabledUntilWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeChargingEnabledUntilID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeDischargingEnabledUntilWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeDischargingEnabledUntilID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeCircuitCapacityWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeCircuitCapacityID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeMinimumChargeCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeMinimumChargeCurrentID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeMaximumChargeCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeMaximumChargeCurrentID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeMaximumDischargeCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeMaximumDischargeCurrentID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeUserMaximumChargeCurrentWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeUserMaximumChargeCurrentID) params:params]; +} + +- (void)writeAttributeUserMaximumChargeCurrentWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeUserMaximumChargeCurrentWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeUserMaximumChargeCurrentWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeUserMaximumChargeCurrentID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeRandomizationDelayWindowWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeRandomizationDelayWindowID) params:params]; +} + +- (void)writeAttributeRandomizationDelayWindowWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeRandomizationDelayWindowWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeRandomizationDelayWindowWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeRandomizationDelayWindowID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeNumberOfWeeklyTargetsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeNumberOfWeeklyTargetsID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeNumberOfDailyTargetsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeNumberOfDailyTargetsID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeNextChargeStartTimeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeNextChargeStartTimeID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeNextChargeTargetTimeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeNextChargeTargetTimeID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeNextChargeRequiredEnergyWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeNextChargeRequiredEnergyID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeNextChargeTargetSoCWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeNextChargeTargetSoCID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeApproximateEVEfficiencyWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeApproximateEVEfficiencyID) params:params]; +} + +- (void)writeAttributeApproximateEVEfficiencyWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeApproximateEVEfficiencyWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeApproximateEVEfficiencyWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeApproximateEVEfficiencyID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeStateOfChargeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeStateOfChargeID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeBatteryCapacityWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeBatteryCapacityID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeVehicleIDWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeVehicleIDID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeSessionIDWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeSessionIDID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeSessionDurationWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeSessionDurationID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeSessionEnergyChargedWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeSessionEnergyChargedID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeSessionEnergyDischargedWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeSessionEnergyDischargedID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeGeneratedCommandListID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeAcceptedCommandListID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeEventListID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeAttributeListID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeFeatureMapID) params:params]; +} + +- (NSDictionary<NSString *, id> * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeEnergyEVSEID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEAttributeClusterRevisionID) params:params]; +} + +@end + @implementation MTRClusterDoorLock - (void)lockDoorWithParams:(MTRDoorLockClusterLockDoorParams * _Nullable)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 6acf413ead81d6..aa5388551b3b18 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -5734,6 +5734,239 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTREnergyEVSEClusterGetTargetsResponseParams : NSObject <NSCopying> + +@property (nonatomic, copy) NSNumber * _Nonnull dayOfWeekforSequence MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSArray * _Nonnull chargingTargets MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTREnergyEVSEClusterGetTargetsResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary<NSString *, id> *)responseValue + error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTREnergyEVSEClusterDisableParams : NSObject <NSCopying> +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTREnergyEVSEClusterEnableChargingParams : NSObject <NSCopying> + +@property (nonatomic, copy) NSNumber * _Nullable chargingEnabledUntil MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull minimumChargeCurrent MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull maximumChargeCurrent MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTREnergyEVSEClusterEnableDischargingParams : NSObject <NSCopying> + +@property (nonatomic, copy) NSNumber * _Nullable dischargingEnabledUntil MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull maximumDischargeCurrent MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTREnergyEVSEClusterStartDiagnosticsParams : NSObject <NSCopying> +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTREnergyEVSEClusterSetTargetsParams : NSObject <NSCopying> + +@property (nonatomic, copy) NSNumber * _Nonnull dayOfWeekforSequence MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSArray * _Nonnull chargingTargets MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTREnergyEVSEClusterGetTargetsParams : NSObject <NSCopying> + +@property (nonatomic, copy) NSNumber * _Nonnull daysToReturn MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTREnergyEVSEClusterClearTargetsParams : NSObject <NSCopying> +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRDoorLockClusterLockDoorParams : NSObject <NSCopying> diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 77b3a652762a38..8f3a9e13a03302 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -15825,6 +15825,714 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end +@implementation MTREnergyEVSEClusterGetTargetsResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _dayOfWeekforSequence = @(0); + + _chargingTargets = [NSArray array]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTREnergyEVSEClusterGetTargetsResponseParams 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; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary<NSString *, id> *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::EnergyEvse::Commands::GetTargetsResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@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(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTREnergyEVSEClusterChargingTargetStruct * newElement_0; + newElement_0 = [MTREnergyEVSEClusterChargingTargetStruct new]; + newElement_0.targetTime = [NSNumber numberWithUnsignedShort:entry_0.targetTime]; + if (entry_0.targetSoC.HasValue()) { + newElement_0.targetSoC = [NSNumber numberWithUnsignedChar:entry_0.targetSoC.Value()]; + } else { + newElement_0.targetSoC = nil; + } + if (entry_0.addedEnergy.HasValue()) { + newElement_0.addedEnergy = [NSNumber numberWithLongLong:entry_0.addedEnergy.Value()]; + } else { + newElement_0.addedEnergy = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.chargingTargets = array_0; + } + } + return CHIP_NO_ERROR; +} + +@end + +@implementation MTREnergyEVSEClusterDisableParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTREnergyEVSEClusterDisableParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end + +@implementation MTREnergyEVSEClusterDisableParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::EnergyEvse::Commands::Disable::Type encodableStruct; + ListFreer listFreer; + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTREnergyEVSEClusterEnableChargingParams +- (instancetype)init +{ + if (self = [super init]) { + + _chargingEnabledUntil = nil; + + _minimumChargeCurrent = @(0); + + _maximumChargeCurrent = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTREnergyEVSEClusterEnableChargingParams alloc] init]; + + other.chargingEnabledUntil = self.chargingEnabledUntil; + other.minimumChargeCurrent = self.minimumChargeCurrent; + other.maximumChargeCurrent = self.maximumChargeCurrent; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: chargingEnabledUntil:%@; minimumChargeCurrent:%@; maximumChargeCurrent:%@; >", NSStringFromClass([self class]), _chargingEnabledUntil, _minimumChargeCurrent, _maximumChargeCurrent]; + return descriptionString; +} + +@end + +@implementation MTREnergyEVSEClusterEnableChargingParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::EnergyEvse::Commands::EnableCharging::Type encodableStruct; + ListFreer listFreer; + { + if (self.chargingEnabledUntil == nil) { + encodableStruct.chargingEnabledUntil.SetNull(); + } else { + auto & nonNullValue_0 = encodableStruct.chargingEnabledUntil.SetNonNull(); + nonNullValue_0 = self.chargingEnabledUntil.unsignedIntValue; + } + } + { + encodableStruct.minimumChargeCurrent = self.minimumChargeCurrent.longLongValue; + } + { + encodableStruct.maximumChargeCurrent = self.maximumChargeCurrent.longLongValue; + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTREnergyEVSEClusterEnableDischargingParams +- (instancetype)init +{ + if (self = [super init]) { + + _dischargingEnabledUntil = nil; + + _maximumDischargeCurrent = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTREnergyEVSEClusterEnableDischargingParams alloc] init]; + + other.dischargingEnabledUntil = self.dischargingEnabledUntil; + other.maximumDischargeCurrent = self.maximumDischargeCurrent; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: dischargingEnabledUntil:%@; maximumDischargeCurrent:%@; >", NSStringFromClass([self class]), _dischargingEnabledUntil, _maximumDischargeCurrent]; + return descriptionString; +} + +@end + +@implementation MTREnergyEVSEClusterEnableDischargingParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::EnergyEvse::Commands::EnableDischarging::Type encodableStruct; + ListFreer listFreer; + { + if (self.dischargingEnabledUntil == nil) { + encodableStruct.dischargingEnabledUntil.SetNull(); + } else { + auto & nonNullValue_0 = encodableStruct.dischargingEnabledUntil.SetNonNull(); + nonNullValue_0 = self.dischargingEnabledUntil.unsignedIntValue; + } + } + { + encodableStruct.maximumDischargeCurrent = self.maximumDischargeCurrent.longLongValue; + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTREnergyEVSEClusterStartDiagnosticsParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTREnergyEVSEClusterStartDiagnosticsParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end + +@implementation MTREnergyEVSEClusterStartDiagnosticsParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::EnergyEvse::Commands::StartDiagnostics::Type encodableStruct; + ListFreer listFreer; + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTREnergyEVSEClusterSetTargetsParams +- (instancetype)init +{ + if (self = [super init]) { + + _dayOfWeekforSequence = @(0); + + _chargingTargets = [NSArray array]; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTREnergyEVSEClusterSetTargetsParams alloc] init]; + + other.dayOfWeekforSequence = self.dayOfWeekforSequence; + other.chargingTargets = self.chargingTargets; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: dayOfWeekforSequence:%@; chargingTargets:%@; >", NSStringFromClass([self class]), _dayOfWeekforSequence, _chargingTargets]; + return descriptionString; +} + +@end + +@implementation MTREnergyEVSEClusterSetTargetsParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::EnergyEvse::Commands::SetTargets::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.dayOfWeekforSequence = static_cast<std::remove_reference_t<decltype(encodableStruct.dayOfWeekforSequence)>>(self.dayOfWeekforSequence.unsignedCharValue); + } + { + { + using ListType_0 = std::remove_reference_t<decltype(encodableStruct.chargingTargets)>; + using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type; + if (self.chargingTargets.count != 0) { + auto * listHolder_0 = new ListHolder<ListMemberType_0>(self.chargingTargets.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]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (MTREnergyEVSEClusterChargingTargetStruct *) self.chargingTargets[i_0]; + listHolder_0->mList[i_0].targetTime = element_0.targetTime.unsignedShortValue; + if (element_0.targetSoC != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].targetSoC.Emplace(); + definedValue_2 = element_0.targetSoC.unsignedCharValue; + } + if (element_0.addedEnergy != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].addedEnergy.Emplace(); + definedValue_2 = element_0.addedEnergy.longLongValue; + } + } + encodableStruct.chargingTargets = ListType_0(listHolder_0->mList, self.chargingTargets.count); + } else { + encodableStruct.chargingTargets = ListType_0(); + } + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTREnergyEVSEClusterGetTargetsParams +- (instancetype)init +{ + if (self = [super init]) { + + _daysToReturn = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTREnergyEVSEClusterGetTargetsParams alloc] init]; + + other.daysToReturn = self.daysToReturn; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: daysToReturn:%@; >", NSStringFromClass([self class]), _daysToReturn]; + return descriptionString; +} + +@end + +@implementation MTREnergyEVSEClusterGetTargetsParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::EnergyEvse::Commands::GetTargets::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.daysToReturn = static_cast<std::remove_reference_t<decltype(encodableStruct.daysToReturn)>>(self.daysToReturn.unsignedCharValue); + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTREnergyEVSEClusterClearTargetsParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTREnergyEVSEClusterClearTargetsParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end + +@implementation MTREnergyEVSEClusterClearTargetsParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::EnergyEvse::Commands::ClearTargets::Type encodableStruct; + ListFreer listFreer; + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + @implementation MTRDoorLockClusterLockDoorParams - (instancetype)init { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index 93339e7d817021..c3135c33d0395b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -1018,6 +1018,54 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTREnergyEVSEClusterGetTargetsResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::EnergyEvse::Commands::GetTargetsResponse::DecodableType &)decodableStruct; + +@end + +@interface MTREnergyEVSEClusterDisableParams (InternalMethods) + +- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTREnergyEVSEClusterEnableChargingParams (InternalMethods) + +- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTREnergyEVSEClusterEnableDischargingParams (InternalMethods) + +- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTREnergyEVSEClusterStartDiagnosticsParams (InternalMethods) + +- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTREnergyEVSEClusterSetTargetsParams (InternalMethods) + +- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTREnergyEVSEClusterGetTargetsParams (InternalMethods) + +- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTREnergyEVSEClusterClearTargetsParams (InternalMethods) + +- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + @interface MTRDoorLockClusterLockDoorParams (InternalMethods) - (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm index a69716ac1008ce..13b6d7401d1728 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm @@ -590,6 +590,36 @@ static BOOL CommandNeedsTimedInvokeInDemandResponseLoadControlCluster(AttributeI } } } +static BOOL CommandNeedsTimedInvokeInEnergyEVSECluster(AttributeId aAttributeId) +{ + using namespace Clusters::EnergyEvse; + switch (aAttributeId) { + case Commands::Disable::Id: { + return YES; + } + case Commands::EnableCharging::Id: { + return YES; + } + case Commands::EnableDischarging::Id: { + return YES; + } + case Commands::StartDiagnostics::Id: { + return YES; + } + case Commands::SetTargets::Id: { + return YES; + } + case Commands::GetTargets::Id: { + return YES; + } + case Commands::ClearTargets::Id: { + return YES; + } + default: { + return NO; + } + } +} static BOOL CommandNeedsTimedInvokeInDoorLockCluster(AttributeId aAttributeId) { using namespace Clusters::DoorLock; @@ -1179,6 +1209,9 @@ BOOL MTRCommandNeedsTimedInvoke(NSNumber * _Nonnull aClusterID, NSNumber * _Nonn case Clusters::DemandResponseLoadControl::Id: { return CommandNeedsTimedInvokeInDemandResponseLoadControlCluster(commandID); } + case Clusters::EnergyEvse::Id: { + return CommandNeedsTimedInvokeInEnergyEVSECluster(commandID); + } case Clusters::DoorLock::Id: { return CommandNeedsTimedInvokeInDoorLockCluster(commandID); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index f100beb32ac62c..0c32b804953e39 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -2526,6 +2526,184 @@ static id _Nullable DecodeEventPayloadForDemandResponseLoadControlCluster(EventI *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } +static id _Nullable DecodeEventPayloadForEnergyEVSECluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::EnergyEvse; + switch (aEventId) { + case Events::EVConnected::Id: { + Events::EVConnected::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTREnergyEVSEClusterEVConnectedEvent new]; + + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedInt:cppValue.sessionID]; + value.sessionID = memberValue; + } while (0); + + return value; + } + case Events::EVNotDetected::Id: { + Events::EVNotDetected::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTREnergyEVSEClusterEVNotDetectedEvent new]; + + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedInt:cppValue.sessionID]; + value.sessionID = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.state)]; + value.state = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedInt:cppValue.sessionDuration]; + value.sessionDuration = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithLongLong:cppValue.sessionEnergyCharged]; + value.sessionEnergyCharged = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.sessionEnergyDischarged.HasValue()) { + memberValue = [NSNumber numberWithLongLong:cppValue.sessionEnergyDischarged.Value()]; + } else { + memberValue = nil; + } + value.sessionEnergyDischarged = memberValue; + } while (0); + + return value; + } + case Events::EnergyTransferStarted::Id: { + Events::EnergyTransferStarted::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTREnergyEVSEClusterEnergyTransferStartedEvent new]; + + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedInt:cppValue.sessionID]; + value.sessionID = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.state)]; + value.state = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithLongLong:cppValue.maximumCurrent]; + value.maximumCurrent = memberValue; + } while (0); + + return value; + } + case Events::EnergyTransferStopped::Id: { + Events::EnergyTransferStopped::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTREnergyEVSEClusterEnergyTransferStoppedEvent new]; + + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedInt:cppValue.sessionID]; + value.sessionID = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.state)]; + value.state = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.reason)]; + value.reason = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithLongLong:cppValue.energyTransferred]; + value.energyTransferred = memberValue; + } while (0); + + return value; + } + case Events::Fault::Id: { + Events::Fault::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTREnergyEVSEClusterFaultEvent new]; + + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedInt:cppValue.sessionID]; + value.sessionID = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.state)]; + value.state = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.faultStatePreviousState)]; + value.faultStatePreviousState = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.faultStateCurrentState)]; + value.faultStateCurrentState = memberValue; + } while (0); + + return value; + } + case Events::Rfid::Id: { + Events::Rfid::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTREnergyEVSEClusterRFIDEvent new]; + + do { + NSData * _Nonnull memberValue; + memberValue = AsData(cppValue.uid); + value.uid = memberValue; + } while (0); + + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} static id _Nullable DecodeEventPayloadForDoorLockCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::DoorLock; @@ -3758,6 +3936,9 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::DemandResponseLoadControl::Id: { return DecodeEventPayloadForDemandResponseLoadControlCluster(aPath.mEventId, aReader, aError); } + case Clusters::EnergyEvse::Id: { + return DecodeEventPayloadForEnergyEVSECluster(aPath.mEventId, aReader, aError); + } case Clusters::DoorLock::Id: { return DecodeEventPayloadForDoorLockCluster(aPath.mEventId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 0c2d92b140f325..14e57945d3090c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -1121,6 +1121,55 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) MTRDemandResponseLoadControlClusterHeatingSourceControlStruct * _Nullable heatingSourceControl MTR_PROVISIONALLY_AVAILABLE; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTREnergyEVSEClusterChargingTargetStruct : NSObject <NSCopying> +@property (nonatomic, copy) NSNumber * _Nonnull targetTime MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable targetSoC MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable addedEnergy MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTREnergyEVSEClusterEVConnectedEvent : NSObject <NSCopying> +@property (nonatomic, copy) NSNumber * _Nonnull sessionID MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTREnergyEVSEClusterEVNotDetectedEvent : NSObject <NSCopying> +@property (nonatomic, copy) NSNumber * _Nonnull sessionID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull state MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull sessionDuration MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull sessionEnergyCharged MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable sessionEnergyDischarged MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTREnergyEVSEClusterEnergyTransferStartedEvent : NSObject <NSCopying> +@property (nonatomic, copy) NSNumber * _Nonnull sessionID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull state MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull maximumCurrent MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTREnergyEVSEClusterEnergyTransferStoppedEvent : NSObject <NSCopying> +@property (nonatomic, copy) NSNumber * _Nonnull sessionID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull state MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull reason MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull energyTransferred MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTREnergyEVSEClusterFaultEvent : NSObject <NSCopying> +@property (nonatomic, copy) NSNumber * _Nonnull sessionID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull state MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull faultStatePreviousState MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull faultStateCurrentState MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTREnergyEVSEClusterRFIDEvent : NSObject <NSCopying> +@property (nonatomic, copy) NSData * _Nonnull uid MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRDoorLockClusterCredentialStruct : NSObject <NSCopying> @property (nonatomic, copy) NSNumber * _Nonnull credentialType MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 52086da233a48f..28e14f9227257f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -4517,6 +4517,237 @@ - (NSString *)description @end +@implementation MTREnergyEVSEClusterChargingTargetStruct +- (instancetype)init +{ + if (self = [super init]) { + + _targetTime = @(0); + + _targetSoC = nil; + + _addedEnergy = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTREnergyEVSEClusterChargingTargetStruct alloc] init]; + + other.targetTime = self.targetTime; + other.targetSoC = self.targetSoC; + other.addedEnergy = self.addedEnergy; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: targetTime:%@; targetSoC:%@; addedEnergy:%@; >", NSStringFromClass([self class]), _targetTime, _targetSoC, _addedEnergy]; + return descriptionString; +} + +@end + +@implementation MTREnergyEVSEClusterEVConnectedEvent +- (instancetype)init +{ + if (self = [super init]) { + + _sessionID = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTREnergyEVSEClusterEVConnectedEvent alloc] init]; + + other.sessionID = self.sessionID; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: sessionID:%@; >", NSStringFromClass([self class]), _sessionID]; + return descriptionString; +} + +@end + +@implementation MTREnergyEVSEClusterEVNotDetectedEvent +- (instancetype)init +{ + if (self = [super init]) { + + _sessionID = @(0); + + _state = @(0); + + _sessionDuration = @(0); + + _sessionEnergyCharged = @(0); + + _sessionEnergyDischarged = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTREnergyEVSEClusterEVNotDetectedEvent alloc] init]; + + other.sessionID = self.sessionID; + other.state = self.state; + other.sessionDuration = self.sessionDuration; + other.sessionEnergyCharged = self.sessionEnergyCharged; + other.sessionEnergyDischarged = self.sessionEnergyDischarged; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: sessionID:%@; state:%@; sessionDuration:%@; sessionEnergyCharged:%@; sessionEnergyDischarged:%@; >", NSStringFromClass([self class]), _sessionID, _state, _sessionDuration, _sessionEnergyCharged, _sessionEnergyDischarged]; + return descriptionString; +} + +@end + +@implementation MTREnergyEVSEClusterEnergyTransferStartedEvent +- (instancetype)init +{ + if (self = [super init]) { + + _sessionID = @(0); + + _state = @(0); + + _maximumCurrent = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTREnergyEVSEClusterEnergyTransferStartedEvent alloc] init]; + + other.sessionID = self.sessionID; + other.state = self.state; + other.maximumCurrent = self.maximumCurrent; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: sessionID:%@; state:%@; maximumCurrent:%@; >", NSStringFromClass([self class]), _sessionID, _state, _maximumCurrent]; + return descriptionString; +} + +@end + +@implementation MTREnergyEVSEClusterEnergyTransferStoppedEvent +- (instancetype)init +{ + if (self = [super init]) { + + _sessionID = @(0); + + _state = @(0); + + _reason = @(0); + + _energyTransferred = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTREnergyEVSEClusterEnergyTransferStoppedEvent alloc] init]; + + other.sessionID = self.sessionID; + other.state = self.state; + other.reason = self.reason; + other.energyTransferred = self.energyTransferred; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: sessionID:%@; state:%@; reason:%@; energyTransferred:%@; >", NSStringFromClass([self class]), _sessionID, _state, _reason, _energyTransferred]; + return descriptionString; +} + +@end + +@implementation MTREnergyEVSEClusterFaultEvent +- (instancetype)init +{ + if (self = [super init]) { + + _sessionID = @(0); + + _state = @(0); + + _faultStatePreviousState = @(0); + + _faultStateCurrentState = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTREnergyEVSEClusterFaultEvent alloc] init]; + + other.sessionID = self.sessionID; + other.state = self.state; + other.faultStatePreviousState = self.faultStatePreviousState; + other.faultStateCurrentState = self.faultStateCurrentState; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: sessionID:%@; state:%@; faultStatePreviousState:%@; faultStateCurrentState:%@; >", NSStringFromClass([self class]), _sessionID, _state, _faultStatePreviousState, _faultStateCurrentState]; + return descriptionString; +} + +@end + +@implementation MTREnergyEVSEClusterRFIDEvent +- (instancetype)init +{ + if (self = [super init]) { + + _uid = [NSData data]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTREnergyEVSEClusterRFIDEvent alloc] init]; + + other.uid = self.uid; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: uid:%@; >", NSStringFromClass([self class]), [_uid base64EncodedStringWithOptions:0]]; + return descriptionString; +} + +@end + @implementation MTRDoorLockClusterCredentialStruct - (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 f6fc2e8986b977..02761e7612968c 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 @@ -10285,6 +10285,1110 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace DemandResponseLoadControl +namespace EnergyEvse { +namespace Attributes { + +namespace State { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable<chip::app::Clusters::EnergyEvse::StateEnum> & value) +{ + using Traits = NumericAttributeTraits<chip::app::Clusters::EnergyEvse::StateEnum>; + 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::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::EnergyEvse::StateEnum value) +{ + using Traits = NumericAttributeTraits<chip::app::Clusters::EnergyEvse::StateEnum>; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits<chip::app::Clusters::EnergyEvse::StateEnum>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable<chip::app::Clusters::EnergyEvse::StateEnum> & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace State + +namespace SupplyState { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::EnergyEvse::SupplyStateEnum * value) +{ + using Traits = NumericAttributeTraits<chip::app::Clusters::EnergyEvse::SupplyStateEnum>; + 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, chip::app::Clusters::EnergyEvse::SupplyStateEnum value) +{ + using Traits = NumericAttributeTraits<chip::app::Clusters::EnergyEvse::SupplyStateEnum>; + 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_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace SupplyState + +namespace FaultState { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::EnergyEvse::FaultStateEnum * value) +{ + using Traits = NumericAttributeTraits<chip::app::Clusters::EnergyEvse::FaultStateEnum>; + 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, chip::app::Clusters::EnergyEvse::FaultStateEnum value) +{ + using Traits = NumericAttributeTraits<chip::app::Clusters::EnergyEvse::FaultStateEnum>; + 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_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace FaultState + +namespace ChargingEnabledUntil { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable<uint32_t> & value) +{ + using Traits = NumericAttributeTraits<uint32_t>; + 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::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits<uint32_t>; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits<uint32_t>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace ChargingEnabledUntil + +namespace DischargingEnabledUntil { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable<uint32_t> & value) +{ + using Traits = NumericAttributeTraits<uint32_t>; + 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::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits<uint32_t>; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits<uint32_t>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace DischargingEnabledUntil + +namespace CircuitCapacity { + +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value) +{ + using Traits = NumericAttributeTraits<int64_t>; + 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, int64_t value) +{ + using Traits = NumericAttributeTraits<int64_t>; + 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_INT64S_ATTRIBUTE_TYPE); +} + +} // namespace CircuitCapacity + +namespace MinimumChargeCurrent { + +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value) +{ + using Traits = NumericAttributeTraits<int64_t>; + 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, int64_t value) +{ + using Traits = NumericAttributeTraits<int64_t>; + 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_INT64S_ATTRIBUTE_TYPE); +} + +} // namespace MinimumChargeCurrent + +namespace MaximumChargeCurrent { + +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value) +{ + using Traits = NumericAttributeTraits<int64_t>; + 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, int64_t value) +{ + using Traits = NumericAttributeTraits<int64_t>; + 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_INT64S_ATTRIBUTE_TYPE); +} + +} // namespace MaximumChargeCurrent + +namespace MaximumDischargeCurrent { + +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value) +{ + using Traits = NumericAttributeTraits<int64_t>; + 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, int64_t value) +{ + using Traits = NumericAttributeTraits<int64_t>; + 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_INT64S_ATTRIBUTE_TYPE); +} + +} // namespace MaximumDischargeCurrent + +namespace UserMaximumChargeCurrent { + +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value) +{ + using Traits = NumericAttributeTraits<int64_t>; + 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, int64_t value) +{ + using Traits = NumericAttributeTraits<int64_t>; + 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_INT64S_ATTRIBUTE_TYPE); +} + +} // namespace UserMaximumChargeCurrent + +namespace RandomizationDelayWindow { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits<uint32_t>; + 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, uint32_t value) +{ + using Traits = NumericAttributeTraits<uint32_t>; + 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_ELAPSED_S_ATTRIBUTE_TYPE); +} + +} // namespace RandomizationDelayWindow + +namespace NumberOfWeeklyTargets { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits<uint8_t>; + 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<uint8_t>; + 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<uint8_t>; + 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<uint8_t>; + 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<uint32_t> & value) +{ + using Traits = NumericAttributeTraits<uint32_t>; + 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::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits<uint32_t>; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits<uint32_t>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace NextChargeStartTime + +namespace NextChargeTargetTime { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable<uint32_t> & value) +{ + using Traits = NumericAttributeTraits<uint32_t>; + 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::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits<uint32_t>; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits<uint32_t>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace NextChargeTargetTime + +namespace NextChargeRequiredEnergy { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable<int64_t> & value) +{ + using Traits = NumericAttributeTraits<int64_t>; + 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::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) +{ + using Traits = NumericAttributeTraits<int64_t>; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_INT64S_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits<int64_t>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_INT64S_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable<int64_t> & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace NextChargeRequiredEnergy + +namespace NextChargeTargetSoC { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable<chip::Percent> & value) +{ + using Traits = NumericAttributeTraits<chip::Percent>; + 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::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent value) +{ + using Traits = NumericAttributeTraits<chip::Percent>; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits<chip::Percent>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable<chip::Percent> & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace NextChargeTargetSoC + +namespace ApproximateEVEfficiency { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable<uint16_t> & value) +{ + using Traits = NumericAttributeTraits<uint16_t>; + 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::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits<uint16_t>; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits<uint16_t>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace ApproximateEVEfficiency + +namespace StateOfCharge { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable<chip::Percent> & value) +{ + using Traits = NumericAttributeTraits<chip::Percent>; + 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::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent value) +{ + using Traits = NumericAttributeTraits<chip::Percent>; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits<chip::Percent>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable<chip::Percent> & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace StateOfCharge + +namespace BatteryCapacity { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable<int64_t> & value) +{ + using Traits = NumericAttributeTraits<int64_t>; + 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::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) +{ + using Traits = NumericAttributeTraits<int64_t>; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_INT64S_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits<int64_t>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_INT64S_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable<int64_t> & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace BatteryCapacity + +namespace VehicleID { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable<chip::MutableCharSpan> & value) +{ + uint8_t zclString[32 + 1]; + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::EnergyEvse::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits<uint8_t>::kNullValue) + { + value.SetNull(); + return EMBER_ZCL_STATUS_SUCCESS; + } + auto & span = value.SetNonNull(); + + VerifyOrReturnError(span.size() == 32, EMBER_ZCL_STATUS_INVALID_DATA_TYPE); + memcpy(span.data(), &zclString[1], 32); + span.reduce_size(length); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + static_assert(32 < NumericAttributeTraits<uint8_t>::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + uint8_t zclString[32 + 1]; + auto length = static_cast<uint8_t>(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + uint8_t zclString[1] = { 0xFF }; + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable<chip::CharSpan> & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace VehicleID + +namespace SessionID { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable<uint32_t> & value) +{ + using Traits = NumericAttributeTraits<uint32_t>; + 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::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits<uint32_t>; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits<uint32_t>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace SessionID + +namespace SessionDuration { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits<uint32_t>; + 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, uint32_t value) +{ + using Traits = NumericAttributeTraits<uint32_t>; + 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_ELAPSED_S_ATTRIBUTE_TYPE); +} + +} // namespace SessionDuration + +namespace SessionEnergyCharged { + +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value) +{ + using Traits = NumericAttributeTraits<int64_t>; + 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, int64_t value) +{ + using Traits = NumericAttributeTraits<int64_t>; + 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_INT64S_ATTRIBUTE_TYPE); +} + +} // namespace SessionEnergyCharged + +namespace SessionEnergyDischarged { + +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value) +{ + using Traits = NumericAttributeTraits<int64_t>; + 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, int64_t value) +{ + using Traits = NumericAttributeTraits<int64_t>; + 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_INT64S_ATTRIBUTE_TYPE); +} + +} // namespace SessionEnergyDischarged + +namespace FeatureMap { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits<uint32_t>; + 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, uint32_t value) +{ + using Traits = NumericAttributeTraits<uint32_t>; + 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_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits<uint16_t>; + 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, uint16_t value) +{ + using Traits = NumericAttributeTraits<uint16_t>; + 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_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace EnergyEvse + namespace DoorLock { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 6c7fa55e828c51..324716079cb3b6 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 @@ -1986,6 +1986,172 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace DemandResponseLoadControl +namespace EnergyEvse { +namespace Attributes { + +namespace State { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable<chip::app::Clusters::EnergyEvse::StateEnum> & value); // StateEnum +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::EnergyEvse::StateEnum value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable<chip::app::Clusters::EnergyEvse::StateEnum> & value); +} // namespace State + +namespace SupplyState { +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::EnergyEvse::SupplyStateEnum * value); // SupplyStateEnum +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::EnergyEvse::SupplyStateEnum value); +} // namespace SupplyState + +namespace FaultState { +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::EnergyEvse::FaultStateEnum * value); // FaultStateEnum +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::EnergyEvse::FaultStateEnum value); +} // namespace FaultState + +namespace ChargingEnabledUntil { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable<uint32_t> & value); // epoch_s +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value); +} // namespace ChargingEnabledUntil + +namespace DischargingEnabledUntil { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable<uint32_t> & value); // epoch_s +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value); +} // namespace DischargingEnabledUntil + +namespace CircuitCapacity { +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // int64s +EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); +} // namespace CircuitCapacity + +namespace MinimumChargeCurrent { +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // int64s +EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); +} // namespace MinimumChargeCurrent + +namespace MaximumChargeCurrent { +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // int64s +EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); +} // namespace MaximumChargeCurrent + +namespace MaximumDischargeCurrent { +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // int64s +EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); +} // namespace MaximumDischargeCurrent + +namespace UserMaximumChargeCurrent { +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // int64s +EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); +} // namespace UserMaximumChargeCurrent + +namespace RandomizationDelayWindow { +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<uint32_t> & value); // epoch_s +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value); +} // namespace NextChargeStartTime + +namespace NextChargeTargetTime { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable<uint32_t> & value); // epoch_s +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value); +} // namespace NextChargeTargetTime + +namespace NextChargeRequiredEnergy { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable<int64_t> & value); // int64s +EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable<int64_t> & value); +} // namespace NextChargeRequiredEnergy + +namespace NextChargeTargetSoC { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable<chip::Percent> & value); // percent +EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable<chip::Percent> & value); +} // namespace NextChargeTargetSoC + +namespace ApproximateEVEfficiency { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable<uint16_t> & value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value); +} // namespace ApproximateEVEfficiency + +namespace StateOfCharge { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable<chip::Percent> & value); // percent +EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable<chip::Percent> & value); +} // namespace StateOfCharge + +namespace BatteryCapacity { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable<int64_t> & value); // int64s +EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable<int64_t> & value); +} // namespace BatteryCapacity + +namespace VehicleID { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable<chip::MutableCharSpan> & value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable<chip::CharSpan> & value); +} // namespace VehicleID + +namespace SessionID { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable<uint32_t> & value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value); +} // namespace SessionID + +namespace SessionDuration { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // elapsed_s +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace SessionDuration + +namespace SessionEnergyCharged { +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // int64s +EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); +} // namespace SessionEnergyCharged + +namespace SessionEnergyDischarged { +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // int64s +EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); +} // namespace SessionEnergyDischarged + +namespace FeatureMap { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace FeatureMap + +namespace ClusterRevision { +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace EnergyEvse + namespace DoorLock { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 9a169142ac5faf..0d7c9a177b12aa 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -553,6 +553,14 @@ void emberAfValveConfigurationAndControlClusterInitCallback(chip::EndpointId end */ void emberAfDemandResponseLoadControlClusterInitCallback(chip::EndpointId endpoint); +/** @brief Energy EVSE Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfEnergyEvseClusterInitCallback(chip::EndpointId endpoint); + /** @brief Door Lock Cluster Init * * Cluster Init @@ -5897,6 +5905,84 @@ void emberAfDemandResponseLoadControlClusterServerTickCallback(chip::EndpointId */ void emberAfDemandResponseLoadControlClusterClientTickCallback(chip::EndpointId endpoint); +// +// Energy EVSE Cluster +// + +/** @brief Energy EVSE Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfEnergyEvseClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief Energy EVSE Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterEnergyEvseClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** @brief Energy EVSE Cluster Client Init + * + * Client Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfEnergyEvseClusterClientInitCallback(chip::EndpointId endpoint); + +/** @brief Energy EVSE Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param attributePath Concrete attribute path that changed + */ +void MatterEnergyEvseClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** @brief Energy EVSE Cluster Server Pre Attribute Changed + * + * Server Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status +MatterEnergyEvseClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Energy EVSE Cluster Client Pre Attribute Changed + * + * Client Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status +MatterEnergyEvseClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Energy EVSE Cluster Server Tick + * + * Server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfEnergyEvseClusterServerTickCallback(chip::EndpointId endpoint); + +/** @brief Energy EVSE Cluster Client Tick + * + * Client Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfEnergyEvseClusterClientTickCallback(chip::EndpointId endpoint); + // // Door Lock Cluster // @@ -9631,6 +9717,48 @@ bool emberAfDemandResponseLoadControlClusterRemoveLoadControlEventRequestCallbac bool emberAfDemandResponseLoadControlClusterClearLoadControlEventsRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::DemandResponseLoadControl::Commands::ClearLoadControlEventsRequest::DecodableType & commandData); +/** + * @brief Energy EVSE Cluster Disable Command callback (from client) + */ +bool emberAfEnergyEvseClusterDisableCallback(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::EnergyEvse::Commands::Disable::DecodableType & commandData); +/** + * @brief Energy EVSE Cluster EnableCharging Command callback (from client) + */ +bool emberAfEnergyEvseClusterEnableChargingCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::EnergyEvse::Commands::EnableCharging::DecodableType & commandData); +/** + * @brief Energy EVSE Cluster EnableDischarging Command callback (from client) + */ +bool emberAfEnergyEvseClusterEnableDischargingCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::EnergyEvse::Commands::EnableDischarging::DecodableType & commandData); +/** + * @brief Energy EVSE Cluster StartDiagnostics Command callback (from client) + */ +bool emberAfEnergyEvseClusterStartDiagnosticsCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::EnergyEvse::Commands::StartDiagnostics::DecodableType & commandData); +/** + * @brief Energy EVSE Cluster SetTargets Command callback (from client) + */ +bool emberAfEnergyEvseClusterSetTargetsCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::EnergyEvse::Commands::SetTargets::DecodableType & commandData); +/** + * @brief Energy EVSE Cluster GetTargets Command callback (from client) + */ +bool emberAfEnergyEvseClusterGetTargetsCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::EnergyEvse::Commands::GetTargets::DecodableType & commandData); +/** + * @brief Energy EVSE Cluster ClearTargets Command callback (from client) + */ +bool emberAfEnergyEvseClusterClearTargetsCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::EnergyEvse::Commands::ClearTargets::DecodableType & commandData); /** * @brief Door Lock Cluster LockDoor Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h index 7664f4ff99393e..58e761c8d9deda 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h @@ -1573,6 +1573,79 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(DemandResponseLoadContr } } +static auto __attribute__((unused)) EnsureKnownEnumValue(EnergyEvse::EnergyTransferStoppedReasonEnum val) +{ + using EnumType = EnergyEvse::EnergyTransferStoppedReasonEnum; + switch (val) + { + case EnumType::kEVStopped: + case EnumType::kEVSEStopped: + case EnumType::kOther: + return val; + default: + return static_cast<EnumType>(3); + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(EnergyEvse::FaultStateEnum val) +{ + using EnumType = EnergyEvse::FaultStateEnum; + switch (val) + { + case EnumType::kNoError: + case EnumType::kMeterFailure: + case EnumType::kOverVoltage: + case EnumType::kUnderVoltage: + case EnumType::kOverCurrent: + case EnumType::kContactWetFailure: + case EnumType::kContactDryFailure: + case EnumType::kGroundFault: + case EnumType::kPowerLoss: + case EnumType::kPowerQuality: + case EnumType::kPilotShortCircuit: + case EnumType::kEmergencyStop: + case EnumType::kEVDisconnected: + case EnumType::kWrongPowerSupply: + case EnumType::kLiveNeutralSwap: + case EnumType::kOverTemperature: + case EnumType::kOther: + return val; + default: + return static_cast<EnumType>(16); + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(EnergyEvse::StateEnum val) +{ + using EnumType = EnergyEvse::StateEnum; + switch (val) + { + case EnumType::kNotPluggedIn: + case EnumType::kPluggedInNoDemand: + case EnumType::kPluggedInDemand: + case EnumType::kPluggedInCharging: + case EnumType::kPluggedInDischarging: + case EnumType::kSessionEnding: + case EnumType::kFault: + return val; + default: + return static_cast<EnumType>(7); + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(EnergyEvse::SupplyStateEnum val) +{ + using EnumType = EnergyEvse::SupplyStateEnum; + switch (val) + { + case EnumType::kDisabled: + case EnumType::kChargingEnabled: + case EnumType::kDischargingEnabled: + case EnumType::kDisabledError: + case EnumType::kDisabledDiagnostics: + return val; + default: + return static_cast<EnumType>(5); + } +} + static auto __attribute__((unused)) EnsureKnownEnumValue(DoorLock::AlarmCodeEnum val) { using EnumType = DoorLock::AlarmCodeEnum; diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 8b2d48c8541877..86f2fd62ecd539 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -2278,6 +2278,103 @@ enum class Feature : uint32_t }; } // namespace DemandResponseLoadControl +namespace EnergyEvse { + +// Enum for EnergyTransferStoppedReasonEnum +enum class EnergyTransferStoppedReasonEnum : uint8_t +{ + kEVStopped = 0x00, + kEVSEStopped = 0x01, + kOther = 0x02, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 3, +}; + +// Enum for FaultStateEnum +enum class FaultStateEnum : uint8_t +{ + kNoError = 0x00, + kMeterFailure = 0x01, + kOverVoltage = 0x02, + kUnderVoltage = 0x03, + kOverCurrent = 0x04, + kContactWetFailure = 0x05, + kContactDryFailure = 0x06, + kGroundFault = 0x07, + kPowerLoss = 0x08, + kPowerQuality = 0x09, + kPilotShortCircuit = 0x0A, + kEmergencyStop = 0x0B, + kEVDisconnected = 0x0C, + kWrongPowerSupply = 0x0D, + kLiveNeutralSwap = 0x0E, + kOverTemperature = 0x0F, + kOther = 0xFF, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 16, +}; + +// Enum for StateEnum +enum class StateEnum : uint8_t +{ + kNotPluggedIn = 0x00, + kPluggedInNoDemand = 0x01, + kPluggedInDemand = 0x02, + kPluggedInCharging = 0x03, + kPluggedInDischarging = 0x04, + kSessionEnding = 0x05, + kFault = 0x06, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 7, +}; + +// Enum for SupplyStateEnum +enum class SupplyStateEnum : uint8_t +{ + kDisabled = 0x00, + kChargingEnabled = 0x01, + kDischargingEnabled = 0x02, + kDisabledError = 0x03, + kDisabledDiagnostics = 0x04, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 5, +}; + +// Bitmap for Feature +enum class Feature : uint32_t +{ + kChargingPreferences = 0x1, + kSoCReporting = 0x2, + kPlugAndCharge = 0x4, + kRfid = 0x8, + kV2x = 0x10, +}; + +// Bitmap for TargetDayOfWeekBitmap +enum class TargetDayOfWeekBitmap : uint8_t +{ + kSunday = 0x1, + kMonday = 0x2, + kTuesday = 0x4, + kWednesday = 0x8, + kThursday = 0x10, + kFriday = 0x20, + kSaturday = 0x40, +}; +} // namespace EnergyEvse + namespace DoorLock { // Enum for AlarmCodeEnum 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 951683417dccb2..e0e8bfb0b31bbd 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 @@ -14439,6 +14439,661 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace Events } // namespace DemandResponseLoadControl +namespace EnergyEvse { +namespace Structs { + +namespace ChargingTargetStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kTargetTime), targetTime); + encoder.Encode(to_underlying(Fields::kTargetSoC), targetSoC); + encoder.Encode(to_underlying(Fields::kAddedEnergy), addedEnergy); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative<CHIP_ERROR>(__element)) + { + return std::get<CHIP_ERROR>(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get<uint8_t>(__element); + + if (__context_tag == to_underlying(Fields::kTargetTime)) + { + err = DataModel::Decode(reader, targetTime); + } + else if (__context_tag == to_underlying(Fields::kTargetSoC)) + { + err = DataModel::Decode(reader, targetSoC); + } + else if (__context_tag == to_underlying(Fields::kAddedEnergy)) + { + err = DataModel::Decode(reader, addedEnergy); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace ChargingTargetStruct +} // 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::kDayOfWeekforSequence), dayOfWeekforSequence); + encoder.Encode(to_underlying(Fields::kChargingTargets), chargingTargets); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative<CHIP_ERROR>(__element)) + { + return std::get<CHIP_ERROR>(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get<uint8_t>(__element); + + if (__context_tag == to_underlying(Fields::kDayOfWeekforSequence)) + { + err = DataModel::Decode(reader, dayOfWeekforSequence); + } + else if (__context_tag == to_underlying(Fields::kChargingTargets)) + { + err = DataModel::Decode(reader, chargingTargets); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace GetTargetsResponse. +namespace Disable { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative<CHIP_ERROR>(__element)) + { + return std::get<CHIP_ERROR>(__element); + } + } +} +} // namespace Disable. +namespace EnableCharging { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kChargingEnabledUntil), chargingEnabledUntil); + encoder.Encode(to_underlying(Fields::kMinimumChargeCurrent), minimumChargeCurrent); + encoder.Encode(to_underlying(Fields::kMaximumChargeCurrent), maximumChargeCurrent); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative<CHIP_ERROR>(__element)) + { + return std::get<CHIP_ERROR>(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get<uint8_t>(__element); + + if (__context_tag == to_underlying(Fields::kChargingEnabledUntil)) + { + err = DataModel::Decode(reader, chargingEnabledUntil); + } + else if (__context_tag == to_underlying(Fields::kMinimumChargeCurrent)) + { + err = DataModel::Decode(reader, minimumChargeCurrent); + } + else if (__context_tag == to_underlying(Fields::kMaximumChargeCurrent)) + { + err = DataModel::Decode(reader, maximumChargeCurrent); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace EnableCharging. +namespace EnableDischarging { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kDischargingEnabledUntil), dischargingEnabledUntil); + encoder.Encode(to_underlying(Fields::kMaximumDischargeCurrent), maximumDischargeCurrent); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative<CHIP_ERROR>(__element)) + { + return std::get<CHIP_ERROR>(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get<uint8_t>(__element); + + if (__context_tag == to_underlying(Fields::kDischargingEnabledUntil)) + { + err = DataModel::Decode(reader, dischargingEnabledUntil); + } + else if (__context_tag == to_underlying(Fields::kMaximumDischargeCurrent)) + { + err = DataModel::Decode(reader, maximumDischargeCurrent); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace EnableDischarging. +namespace StartDiagnostics { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative<CHIP_ERROR>(__element)) + { + return std::get<CHIP_ERROR>(__element); + } + } +} +} // namespace StartDiagnostics. +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); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative<CHIP_ERROR>(__element)) + { + return std::get<CHIP_ERROR>(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get<uint8_t>(__element); + + if (__context_tag == to_underlying(Fields::kDayOfWeekforSequence)) + { + err = DataModel::Decode(reader, dayOfWeekforSequence); + } + else if (__context_tag == to_underlying(Fields::kChargingTargets)) + { + err = DataModel::Decode(reader, chargingTargets); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SetTargets. +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(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative<CHIP_ERROR>(__element)) + { + return std::get<CHIP_ERROR>(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get<uint8_t>(__element); + + if (__context_tag == to_underlying(Fields::kDaysToReturn)) + { + err = DataModel::Decode(reader, daysToReturn); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace GetTargets. +namespace ClearTargets { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative<CHIP_ERROR>(__element)) + { + return std::get<CHIP_ERROR>(__element); + } + } +} +} // namespace ClearTargets. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::State::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, state); + case Attributes::SupplyState::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, supplyState); + case Attributes::FaultState::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, faultState); + case Attributes::ChargingEnabledUntil::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, chargingEnabledUntil); + case Attributes::DischargingEnabledUntil::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, dischargingEnabledUntil); + case Attributes::CircuitCapacity::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, circuitCapacity); + case Attributes::MinimumChargeCurrent::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, minimumChargeCurrent); + case Attributes::MaximumChargeCurrent::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, maximumChargeCurrent); + case Attributes::MaximumDischargeCurrent::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, maximumDischargeCurrent); + case Attributes::UserMaximumChargeCurrent::TypeInfo::GetAttributeId(): + 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(): + return DataModel::Decode(reader, nextChargeTargetTime); + case Attributes::NextChargeRequiredEnergy::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, nextChargeRequiredEnergy); + case Attributes::NextChargeTargetSoC::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, nextChargeTargetSoC); + case Attributes::ApproximateEVEfficiency::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, approximateEVEfficiency); + case Attributes::StateOfCharge::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, stateOfCharge); + case Attributes::BatteryCapacity::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, batteryCapacity); + case Attributes::VehicleID::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, vehicleID); + case Attributes::SessionID::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, sessionID); + case Attributes::SessionDuration::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, sessionDuration); + case Attributes::SessionEnergyCharged::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, sessionEnergyCharged); + case Attributes::SessionEnergyDischarged::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, sessionEnergyDischarged); + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::EventList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventList); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, attributeList); + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, featureMap); + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, clusterRevision); + default: + return CHIP_NO_ERROR; + } +} +} // namespace Attributes + +namespace Events { +namespace EVConnected { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kSessionID), sessionID)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative<CHIP_ERROR>(__element)) + { + return std::get<CHIP_ERROR>(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get<uint8_t>(__element); + + if (__context_tag == to_underlying(Fields::kSessionID)) + { + err = DataModel::Decode(reader, sessionID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace EVConnected. +namespace EVNotDetected { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kSessionID), sessionID)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kState), state)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kSessionDuration), sessionDuration)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kSessionEnergyCharged), sessionEnergyCharged)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kSessionEnergyDischarged), sessionEnergyDischarged)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative<CHIP_ERROR>(__element)) + { + return std::get<CHIP_ERROR>(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get<uint8_t>(__element); + + if (__context_tag == to_underlying(Fields::kSessionID)) + { + err = DataModel::Decode(reader, sessionID); + } + else if (__context_tag == to_underlying(Fields::kState)) + { + err = DataModel::Decode(reader, state); + } + else if (__context_tag == to_underlying(Fields::kSessionDuration)) + { + err = DataModel::Decode(reader, sessionDuration); + } + else if (__context_tag == to_underlying(Fields::kSessionEnergyCharged)) + { + err = DataModel::Decode(reader, sessionEnergyCharged); + } + else if (__context_tag == to_underlying(Fields::kSessionEnergyDischarged)) + { + err = DataModel::Decode(reader, sessionEnergyDischarged); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace EVNotDetected. +namespace EnergyTransferStarted { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kSessionID), sessionID)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kState), state)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMaximumCurrent), maximumCurrent)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative<CHIP_ERROR>(__element)) + { + return std::get<CHIP_ERROR>(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get<uint8_t>(__element); + + if (__context_tag == to_underlying(Fields::kSessionID)) + { + err = DataModel::Decode(reader, sessionID); + } + else if (__context_tag == to_underlying(Fields::kState)) + { + err = DataModel::Decode(reader, state); + } + else if (__context_tag == to_underlying(Fields::kMaximumCurrent)) + { + err = DataModel::Decode(reader, maximumCurrent); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace EnergyTransferStarted. +namespace EnergyTransferStopped { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kSessionID), sessionID)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kState), state)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kReason), reason)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kEnergyTransferred), energyTransferred)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative<CHIP_ERROR>(__element)) + { + return std::get<CHIP_ERROR>(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get<uint8_t>(__element); + + if (__context_tag == to_underlying(Fields::kSessionID)) + { + err = DataModel::Decode(reader, sessionID); + } + else if (__context_tag == to_underlying(Fields::kState)) + { + err = DataModel::Decode(reader, state); + } + else if (__context_tag == to_underlying(Fields::kReason)) + { + err = DataModel::Decode(reader, reason); + } + else if (__context_tag == to_underlying(Fields::kEnergyTransferred)) + { + err = DataModel::Decode(reader, energyTransferred); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace EnergyTransferStopped. +namespace Fault { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kSessionID), sessionID)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kState), state)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kFaultStatePreviousState), faultStatePreviousState)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kFaultStateCurrentState), faultStateCurrentState)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative<CHIP_ERROR>(__element)) + { + return std::get<CHIP_ERROR>(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get<uint8_t>(__element); + + if (__context_tag == to_underlying(Fields::kSessionID)) + { + err = DataModel::Decode(reader, sessionID); + } + else if (__context_tag == to_underlying(Fields::kState)) + { + err = DataModel::Decode(reader, state); + } + else if (__context_tag == to_underlying(Fields::kFaultStatePreviousState)) + { + err = DataModel::Decode(reader, faultStatePreviousState); + } + else if (__context_tag == to_underlying(Fields::kFaultStateCurrentState)) + { + err = DataModel::Decode(reader, faultStateCurrentState); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace Fault. +namespace Rfid { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kUid), uid)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative<CHIP_ERROR>(__element)) + { + return std::get<CHIP_ERROR>(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get<uint8_t>(__element); + + if (__context_tag == to_underlying(Fields::kUid)) + { + err = DataModel::Decode(reader, uid); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace Rfid. +} // namespace Events + +} // namespace EnergyEvse namespace DoorLock { namespace Structs { @@ -24379,6 +25034,21 @@ bool CommandNeedsTimedInvoke(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::EnergyEvse::Id: { + switch (aCommand) + { + case Clusters::EnergyEvse::Commands::Disable::Id: + case Clusters::EnergyEvse::Commands::EnableCharging::Id: + case Clusters::EnergyEvse::Commands::EnableDischarging::Id: + case Clusters::EnergyEvse::Commands::StartDiagnostics::Id: + case Clusters::EnergyEvse::Commands::SetTargets::Id: + case Clusters::EnergyEvse::Commands::GetTargets::Id: + case Clusters::EnergyEvse::Commands::ClearTargets::Id: + return true; + default: + return false; + } + } case Clusters::DoorLock::Id: { switch (aCommand) { @@ -24767,6 +25437,13 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::EnergyEvse::Id: { + switch (aCommand) + { + default: + return false; + } + } case Clusters::DoorLock::Id: { switch (aCommand) { 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 8aa5ff413f6278..37394c7872e88b 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 @@ -20365,6 +20365,963 @@ struct DecodableType } // namespace LoadControlEventStatusChange } // namespace Events } // namespace DemandResponseLoadControl +namespace EnergyEvse { +namespace Structs { +namespace ChargingTargetStruct { +enum class Fields : uint8_t +{ + kTargetTime = 0, + kTargetSoC = 1, + kAddedEnergy = 2, +}; + +struct Type +{ +public: + uint16_t targetTime = static_cast<uint16_t>(0); + Optional<chip::Percent> targetSoC; + Optional<int64_t> addedEnergy; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace ChargingTargetStruct +} // namespace Structs + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace GetTargetsResponse { +struct Type; +struct DecodableType; +} // namespace GetTargetsResponse + +namespace Disable { +struct Type; +struct DecodableType; +} // namespace Disable + +namespace EnableCharging { +struct Type; +struct DecodableType; +} // namespace EnableCharging + +namespace EnableDischarging { +struct Type; +struct DecodableType; +} // namespace EnableDischarging + +namespace StartDiagnostics { +struct Type; +struct DecodableType; +} // namespace StartDiagnostics + +namespace SetTargets { +struct Type; +struct DecodableType; +} // namespace SetTargets + +namespace GetTargets { +struct Type; +struct DecodableType; +} // namespace GetTargets + +namespace ClearTargets { +struct Type; +struct DecodableType; +} // namespace ClearTargets + +} // namespace Commands + +namespace Commands { +namespace GetTargetsResponse { +enum class Fields : uint8_t +{ + kDayOfWeekforSequence = 0, + kChargingTargets = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::GetTargetsResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + + chip::BitMask<TargetDayOfWeekBitmap> dayOfWeekforSequence = static_cast<chip::BitMask<TargetDayOfWeekBitmap>>(0); + DataModel::List<const Structs::ChargingTargetStruct::Type> chargingTargets; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::GetTargetsResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + + chip::BitMask<TargetDayOfWeekBitmap> dayOfWeekforSequence = static_cast<chip::BitMask<TargetDayOfWeekBitmap>>(0); + DataModel::DecodableList<Structs::ChargingTargetStruct::DecodableType> chargingTargets; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace GetTargetsResponse +namespace Disable { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::Disable::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return true; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::Disable::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace Disable +namespace EnableCharging { +enum class Fields : uint8_t +{ + kChargingEnabledUntil = 0, + kMinimumChargeCurrent = 1, + kMaximumChargeCurrent = 2, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::EnableCharging::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + + DataModel::Nullable<uint32_t> chargingEnabledUntil; + int64_t minimumChargeCurrent = static_cast<int64_t>(0); + int64_t maximumChargeCurrent = static_cast<int64_t>(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return true; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::EnableCharging::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + + DataModel::Nullable<uint32_t> chargingEnabledUntil; + int64_t minimumChargeCurrent = static_cast<int64_t>(0); + int64_t maximumChargeCurrent = static_cast<int64_t>(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace EnableCharging +namespace EnableDischarging { +enum class Fields : uint8_t +{ + kDischargingEnabledUntil = 0, + kMaximumDischargeCurrent = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::EnableDischarging::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + + DataModel::Nullable<uint32_t> dischargingEnabledUntil; + int64_t maximumDischargeCurrent = static_cast<int64_t>(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return true; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::EnableDischarging::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + + DataModel::Nullable<uint32_t> dischargingEnabledUntil; + int64_t maximumDischargeCurrent = static_cast<int64_t>(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace EnableDischarging +namespace StartDiagnostics { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::StartDiagnostics::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return true; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::StartDiagnostics::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace StartDiagnostics +namespace SetTargets { +enum class Fields : uint8_t +{ + kDayOfWeekforSequence = 0, + kChargingTargets = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SetTargets::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + + chip::BitMask<TargetDayOfWeekBitmap> dayOfWeekforSequence = static_cast<chip::BitMask<TargetDayOfWeekBitmap>>(0); + DataModel::List<const Structs::ChargingTargetStruct::Type> chargingTargets; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return true; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::SetTargets::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + + chip::BitMask<TargetDayOfWeekBitmap> dayOfWeekforSequence = static_cast<chip::BitMask<TargetDayOfWeekBitmap>>(0); + DataModel::DecodableList<Structs::ChargingTargetStruct::DecodableType> chargingTargets; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SetTargets +namespace GetTargets { +enum class Fields : uint8_t +{ + kDaysToReturn = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::GetTargets::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + + chip::BitMask<TargetDayOfWeekBitmap> daysToReturn = static_cast<chip::BitMask<TargetDayOfWeekBitmap>>(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = Clusters::EnergyEvse::Commands::GetTargetsResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return true; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::GetTargets::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + + chip::BitMask<TargetDayOfWeekBitmap> daysToReturn = static_cast<chip::BitMask<TargetDayOfWeekBitmap>>(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace GetTargets +namespace ClearTargets { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::ClearTargets::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return true; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::ClearTargets::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace ClearTargets +} // namespace Commands + +namespace Attributes { + +namespace State { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable<chip::app::Clusters::EnergyEvse::StateEnum>; + using DecodableType = chip::app::DataModel::Nullable<chip::app::Clusters::EnergyEvse::StateEnum>; + using DecodableArgType = const chip::app::DataModel::Nullable<chip::app::Clusters::EnergyEvse::StateEnum> &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::State::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace State +namespace SupplyState { +struct TypeInfo +{ + using Type = chip::app::Clusters::EnergyEvse::SupplyStateEnum; + using DecodableType = chip::app::Clusters::EnergyEvse::SupplyStateEnum; + using DecodableArgType = chip::app::Clusters::EnergyEvse::SupplyStateEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SupplyState::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SupplyState +namespace FaultState { +struct TypeInfo +{ + using Type = chip::app::Clusters::EnergyEvse::FaultStateEnum; + using DecodableType = chip::app::Clusters::EnergyEvse::FaultStateEnum; + using DecodableArgType = chip::app::Clusters::EnergyEvse::FaultStateEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::FaultState::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace FaultState +namespace ChargingEnabledUntil { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable<uint32_t>; + using DecodableType = chip::app::DataModel::Nullable<uint32_t>; + using DecodableArgType = const chip::app::DataModel::Nullable<uint32_t> &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ChargingEnabledUntil::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ChargingEnabledUntil +namespace DischargingEnabledUntil { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable<uint32_t>; + using DecodableType = chip::app::DataModel::Nullable<uint32_t>; + using DecodableArgType = const chip::app::DataModel::Nullable<uint32_t> &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::DischargingEnabledUntil::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace DischargingEnabledUntil +namespace CircuitCapacity { +struct TypeInfo +{ + using Type = int64_t; + using DecodableType = int64_t; + using DecodableArgType = int64_t; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CircuitCapacity::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CircuitCapacity +namespace MinimumChargeCurrent { +struct TypeInfo +{ + using Type = int64_t; + using DecodableType = int64_t; + using DecodableArgType = int64_t; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MinimumChargeCurrent::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MinimumChargeCurrent +namespace MaximumChargeCurrent { +struct TypeInfo +{ + using Type = int64_t; + using DecodableType = int64_t; + using DecodableArgType = int64_t; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MaximumChargeCurrent::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MaximumChargeCurrent +namespace MaximumDischargeCurrent { +struct TypeInfo +{ + using Type = int64_t; + using DecodableType = int64_t; + using DecodableArgType = int64_t; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MaximumDischargeCurrent::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MaximumDischargeCurrent +namespace UserMaximumChargeCurrent { +struct TypeInfo +{ + using Type = int64_t; + using DecodableType = int64_t; + using DecodableArgType = int64_t; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::UserMaximumChargeCurrent::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace UserMaximumChargeCurrent +namespace RandomizationDelayWindow { +struct TypeInfo +{ + using Type = uint32_t; + using DecodableType = uint32_t; + using DecodableArgType = uint32_t; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::RandomizationDelayWindow::Id; } + 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 +{ + using Type = chip::app::DataModel::Nullable<uint32_t>; + using DecodableType = chip::app::DataModel::Nullable<uint32_t>; + using DecodableArgType = const chip::app::DataModel::Nullable<uint32_t> &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NextChargeStartTime::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace NextChargeStartTime +namespace NextChargeTargetTime { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable<uint32_t>; + using DecodableType = chip::app::DataModel::Nullable<uint32_t>; + using DecodableArgType = const chip::app::DataModel::Nullable<uint32_t> &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NextChargeTargetTime::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace NextChargeTargetTime +namespace NextChargeRequiredEnergy { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable<int64_t>; + using DecodableType = chip::app::DataModel::Nullable<int64_t>; + using DecodableArgType = const chip::app::DataModel::Nullable<int64_t> &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NextChargeRequiredEnergy::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace NextChargeRequiredEnergy +namespace NextChargeTargetSoC { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable<chip::Percent>; + using DecodableType = chip::app::DataModel::Nullable<chip::Percent>; + using DecodableArgType = const chip::app::DataModel::Nullable<chip::Percent> &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NextChargeTargetSoC::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace NextChargeTargetSoC +namespace ApproximateEVEfficiency { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable<uint16_t>; + using DecodableType = chip::app::DataModel::Nullable<uint16_t>; + using DecodableArgType = const chip::app::DataModel::Nullable<uint16_t> &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ApproximateEVEfficiency::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ApproximateEVEfficiency +namespace StateOfCharge { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable<chip::Percent>; + using DecodableType = chip::app::DataModel::Nullable<chip::Percent>; + using DecodableArgType = const chip::app::DataModel::Nullable<chip::Percent> &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::StateOfCharge::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace StateOfCharge +namespace BatteryCapacity { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable<int64_t>; + using DecodableType = chip::app::DataModel::Nullable<int64_t>; + using DecodableArgType = const chip::app::DataModel::Nullable<int64_t> &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::BatteryCapacity::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace BatteryCapacity +namespace VehicleID { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable<chip::CharSpan>; + using DecodableType = chip::app::DataModel::Nullable<chip::CharSpan>; + using DecodableArgType = const chip::app::DataModel::Nullable<chip::CharSpan> &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::VehicleID::Id; } + static constexpr bool MustUseTimedWrite() { return false; } + static constexpr size_t MaxLength() { return 32; } +}; +} // namespace VehicleID +namespace SessionID { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable<uint32_t>; + using DecodableType = chip::app::DataModel::Nullable<uint32_t>; + using DecodableArgType = const chip::app::DataModel::Nullable<uint32_t> &; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SessionID::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SessionID +namespace SessionDuration { +struct TypeInfo +{ + using Type = uint32_t; + using DecodableType = uint32_t; + using DecodableArgType = uint32_t; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SessionDuration::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SessionDuration +namespace SessionEnergyCharged { +struct TypeInfo +{ + using Type = int64_t; + using DecodableType = int64_t; + using DecodableArgType = int64_t; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SessionEnergyCharged::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SessionEnergyCharged +namespace SessionEnergyDischarged { +struct TypeInfo +{ + using Type = int64_t; + using DecodableType = int64_t; + using DecodableArgType = int64_t; + + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SessionEnergyDischarged::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SessionEnergyDischarged +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::State::TypeInfo::DecodableType state; + Attributes::SupplyState::TypeInfo::DecodableType supplyState = + static_cast<chip::app::Clusters::EnergyEvse::SupplyStateEnum>(0); + Attributes::FaultState::TypeInfo::DecodableType faultState = + static_cast<chip::app::Clusters::EnergyEvse::FaultStateEnum>(0); + Attributes::ChargingEnabledUntil::TypeInfo::DecodableType chargingEnabledUntil; + Attributes::DischargingEnabledUntil::TypeInfo::DecodableType dischargingEnabledUntil; + Attributes::CircuitCapacity::TypeInfo::DecodableType circuitCapacity = static_cast<int64_t>(0); + Attributes::MinimumChargeCurrent::TypeInfo::DecodableType minimumChargeCurrent = static_cast<int64_t>(0); + Attributes::MaximumChargeCurrent::TypeInfo::DecodableType maximumChargeCurrent = static_cast<int64_t>(0); + Attributes::MaximumDischargeCurrent::TypeInfo::DecodableType maximumDischargeCurrent = static_cast<int64_t>(0); + Attributes::UserMaximumChargeCurrent::TypeInfo::DecodableType userMaximumChargeCurrent = static_cast<int64_t>(0); + Attributes::RandomizationDelayWindow::TypeInfo::DecodableType randomizationDelayWindow = static_cast<uint32_t>(0); + Attributes::NumberOfWeeklyTargets::TypeInfo::DecodableType numberOfWeeklyTargets = static_cast<uint8_t>(0); + Attributes::NumberOfDailyTargets::TypeInfo::DecodableType numberOfDailyTargets = static_cast<uint8_t>(0); + Attributes::NextChargeStartTime::TypeInfo::DecodableType nextChargeStartTime; + Attributes::NextChargeTargetTime::TypeInfo::DecodableType nextChargeTargetTime; + Attributes::NextChargeRequiredEnergy::TypeInfo::DecodableType nextChargeRequiredEnergy; + Attributes::NextChargeTargetSoC::TypeInfo::DecodableType nextChargeTargetSoC; + Attributes::ApproximateEVEfficiency::TypeInfo::DecodableType approximateEVEfficiency; + Attributes::StateOfCharge::TypeInfo::DecodableType stateOfCharge; + Attributes::BatteryCapacity::TypeInfo::DecodableType batteryCapacity; + Attributes::VehicleID::TypeInfo::DecodableType vehicleID; + Attributes::SessionID::TypeInfo::DecodableType sessionID; + Attributes::SessionDuration::TypeInfo::DecodableType sessionDuration = static_cast<uint32_t>(0); + Attributes::SessionEnergyCharged::TypeInfo::DecodableType sessionEnergyCharged = static_cast<int64_t>(0); + Attributes::SessionEnergyDischarged::TypeInfo::DecodableType sessionEnergyDischarged = static_cast<int64_t>(0); + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::EventList::TypeInfo::DecodableType eventList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast<uint32_t>(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast<uint16_t>(0); + }; +}; +} // namespace Attributes +namespace Events { +namespace EVConnected { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kSessionID = 0, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::EVConnected::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr bool kIsFabricScoped = false; + + uint32_t sessionID = static_cast<uint32_t>(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::EVConnected::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + + uint32_t sessionID = static_cast<uint32_t>(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace EVConnected +namespace EVNotDetected { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kSessionID = 0, + kState = 1, + kSessionDuration = 2, + kSessionEnergyCharged = 3, + kSessionEnergyDischarged = 4, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::EVNotDetected::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr bool kIsFabricScoped = false; + + uint32_t sessionID = static_cast<uint32_t>(0); + StateEnum state = static_cast<StateEnum>(0); + uint32_t sessionDuration = static_cast<uint32_t>(0); + int64_t sessionEnergyCharged = static_cast<int64_t>(0); + Optional<int64_t> sessionEnergyDischarged; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::EVNotDetected::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + + uint32_t sessionID = static_cast<uint32_t>(0); + StateEnum state = static_cast<StateEnum>(0); + uint32_t sessionDuration = static_cast<uint32_t>(0); + int64_t sessionEnergyCharged = static_cast<int64_t>(0); + Optional<int64_t> sessionEnergyDischarged; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace EVNotDetected +namespace EnergyTransferStarted { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kSessionID = 0, + kState = 1, + kMaximumCurrent = 2, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::EnergyTransferStarted::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr bool kIsFabricScoped = false; + + uint32_t sessionID = static_cast<uint32_t>(0); + StateEnum state = static_cast<StateEnum>(0); + int64_t maximumCurrent = static_cast<int64_t>(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::EnergyTransferStarted::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + + uint32_t sessionID = static_cast<uint32_t>(0); + StateEnum state = static_cast<StateEnum>(0); + int64_t maximumCurrent = static_cast<int64_t>(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace EnergyTransferStarted +namespace EnergyTransferStopped { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kSessionID = 0, + kState = 1, + kReason = 2, + kEnergyTransferred = 4, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::EnergyTransferStopped::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr bool kIsFabricScoped = false; + + uint32_t sessionID = static_cast<uint32_t>(0); + StateEnum state = static_cast<StateEnum>(0); + EnergyTransferStoppedReasonEnum reason = static_cast<EnergyTransferStoppedReasonEnum>(0); + int64_t energyTransferred = static_cast<int64_t>(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::EnergyTransferStopped::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + + uint32_t sessionID = static_cast<uint32_t>(0); + StateEnum state = static_cast<StateEnum>(0); + EnergyTransferStoppedReasonEnum reason = static_cast<EnergyTransferStoppedReasonEnum>(0); + int64_t energyTransferred = static_cast<int64_t>(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace EnergyTransferStopped +namespace Fault { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; + +enum class Fields : uint8_t +{ + kSessionID = 0, + kState = 1, + kFaultStatePreviousState = 2, + kFaultStateCurrentState = 4, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::Fault::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr bool kIsFabricScoped = false; + + uint32_t sessionID = static_cast<uint32_t>(0); + StateEnum state = static_cast<StateEnum>(0); + FaultStateEnum faultStatePreviousState = static_cast<FaultStateEnum>(0); + FaultStateEnum faultStateCurrentState = static_cast<FaultStateEnum>(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::Fault::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + + uint32_t sessionID = static_cast<uint32_t>(0); + StateEnum state = static_cast<StateEnum>(0); + FaultStateEnum faultStatePreviousState = static_cast<FaultStateEnum>(0); + FaultStateEnum faultStateCurrentState = static_cast<FaultStateEnum>(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace Fault +namespace Rfid { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kUid = 0, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::Rfid::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + static constexpr bool kIsFabricScoped = false; + + chip::ByteSpan uid; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::Rfid::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; } + + chip::ByteSpan uid; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace Rfid +} // namespace Events +} // namespace EnergyEvse namespace DoorLock { namespace Structs { namespace CredentialStruct { 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 2e82a7be07c1d4..c98362cb4c241e 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 @@ -3637,6 +3637,136 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace DemandResponseLoadControl +namespace EnergyEvse { +namespace Attributes { + +namespace State { +static constexpr AttributeId Id = 0x00000000; +} // namespace State + +namespace SupplyState { +static constexpr AttributeId Id = 0x00000001; +} // namespace SupplyState + +namespace FaultState { +static constexpr AttributeId Id = 0x00000002; +} // namespace FaultState + +namespace ChargingEnabledUntil { +static constexpr AttributeId Id = 0x00000003; +} // namespace ChargingEnabledUntil + +namespace DischargingEnabledUntil { +static constexpr AttributeId Id = 0x00000004; +} // namespace DischargingEnabledUntil + +namespace CircuitCapacity { +static constexpr AttributeId Id = 0x00000005; +} // namespace CircuitCapacity + +namespace MinimumChargeCurrent { +static constexpr AttributeId Id = 0x00000006; +} // namespace MinimumChargeCurrent + +namespace MaximumChargeCurrent { +static constexpr AttributeId Id = 0x00000007; +} // namespace MaximumChargeCurrent + +namespace MaximumDischargeCurrent { +static constexpr AttributeId Id = 0x00000008; +} // namespace MaximumDischargeCurrent + +namespace UserMaximumChargeCurrent { +static constexpr AttributeId Id = 0x00000009; +} // namespace UserMaximumChargeCurrent + +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 + +namespace NextChargeTargetTime { +static constexpr AttributeId Id = 0x00000024; +} // namespace NextChargeTargetTime + +namespace NextChargeRequiredEnergy { +static constexpr AttributeId Id = 0x00000025; +} // namespace NextChargeRequiredEnergy + +namespace NextChargeTargetSoC { +static constexpr AttributeId Id = 0x00000026; +} // namespace NextChargeTargetSoC + +namespace ApproximateEVEfficiency { +static constexpr AttributeId Id = 0x00000027; +} // namespace ApproximateEVEfficiency + +namespace StateOfCharge { +static constexpr AttributeId Id = 0x00000030; +} // namespace StateOfCharge + +namespace BatteryCapacity { +static constexpr AttributeId Id = 0x00000031; +} // namespace BatteryCapacity + +namespace VehicleID { +static constexpr AttributeId Id = 0x00000032; +} // namespace VehicleID + +namespace SessionID { +static constexpr AttributeId Id = 0x00000040; +} // namespace SessionID + +namespace SessionDuration { +static constexpr AttributeId Id = 0x00000041; +} // namespace SessionDuration + +namespace SessionEnergyCharged { +static constexpr AttributeId Id = 0x00000042; +} // namespace SessionEnergyCharged + +namespace SessionEnergyDischarged { +static constexpr AttributeId Id = 0x00000043; +} // namespace SessionEnergyDischarged + +namespace GeneratedCommandList { +static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; +} // namespace GeneratedCommandList + +namespace AcceptedCommandList { +static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; +} // namespace AcceptedCommandList + +namespace EventList { +static constexpr AttributeId Id = Globals::Attributes::EventList::Id; +} // namespace EventList + +namespace AttributeList { +static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; +} // namespace AttributeList + +namespace FeatureMap { +static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; +} // namespace FeatureMap + +namespace ClusterRevision { +static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace EnergyEvse + namespace DoorLock { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index 4f951b3bec1d49..85e2e7286c7602 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -220,6 +220,9 @@ static constexpr ClusterId Id = 0x00000081; namespace DemandResponseLoadControl { static constexpr ClusterId Id = 0x00000096; } // namespace DemandResponseLoadControl +namespace EnergyEvse { +static constexpr ClusterId Id = 0x00000099; +} // namespace EnergyEvse namespace DoorLock { static constexpr ClusterId Id = 0x00000101; } // namespace DoorLock diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index 8b18795939a9ea..30887174a188c4 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -941,6 +941,44 @@ static constexpr CommandId Id = 0x00000004; } // namespace Commands } // namespace DemandResponseLoadControl +namespace EnergyEvse { +namespace Commands { + +namespace GetTargetsResponse { +static constexpr CommandId Id = 0x00000000; +} // namespace GetTargetsResponse + +namespace Disable { +static constexpr CommandId Id = 0x00000001; +} // namespace Disable + +namespace EnableCharging { +static constexpr CommandId Id = 0x00000002; +} // namespace EnableCharging + +namespace EnableDischarging { +static constexpr CommandId Id = 0x00000003; +} // namespace EnableDischarging + +namespace StartDiagnostics { +static constexpr CommandId Id = 0x00000004; +} // namespace StartDiagnostics + +namespace SetTargets { +static constexpr CommandId Id = 0x00000005; +} // namespace SetTargets + +namespace GetTargets { +static constexpr CommandId Id = 0x00000006; +} // namespace GetTargets + +namespace ClearTargets { +static constexpr CommandId Id = 0x00000007; +} // namespace ClearTargets + +} // namespace Commands +} // namespace EnergyEvse + namespace DoorLock { namespace Commands { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h index 1a019ac83d5bf5..a2e4f57f715b21 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h @@ -403,6 +403,36 @@ static constexpr EventId Id = 0x00000000; } // namespace Events } // namespace DemandResponseLoadControl +namespace EnergyEvse { +namespace Events { + +namespace EVConnected { +static constexpr EventId Id = 0x00000000; +} // namespace EVConnected + +namespace EVNotDetected { +static constexpr EventId Id = 0x00000001; +} // namespace EVNotDetected + +namespace EnergyTransferStarted { +static constexpr EventId Id = 0x00000002; +} // namespace EnergyTransferStarted + +namespace EnergyTransferStopped { +static constexpr EventId Id = 0x00000003; +} // namespace EnergyTransferStopped + +namespace Fault { +static constexpr EventId Id = 0x00000004; +} // namespace Fault + +namespace Rfid { +static constexpr EventId Id = 0x00000005; +} // namespace Rfid + +} // namespace Events +} // namespace EnergyEvse + namespace DoorLock { namespace Events { diff --git a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h index 429bff318840b0..558707ee223bdb 100644 --- a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h +++ b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h @@ -443,6 +443,12 @@ #define CHIP_PRINTCLUSTER_DEMAND_RESPONSE_LOAD_CONTROL_CLUSTER #endif +#if defined(ZCL_USING_ENERGY_EVSE_CLUSTER_SERVER) || defined(ZCL_USING_ENERGY_EVSE_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_ENERGY_EVSE_CLUSTER { chip::app::Clusters::EnergyEvse::Id, "Energy EVSE" }, +#else +#define CHIP_PRINTCLUSTER_ENERGY_EVSE_CLUSTER +#endif + #if defined(ZCL_USING_DOOR_LOCK_CLUSTER_SERVER) || defined(ZCL_USING_DOOR_LOCK_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_DOOR_LOCK_CLUSTER { chip::app::Clusters::DoorLock::Id, "Door Lock" }, #else @@ -785,6 +791,7 @@ CHIP_PRINTCLUSTER_BOOLEAN_SENSOR_CONFIGURATION_CLUSTER \ CHIP_PRINTCLUSTER_VALVE_CONFIGURATION_AND_CONTROL_CLUSTER \ CHIP_PRINTCLUSTER_DEMAND_RESPONSE_LOAD_CONTROL_CLUSTER \ + CHIP_PRINTCLUSTER_ENERGY_EVSE_CLUSTER \ CHIP_PRINTCLUSTER_DOOR_LOCK_CLUSTER \ CHIP_PRINTCLUSTER_WINDOW_COVERING_CLUSTER \ CHIP_PRINTCLUSTER_BARRIER_CONTROL_CLUSTER \ diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 3dbe37c3440d8d..02a10981ca9dfa 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -99,6 +99,7 @@ | BooleanSensorConfiguration | 0x0080 | | ValveConfigurationAndControl | 0x0081 | | DemandResponseLoadControl | 0x0096 | +| EnergyEvse | 0x0099 | | DoorLock | 0x0101 | | WindowCovering | 0x0102 | | BarrierControl | 0x0103 | @@ -6630,6 +6631,325 @@ class DemandResponseLoadControlClearLoadControlEventsRequest : public ClusterCom chip::app::Clusters::DemandResponseLoadControl::Commands::ClearLoadControlEventsRequest::Type mRequest; }; +/*----------------------------------------------------------------------------*\ +| Cluster EnergyEvse | 0x0099 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Disable | 0x01 | +| * EnableCharging | 0x02 | +| * EnableDischarging | 0x03 | +| * StartDiagnostics | 0x04 | +| * SetTargets | 0x05 | +| * GetTargets | 0x06 | +| * ClearTargets | 0x07 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * State | 0x0000 | +| * SupplyState | 0x0001 | +| * FaultState | 0x0002 | +| * ChargingEnabledUntil | 0x0003 | +| * DischargingEnabledUntil | 0x0004 | +| * CircuitCapacity | 0x0005 | +| * MinimumChargeCurrent | 0x0006 | +| * MaximumChargeCurrent | 0x0007 | +| * MaximumDischargeCurrent | 0x0008 | +| * UserMaximumChargeCurrent | 0x0009 | +| * RandomizationDelayWindow | 0x000A | +| * NumberOfWeeklyTargets | 0x0021 | +| * NumberOfDailyTargets | 0x0022 | +| * NextChargeStartTime | 0x0023 | +| * NextChargeTargetTime | 0x0024 | +| * NextChargeRequiredEnergy | 0x0025 | +| * NextChargeTargetSoC | 0x0026 | +| * ApproximateEVEfficiency | 0x0027 | +| * StateOfCharge | 0x0030 | +| * BatteryCapacity | 0x0031 | +| * VehicleID | 0x0032 | +| * SessionID | 0x0040 | +| * SessionDuration | 0x0041 | +| * SessionEnergyCharged | 0x0042 | +| * SessionEnergyDischarged | 0x0043 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * EVConnected | 0x0000 | +| * EVNotDetected | 0x0001 | +| * EnergyTransferStarted | 0x0002 | +| * EnergyTransferStopped | 0x0003 | +| * Fault | 0x0004 | +| * Rfid | 0x0005 | +\*----------------------------------------------------------------------------*/ + +/* + * Command Disable + */ +class EnergyEvseDisable : public ClusterCommand +{ +public: + EnergyEvseDisable(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("disable", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector<chip::EndpointId> endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::EnergyEvse::Commands::Disable::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::EnergyEvse::Commands::Disable::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::EnergyEvse::Commands::Disable::Type mRequest; +}; + +/* + * Command EnableCharging + */ +class EnergyEvseEnableCharging : public ClusterCommand +{ +public: + EnergyEvseEnableCharging(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("enable-charging", credsIssuerConfig) + { + AddArgument("ChargingEnabledUntil", 0, UINT32_MAX, &mRequest.chargingEnabledUntil); + AddArgument("MinimumChargeCurrent", INT64_MIN, INT64_MAX, &mRequest.minimumChargeCurrent); + AddArgument("MaximumChargeCurrent", INT64_MIN, INT64_MAX, &mRequest.maximumChargeCurrent); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector<chip::EndpointId> endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::EnergyEvse::Commands::EnableCharging::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::EnergyEvse::Commands::EnableCharging::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::EnergyEvse::Commands::EnableCharging::Type mRequest; +}; + +/* + * Command EnableDischarging + */ +class EnergyEvseEnableDischarging : public ClusterCommand +{ +public: + EnergyEvseEnableDischarging(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("enable-discharging", credsIssuerConfig) + { + AddArgument("DischargingEnabledUntil", 0, UINT32_MAX, &mRequest.dischargingEnabledUntil); + AddArgument("MaximumDischargeCurrent", INT64_MIN, INT64_MAX, &mRequest.maximumDischargeCurrent); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector<chip::EndpointId> endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::EnergyEvse::Commands::EnableDischarging::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::EnergyEvse::Commands::EnableDischarging::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::EnergyEvse::Commands::EnableDischarging::Type mRequest; +}; + +/* + * Command StartDiagnostics + */ +class EnergyEvseStartDiagnostics : public ClusterCommand +{ +public: + EnergyEvseStartDiagnostics(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("start-diagnostics", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector<chip::EndpointId> endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::EnergyEvse::Commands::StartDiagnostics::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::EnergyEvse::Commands::StartDiagnostics::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::EnergyEvse::Commands::StartDiagnostics::Type mRequest; +}; + +/* + * Command SetTargets + */ +class EnergyEvseSetTargets : public ClusterCommand +{ +public: + EnergyEvseSetTargets(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("set-targets", credsIssuerConfig), mComplex_ChargingTargets(&mRequest.chargingTargets) + { + AddArgument("DayOfWeekforSequence", 0, UINT8_MAX, &mRequest.dayOfWeekforSequence); + AddArgument("ChargingTargets", &mComplex_ChargingTargets); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector<chip::EndpointId> endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::EnergyEvse::Commands::SetTargets::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::EnergyEvse::Commands::SetTargets::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::EnergyEvse::Commands::SetTargets::Type mRequest; + TypedComplexArgument<chip::app::DataModel::List<const chip::app::Clusters::EnergyEvse::Structs::ChargingTargetStruct::Type>> + mComplex_ChargingTargets; +}; + +/* + * Command GetTargets + */ +class EnergyEvseGetTargets : public ClusterCommand +{ +public: + EnergyEvseGetTargets(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("get-targets", credsIssuerConfig) + { + AddArgument("DaysToReturn", 0, UINT8_MAX, &mRequest.daysToReturn); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector<chip::EndpointId> endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::EnergyEvse::Commands::GetTargets::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::EnergyEvse::Commands::GetTargets::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::EnergyEvse::Commands::GetTargets::Type mRequest; +}; + +/* + * Command ClearTargets + */ +class EnergyEvseClearTargets : public ClusterCommand +{ +public: + EnergyEvseClearTargets(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("clear-targets", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector<chip::EndpointId> endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::EnergyEvse::Commands::ClearTargets::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::EnergyEvse::Commands::ClearTargets::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::EnergyEvse::Commands::ClearTargets::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster DoorLock | 0x0101 | |------------------------------------------------------------------------------| @@ -17797,6 +18117,203 @@ void registerClusterDemandResponseLoadControl(Commands & commands, CredentialIss commands.RegisterCluster(clusterName, clusterCommands); } +void registerClusterEnergyEvse(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::EnergyEvse; + + const char * clusterName = "EnergyEvse"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique<ClusterCommand>(Id, credsIssuerConfig), // + make_unique<EnergyEvseDisable>(credsIssuerConfig), // + make_unique<EnergyEvseEnableCharging>(credsIssuerConfig), // + make_unique<EnergyEvseEnableDischarging>(credsIssuerConfig), // + make_unique<EnergyEvseStartDiagnostics>(credsIssuerConfig), // + make_unique<EnergyEvseSetTargets>(credsIssuerConfig), // + make_unique<EnergyEvseGetTargets>(credsIssuerConfig), // + make_unique<EnergyEvseClearTargets>(credsIssuerConfig), // + // + // Attributes + // + make_unique<ReadAttribute>(Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "state", Attributes::State::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "supply-state", Attributes::SupplyState::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "fault-state", Attributes::FaultState::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "charging-enabled-until", Attributes::ChargingEnabledUntil::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "discharging-enabled-until", Attributes::DischargingEnabledUntil::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "circuit-capacity", Attributes::CircuitCapacity::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "minimum-charge-current", Attributes::MinimumChargeCurrent::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "maximum-charge-current", Attributes::MaximumChargeCurrent::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "maximum-discharge-current", Attributes::MaximumDischargeCurrent::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "user-maximum-charge-current", Attributes::UserMaximumChargeCurrent::Id, + credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "randomization-delay-window", Attributes::RandomizationDelayWindow::Id, + credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "number-of-weekly-targets", Attributes::NumberOfWeeklyTargets::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "number-of-daily-targets", Attributes::NumberOfDailyTargets::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "next-charge-start-time", Attributes::NextChargeStartTime::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "next-charge-target-time", Attributes::NextChargeTargetTime::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "next-charge-required-energy", Attributes::NextChargeRequiredEnergy::Id, + credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "next-charge-target-so-c", Attributes::NextChargeTargetSoC::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "approximate-evefficiency", Attributes::ApproximateEVEfficiency::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "state-of-charge", Attributes::StateOfCharge::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "battery-capacity", Attributes::BatteryCapacity::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "vehicle-id", Attributes::VehicleID::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "session-id", Attributes::SessionID::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "session-duration", Attributes::SessionDuration::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "session-energy-charged", Attributes::SessionEnergyCharged::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "session-energy-discharged", Attributes::SessionEnergyDischarged::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique<WriteAttribute<>>(Id, credsIssuerConfig), // + make_unique<WriteAttribute<chip::app::DataModel::Nullable<chip::app::Clusters::EnergyEvse::StateEnum>>>( + Id, "state", 0, UINT8_MAX, Attributes::State::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttribute<chip::app::Clusters::EnergyEvse::SupplyStateEnum>>( + Id, "supply-state", 0, UINT8_MAX, Attributes::SupplyState::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttribute<chip::app::Clusters::EnergyEvse::FaultStateEnum>>( + Id, "fault-state", 0, UINT8_MAX, Attributes::FaultState::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttribute<chip::app::DataModel::Nullable<uint32_t>>>(Id, "charging-enabled-until", 0, UINT32_MAX, + Attributes::ChargingEnabledUntil::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttribute<chip::app::DataModel::Nullable<uint32_t>>>(Id, "discharging-enabled-until", 0, UINT32_MAX, + Attributes::DischargingEnabledUntil::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttribute<int64_t>>(Id, "circuit-capacity", INT64_MIN, INT64_MAX, Attributes::CircuitCapacity::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttribute<int64_t>>(Id, "minimum-charge-current", INT64_MIN, INT64_MAX, + Attributes::MinimumChargeCurrent::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique<WriteAttribute<int64_t>>(Id, "maximum-charge-current", INT64_MIN, INT64_MAX, + Attributes::MaximumChargeCurrent::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique<WriteAttribute<int64_t>>(Id, "maximum-discharge-current", INT64_MIN, INT64_MAX, + Attributes::MaximumDischargeCurrent::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique<WriteAttribute<int64_t>>(Id, "user-maximum-charge-current", INT64_MIN, INT64_MAX, + Attributes::UserMaximumChargeCurrent::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique<WriteAttribute<uint32_t>>(Id, "randomization-delay-window", 0, UINT32_MAX, + Attributes::RandomizationDelayWindow::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique<WriteAttribute<uint8_t>>(Id, "number-of-weekly-targets", 0, UINT8_MAX, Attributes::NumberOfWeeklyTargets::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttribute<uint8_t>>(Id, "number-of-daily-targets", 0, UINT8_MAX, Attributes::NumberOfDailyTargets::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttribute<chip::app::DataModel::Nullable<uint32_t>>>(Id, "next-charge-start-time", 0, UINT32_MAX, + Attributes::NextChargeStartTime::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttribute<chip::app::DataModel::Nullable<uint32_t>>>(Id, "next-charge-target-time", 0, UINT32_MAX, + Attributes::NextChargeTargetTime::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttribute<chip::app::DataModel::Nullable<int64_t>>>(Id, "next-charge-required-energy", INT64_MIN, + INT64_MAX, Attributes::NextChargeRequiredEnergy::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttribute<chip::app::DataModel::Nullable<chip::Percent>>>( + Id, "next-charge-target-so-c", 0, UINT8_MAX, Attributes::NextChargeTargetSoC::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique<WriteAttribute<chip::app::DataModel::Nullable<uint16_t>>>(Id, "approximate-evefficiency", 0, UINT16_MAX, + Attributes::ApproximateEVEfficiency::Id, + WriteCommandType::kWrite, credsIssuerConfig), // + make_unique<WriteAttribute<chip::app::DataModel::Nullable<chip::Percent>>>( + Id, "state-of-charge", 0, UINT8_MAX, Attributes::StateOfCharge::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique<WriteAttribute<chip::app::DataModel::Nullable<int64_t>>>(Id, "battery-capacity", INT64_MIN, INT64_MAX, + Attributes::BatteryCapacity::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttribute<chip::app::DataModel::Nullable<chip::CharSpan>>>( + Id, "vehicle-id", Attributes::VehicleID::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttribute<chip::app::DataModel::Nullable<uint32_t>>>( + Id, "session-id", 0, UINT32_MAX, Attributes::SessionID::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttribute<uint32_t>>(Id, "session-duration", 0, UINT32_MAX, Attributes::SessionDuration::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttribute<int64_t>>(Id, "session-energy-charged", INT64_MIN, INT64_MAX, + Attributes::SessionEnergyCharged::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique<WriteAttribute<int64_t>>(Id, "session-energy-discharged", INT64_MIN, INT64_MAX, + Attributes::SessionEnergyDischarged::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique<WriteAttributeAsComplex<chip::app::DataModel::List<const chip::CommandId>>>( + Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique<WriteAttributeAsComplex<chip::app::DataModel::List<const chip::CommandId>>>( + Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttributeAsComplex<chip::app::DataModel::List<const chip::EventId>>>( + Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttributeAsComplex<chip::app::DataModel::List<const chip::AttributeId>>>( + Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttribute<uint32_t>>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttribute<uint16_t>>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "state", Attributes::State::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "supply-state", Attributes::SupplyState::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "fault-state", Attributes::FaultState::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "charging-enabled-until", Attributes::ChargingEnabledUntil::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "discharging-enabled-until", Attributes::DischargingEnabledUntil::Id, + credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "circuit-capacity", Attributes::CircuitCapacity::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "minimum-charge-current", Attributes::MinimumChargeCurrent::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "maximum-charge-current", Attributes::MaximumChargeCurrent::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "maximum-discharge-current", Attributes::MaximumDischargeCurrent::Id, + credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "user-maximum-charge-current", Attributes::UserMaximumChargeCurrent::Id, + credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "randomization-delay-window", Attributes::RandomizationDelayWindow::Id, + credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "number-of-weekly-targets", Attributes::NumberOfWeeklyTargets::Id, + credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "number-of-daily-targets", Attributes::NumberOfDailyTargets::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "next-charge-start-time", Attributes::NextChargeStartTime::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "next-charge-target-time", Attributes::NextChargeTargetTime::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "next-charge-required-energy", Attributes::NextChargeRequiredEnergy::Id, + credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "next-charge-target-so-c", Attributes::NextChargeTargetSoC::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "approximate-evefficiency", Attributes::ApproximateEVEfficiency::Id, + credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "state-of-charge", Attributes::StateOfCharge::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "battery-capacity", Attributes::BatteryCapacity::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "vehicle-id", Attributes::VehicleID::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "session-id", Attributes::SessionID::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "session-duration", Attributes::SessionDuration::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "session-energy-charged", Attributes::SessionEnergyCharged::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "session-energy-discharged", Attributes::SessionEnergyDischarged::Id, + credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique<ReadEvent>(Id, credsIssuerConfig), // + make_unique<ReadEvent>(Id, "evconnected", Events::EVConnected::Id, credsIssuerConfig), // + make_unique<ReadEvent>(Id, "evnot-detected", Events::EVNotDetected::Id, credsIssuerConfig), // + make_unique<ReadEvent>(Id, "energy-transfer-started", Events::EnergyTransferStarted::Id, credsIssuerConfig), // + make_unique<ReadEvent>(Id, "energy-transfer-stopped", Events::EnergyTransferStopped::Id, credsIssuerConfig), // + make_unique<ReadEvent>(Id, "fault", Events::Fault::Id, credsIssuerConfig), // + make_unique<ReadEvent>(Id, "rfid", Events::Rfid::Id, credsIssuerConfig), // + make_unique<SubscribeEvent>(Id, credsIssuerConfig), // + make_unique<SubscribeEvent>(Id, "evconnected", Events::EVConnected::Id, credsIssuerConfig), // + make_unique<SubscribeEvent>(Id, "evnot-detected", Events::EVNotDetected::Id, credsIssuerConfig), // + make_unique<SubscribeEvent>(Id, "energy-transfer-started", Events::EnergyTransferStarted::Id, credsIssuerConfig), // + make_unique<SubscribeEvent>(Id, "energy-transfer-stopped", Events::EnergyTransferStopped::Id, credsIssuerConfig), // + make_unique<SubscribeEvent>(Id, "fault", Events::Fault::Id, credsIssuerConfig), // + make_unique<SubscribeEvent>(Id, "rfid", Events::Rfid::Id, credsIssuerConfig), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +} void registerClusterDoorLock(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::DoorLock; @@ -23146,6 +23663,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterBooleanSensorConfiguration(commands, credsIssuerConfig); registerClusterValveConfigurationAndControl(commands, credsIssuerConfig); registerClusterDemandResponseLoadControl(commands, credsIssuerConfig); + registerClusterEnergyEvse(commands, credsIssuerConfig); registerClusterDoorLock(commands, credsIssuerConfig); registerClusterWindowCovering(commands, credsIssuerConfig); registerClusterBarrierControl(commands, credsIssuerConfig); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index b99220cfda2c75..d7054e21dd700b 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -2592,6 +2592,47 @@ void ComplexArgumentParser::Finalize( ComplexArgumentParser::Finalize(request.randomDurationMinutes); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::EnergyEvse::Structs::ChargingTargetStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("ChargingTargetStruct.targetTime", "targetTime", value.isMember("targetTime"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "targetTime"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.targetTime, value["targetTime"])); + valueCopy.removeMember("targetTime"); + + if (value.isMember("targetSoC")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "targetSoC"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.targetSoC, value["targetSoC"])); + } + valueCopy.removeMember("targetSoC"); + + if (value.isMember("addedEnergy")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "addedEnergy"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.addedEnergy, value["addedEnergy"])); + } + valueCopy.removeMember("addedEnergy"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::EnergyEvse::Structs::ChargingTargetStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.targetTime); + ComplexArgumentParser::Finalize(request.targetSoC); + ComplexArgumentParser::Finalize(request.addedEnergy); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::DoorLock::Structs::CredentialStruct::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 39eeb0b1fb5cce..34a3712ce0f24a 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -324,6 +324,11 @@ static CHIP_ERROR Setup(const char * label, static void Finalize(chip::app::Clusters::DemandResponseLoadControl::Structs::LoadControlProgramStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::EnergyEvse::Structs::ChargingTargetStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::EnergyEvse::Structs::ChargingTargetStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::DoorLock::Structs::CredentialStruct::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 780aeec581baf8..63247de721a00d 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -2289,6 +2289,39 @@ CHIP_ERROR DataModelLogger::LogValue( return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::EnergyEvse::Structs::ChargingTargetStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("TargetTime", indent + 1, value.targetTime); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'TargetTime'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("TargetSoC", indent + 1, value.targetSoC); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'TargetSoC'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("AddedEnergy", indent + 1, value.addedEnergy); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'AddedEnergy'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::DoorLock::Structs::CredentialStruct::DecodableType & value) { @@ -4504,6 +4537,196 @@ 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 EnergyEvse::Events::EVConnected::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("SessionID", indent + 1, value.sessionID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionID'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const EnergyEvse::Events::EVNotDetected::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("SessionID", indent + 1, value.sessionID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionID'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("State", indent + 1, value.state); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'State'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("SessionDuration", indent + 1, value.sessionDuration); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionDuration'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("SessionEnergyCharged", indent + 1, value.sessionEnergyCharged); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionEnergyCharged'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("SessionEnergyDischarged", indent + 1, value.sessionEnergyDischarged); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionEnergyDischarged'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const EnergyEvse::Events::EnergyTransferStarted::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("SessionID", indent + 1, value.sessionID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionID'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("State", indent + 1, value.state); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'State'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("MaximumCurrent", indent + 1, value.maximumCurrent); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MaximumCurrent'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const EnergyEvse::Events::EnergyTransferStopped::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("SessionID", indent + 1, value.sessionID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionID'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("State", indent + 1, value.state); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'State'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Reason", indent + 1, value.reason); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Reason'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("EnergyTransferred", indent + 1, value.energyTransferred); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'EnergyTransferred'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const EnergyEvse::Events::Fault::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("SessionID", indent + 1, value.sessionID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionID'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("State", indent + 1, value.state); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'State'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("FaultStatePreviousState", indent + 1, value.faultStatePreviousState); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FaultStatePreviousState'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("FaultStateCurrentState", indent + 1, value.faultStateCurrentState); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FaultStateCurrentState'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const EnergyEvse::Events::Rfid::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("Uid", indent + 1, value.uid); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Uid'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const DoorLock::Events::DoorLockAlarm::DecodableType & value) { @@ -5321,6 +5544,15 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } +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)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType & value) { @@ -10080,6 +10312,167 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case EnergyEvse::Id: { + switch (path.mAttributeId) + { + case EnergyEvse::Attributes::State::Id: { + chip::app::DataModel::Nullable<chip::app::Clusters::EnergyEvse::StateEnum> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("State", 1, value); + } + case EnergyEvse::Attributes::SupplyState::Id: { + chip::app::Clusters::EnergyEvse::SupplyStateEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SupplyState", 1, value); + } + case EnergyEvse::Attributes::FaultState::Id: { + chip::app::Clusters::EnergyEvse::FaultStateEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FaultState", 1, value); + } + case EnergyEvse::Attributes::ChargingEnabledUntil::Id: { + chip::app::DataModel::Nullable<uint32_t> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ChargingEnabledUntil", 1, value); + } + case EnergyEvse::Attributes::DischargingEnabledUntil::Id: { + chip::app::DataModel::Nullable<uint32_t> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("DischargingEnabledUntil", 1, value); + } + case EnergyEvse::Attributes::CircuitCapacity::Id: { + int64_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CircuitCapacity", 1, value); + } + case EnergyEvse::Attributes::MinimumChargeCurrent::Id: { + int64_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MinimumChargeCurrent", 1, value); + } + case EnergyEvse::Attributes::MaximumChargeCurrent::Id: { + int64_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MaximumChargeCurrent", 1, value); + } + case EnergyEvse::Attributes::MaximumDischargeCurrent::Id: { + int64_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MaximumDischargeCurrent", 1, value); + } + case EnergyEvse::Attributes::UserMaximumChargeCurrent::Id: { + int64_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("UserMaximumChargeCurrent", 1, value); + } + case EnergyEvse::Attributes::RandomizationDelayWindow::Id: { + uint32_t value; + 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<uint32_t> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("NextChargeStartTime", 1, value); + } + case EnergyEvse::Attributes::NextChargeTargetTime::Id: { + chip::app::DataModel::Nullable<uint32_t> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("NextChargeTargetTime", 1, value); + } + case EnergyEvse::Attributes::NextChargeRequiredEnergy::Id: { + chip::app::DataModel::Nullable<int64_t> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("NextChargeRequiredEnergy", 1, value); + } + case EnergyEvse::Attributes::NextChargeTargetSoC::Id: { + chip::app::DataModel::Nullable<chip::Percent> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("NextChargeTargetSoC", 1, value); + } + case EnergyEvse::Attributes::ApproximateEVEfficiency::Id: { + chip::app::DataModel::Nullable<uint16_t> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ApproximateEVEfficiency", 1, value); + } + case EnergyEvse::Attributes::StateOfCharge::Id: { + chip::app::DataModel::Nullable<chip::Percent> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("StateOfCharge", 1, value); + } + case EnergyEvse::Attributes::BatteryCapacity::Id: { + chip::app::DataModel::Nullable<int64_t> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("BatteryCapacity", 1, value); + } + case EnergyEvse::Attributes::VehicleID::Id: { + chip::app::DataModel::Nullable<chip::CharSpan> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("VehicleID", 1, value); + } + case EnergyEvse::Attributes::SessionID::Id: { + chip::app::DataModel::Nullable<uint32_t> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SessionID", 1, value); + } + case EnergyEvse::Attributes::SessionDuration::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SessionDuration", 1, value); + } + case EnergyEvse::Attributes::SessionEnergyCharged::Id: { + int64_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SessionEnergyCharged", 1, value); + } + case EnergyEvse::Attributes::SessionEnergyDischarged::Id: { + int64_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SessionEnergyDischarged", 1, value); + } + case EnergyEvse::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList<chip::CommandId> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + } + case EnergyEvse::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList<chip::CommandId> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + } + case EnergyEvse::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList<chip::EventId> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventList", 1, value); + } + case EnergyEvse::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList<chip::AttributeId> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AttributeList", 1, value); + } + case EnergyEvse::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case EnergyEvse::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } case DoorLock::Id: { switch (path.mAttributeId) { @@ -14945,6 +15338,17 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa } break; } + case EnergyEvse::Id: { + switch (path.mCommandId) + { + case EnergyEvse::Commands::GetTargetsResponse::Id: { + EnergyEvse::Commands::GetTargetsResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("GetTargetsResponse", 1, value); + } + } + break; + } case DoorLock::Id: { switch (path.mCommandId) { @@ -15201,12 +15605,12 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mEventId) { case AccessControl::Events::AccessControlEntryChanged::Id: { - chip::app::Clusters::AccessControl::Events::AccessControlEntryChanged::DecodableType value; + AccessControl::Events::AccessControlEntryChanged::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AccessControlEntryChanged", 1, value); } case AccessControl::Events::AccessControlExtensionChanged::Id: { - chip::app::Clusters::AccessControl::Events::AccessControlExtensionChanged::DecodableType value; + AccessControl::Events::AccessControlExtensionChanged::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AccessControlExtensionChanged", 1, value); } @@ -15217,12 +15621,12 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mEventId) { case Actions::Events::StateChanged::Id: { - chip::app::Clusters::Actions::Events::StateChanged::DecodableType value; + Actions::Events::StateChanged::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("StateChanged", 1, value); } case Actions::Events::ActionFailed::Id: { - chip::app::Clusters::Actions::Events::ActionFailed::DecodableType value; + Actions::Events::ActionFailed::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ActionFailed", 1, value); } @@ -15233,22 +15637,22 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mEventId) { case BasicInformation::Events::StartUp::Id: { - chip::app::Clusters::BasicInformation::Events::StartUp::DecodableType value; + BasicInformation::Events::StartUp::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("StartUp", 1, value); } case BasicInformation::Events::ShutDown::Id: { - chip::app::Clusters::BasicInformation::Events::ShutDown::DecodableType value; + BasicInformation::Events::ShutDown::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ShutDown", 1, value); } case BasicInformation::Events::Leave::Id: { - chip::app::Clusters::BasicInformation::Events::Leave::DecodableType value; + BasicInformation::Events::Leave::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Leave", 1, value); } case BasicInformation::Events::ReachableChanged::Id: { - chip::app::Clusters::BasicInformation::Events::ReachableChanged::DecodableType value; + BasicInformation::Events::ReachableChanged::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ReachableChanged", 1, value); } @@ -15259,17 +15663,17 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mEventId) { case OtaSoftwareUpdateRequestor::Events::StateTransition::Id: { - chip::app::Clusters::OtaSoftwareUpdateRequestor::Events::StateTransition::DecodableType value; + OtaSoftwareUpdateRequestor::Events::StateTransition::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("StateTransition", 1, value); } case OtaSoftwareUpdateRequestor::Events::VersionApplied::Id: { - chip::app::Clusters::OtaSoftwareUpdateRequestor::Events::VersionApplied::DecodableType value; + OtaSoftwareUpdateRequestor::Events::VersionApplied::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("VersionApplied", 1, value); } case OtaSoftwareUpdateRequestor::Events::DownloadError::Id: { - chip::app::Clusters::OtaSoftwareUpdateRequestor::Events::DownloadError::DecodableType value; + OtaSoftwareUpdateRequestor::Events::DownloadError::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("DownloadError", 1, value); } @@ -15280,17 +15684,17 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mEventId) { case PowerSource::Events::WiredFaultChange::Id: { - chip::app::Clusters::PowerSource::Events::WiredFaultChange::DecodableType value; + PowerSource::Events::WiredFaultChange::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("WiredFaultChange", 1, value); } case PowerSource::Events::BatFaultChange::Id: { - chip::app::Clusters::PowerSource::Events::BatFaultChange::DecodableType value; + PowerSource::Events::BatFaultChange::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("BatFaultChange", 1, value); } case PowerSource::Events::BatChargeFaultChange::Id: { - chip::app::Clusters::PowerSource::Events::BatChargeFaultChange::DecodableType value; + PowerSource::Events::BatChargeFaultChange::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("BatChargeFaultChange", 1, value); } @@ -15301,22 +15705,22 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mEventId) { case GeneralDiagnostics::Events::HardwareFaultChange::Id: { - chip::app::Clusters::GeneralDiagnostics::Events::HardwareFaultChange::DecodableType value; + GeneralDiagnostics::Events::HardwareFaultChange::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("HardwareFaultChange", 1, value); } case GeneralDiagnostics::Events::RadioFaultChange::Id: { - chip::app::Clusters::GeneralDiagnostics::Events::RadioFaultChange::DecodableType value; + GeneralDiagnostics::Events::RadioFaultChange::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("RadioFaultChange", 1, value); } case GeneralDiagnostics::Events::NetworkFaultChange::Id: { - chip::app::Clusters::GeneralDiagnostics::Events::NetworkFaultChange::DecodableType value; + GeneralDiagnostics::Events::NetworkFaultChange::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("NetworkFaultChange", 1, value); } case GeneralDiagnostics::Events::BootReason::Id: { - chip::app::Clusters::GeneralDiagnostics::Events::BootReason::DecodableType value; + GeneralDiagnostics::Events::BootReason::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("BootReason", 1, value); } @@ -15327,7 +15731,7 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mEventId) { case SoftwareDiagnostics::Events::SoftwareFault::Id: { - chip::app::Clusters::SoftwareDiagnostics::Events::SoftwareFault::DecodableType value; + SoftwareDiagnostics::Events::SoftwareFault::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SoftwareFault", 1, value); } @@ -15338,12 +15742,12 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mEventId) { case ThreadNetworkDiagnostics::Events::ConnectionStatus::Id: { - chip::app::Clusters::ThreadNetworkDiagnostics::Events::ConnectionStatus::DecodableType value; + ThreadNetworkDiagnostics::Events::ConnectionStatus::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ConnectionStatus", 1, value); } case ThreadNetworkDiagnostics::Events::NetworkFaultChange::Id: { - chip::app::Clusters::ThreadNetworkDiagnostics::Events::NetworkFaultChange::DecodableType value; + ThreadNetworkDiagnostics::Events::NetworkFaultChange::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("NetworkFaultChange", 1, value); } @@ -15354,17 +15758,17 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mEventId) { case WiFiNetworkDiagnostics::Events::Disconnection::Id: { - chip::app::Clusters::WiFiNetworkDiagnostics::Events::Disconnection::DecodableType value; + WiFiNetworkDiagnostics::Events::Disconnection::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Disconnection", 1, value); } case WiFiNetworkDiagnostics::Events::AssociationFailure::Id: { - chip::app::Clusters::WiFiNetworkDiagnostics::Events::AssociationFailure::DecodableType value; + WiFiNetworkDiagnostics::Events::AssociationFailure::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AssociationFailure", 1, value); } case WiFiNetworkDiagnostics::Events::ConnectionStatus::Id: { - chip::app::Clusters::WiFiNetworkDiagnostics::Events::ConnectionStatus::DecodableType value; + WiFiNetworkDiagnostics::Events::ConnectionStatus::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ConnectionStatus", 1, value); } @@ -15375,27 +15779,27 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mEventId) { case TimeSynchronization::Events::DSTTableEmpty::Id: { - chip::app::Clusters::TimeSynchronization::Events::DSTTableEmpty::DecodableType value; + TimeSynchronization::Events::DSTTableEmpty::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("DSTTableEmpty", 1, value); } case TimeSynchronization::Events::DSTStatus::Id: { - chip::app::Clusters::TimeSynchronization::Events::DSTStatus::DecodableType value; + TimeSynchronization::Events::DSTStatus::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("DSTStatus", 1, value); } case TimeSynchronization::Events::TimeZoneStatus::Id: { - chip::app::Clusters::TimeSynchronization::Events::TimeZoneStatus::DecodableType value; + TimeSynchronization::Events::TimeZoneStatus::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("TimeZoneStatus", 1, value); } case TimeSynchronization::Events::TimeFailure::Id: { - chip::app::Clusters::TimeSynchronization::Events::TimeFailure::DecodableType value; + TimeSynchronization::Events::TimeFailure::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("TimeFailure", 1, value); } case TimeSynchronization::Events::MissingTrustedTimeSource::Id: { - chip::app::Clusters::TimeSynchronization::Events::MissingTrustedTimeSource::DecodableType value; + TimeSynchronization::Events::MissingTrustedTimeSource::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MissingTrustedTimeSource", 1, value); } @@ -15406,22 +15810,22 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mEventId) { case BridgedDeviceBasicInformation::Events::StartUp::Id: { - chip::app::Clusters::BridgedDeviceBasicInformation::Events::StartUp::DecodableType value; + BridgedDeviceBasicInformation::Events::StartUp::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("StartUp", 1, value); } case BridgedDeviceBasicInformation::Events::ShutDown::Id: { - chip::app::Clusters::BridgedDeviceBasicInformation::Events::ShutDown::DecodableType value; + BridgedDeviceBasicInformation::Events::ShutDown::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ShutDown", 1, value); } case BridgedDeviceBasicInformation::Events::Leave::Id: { - chip::app::Clusters::BridgedDeviceBasicInformation::Events::Leave::DecodableType value; + BridgedDeviceBasicInformation::Events::Leave::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Leave", 1, value); } case BridgedDeviceBasicInformation::Events::ReachableChanged::Id: { - chip::app::Clusters::BridgedDeviceBasicInformation::Events::ReachableChanged::DecodableType value; + BridgedDeviceBasicInformation::Events::ReachableChanged::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ReachableChanged", 1, value); } @@ -15432,37 +15836,37 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mEventId) { case Switch::Events::SwitchLatched::Id: { - chip::app::Clusters::Switch::Events::SwitchLatched::DecodableType value; + Switch::Events::SwitchLatched::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SwitchLatched", 1, value); } case Switch::Events::InitialPress::Id: { - chip::app::Clusters::Switch::Events::InitialPress::DecodableType value; + Switch::Events::InitialPress::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("InitialPress", 1, value); } case Switch::Events::LongPress::Id: { - chip::app::Clusters::Switch::Events::LongPress::DecodableType value; + Switch::Events::LongPress::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("LongPress", 1, value); } case Switch::Events::ShortRelease::Id: { - chip::app::Clusters::Switch::Events::ShortRelease::DecodableType value; + Switch::Events::ShortRelease::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ShortRelease", 1, value); } case Switch::Events::LongRelease::Id: { - chip::app::Clusters::Switch::Events::LongRelease::DecodableType value; + Switch::Events::LongRelease::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("LongRelease", 1, value); } case Switch::Events::MultiPressOngoing::Id: { - chip::app::Clusters::Switch::Events::MultiPressOngoing::DecodableType value; + Switch::Events::MultiPressOngoing::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MultiPressOngoing", 1, value); } case Switch::Events::MultiPressComplete::Id: { - chip::app::Clusters::Switch::Events::MultiPressComplete::DecodableType value; + Switch::Events::MultiPressComplete::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MultiPressComplete", 1, value); } @@ -15473,7 +15877,7 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mEventId) { case BooleanState::Events::StateChange::Id: { - chip::app::Clusters::BooleanState::Events::StateChange::DecodableType value; + BooleanState::Events::StateChange::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("StateChange", 1, value); } @@ -15484,7 +15888,7 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mEventId) { case RefrigeratorAlarm::Events::Notify::Id: { - chip::app::Clusters::RefrigeratorAlarm::Events::Notify::DecodableType value; + RefrigeratorAlarm::Events::Notify::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Notify", 1, value); } @@ -15495,57 +15899,57 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mEventId) { case SmokeCoAlarm::Events::SmokeAlarm::Id: { - chip::app::Clusters::SmokeCoAlarm::Events::SmokeAlarm::DecodableType value; + SmokeCoAlarm::Events::SmokeAlarm::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SmokeAlarm", 1, value); } case SmokeCoAlarm::Events::COAlarm::Id: { - chip::app::Clusters::SmokeCoAlarm::Events::COAlarm::DecodableType value; + SmokeCoAlarm::Events::COAlarm::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("COAlarm", 1, value); } case SmokeCoAlarm::Events::LowBattery::Id: { - chip::app::Clusters::SmokeCoAlarm::Events::LowBattery::DecodableType value; + SmokeCoAlarm::Events::LowBattery::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("LowBattery", 1, value); } case SmokeCoAlarm::Events::HardwareFault::Id: { - chip::app::Clusters::SmokeCoAlarm::Events::HardwareFault::DecodableType value; + SmokeCoAlarm::Events::HardwareFault::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("HardwareFault", 1, value); } case SmokeCoAlarm::Events::EndOfService::Id: { - chip::app::Clusters::SmokeCoAlarm::Events::EndOfService::DecodableType value; + SmokeCoAlarm::Events::EndOfService::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EndOfService", 1, value); } case SmokeCoAlarm::Events::SelfTestComplete::Id: { - chip::app::Clusters::SmokeCoAlarm::Events::SelfTestComplete::DecodableType value; + SmokeCoAlarm::Events::SelfTestComplete::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SelfTestComplete", 1, value); } case SmokeCoAlarm::Events::AlarmMuted::Id: { - chip::app::Clusters::SmokeCoAlarm::Events::AlarmMuted::DecodableType value; + SmokeCoAlarm::Events::AlarmMuted::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AlarmMuted", 1, value); } case SmokeCoAlarm::Events::MuteEnded::Id: { - chip::app::Clusters::SmokeCoAlarm::Events::MuteEnded::DecodableType value; + SmokeCoAlarm::Events::MuteEnded::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MuteEnded", 1, value); } case SmokeCoAlarm::Events::InterconnectSmokeAlarm::Id: { - chip::app::Clusters::SmokeCoAlarm::Events::InterconnectSmokeAlarm::DecodableType value; + SmokeCoAlarm::Events::InterconnectSmokeAlarm::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("InterconnectSmokeAlarm", 1, value); } case SmokeCoAlarm::Events::InterconnectCOAlarm::Id: { - chip::app::Clusters::SmokeCoAlarm::Events::InterconnectCOAlarm::DecodableType value; + SmokeCoAlarm::Events::InterconnectCOAlarm::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("InterconnectCOAlarm", 1, value); } case SmokeCoAlarm::Events::AllClear::Id: { - chip::app::Clusters::SmokeCoAlarm::Events::AllClear::DecodableType value; + SmokeCoAlarm::Events::AllClear::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AllClear", 1, value); } @@ -15556,7 +15960,7 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mEventId) { case DishwasherAlarm::Events::Notify::Id: { - chip::app::Clusters::DishwasherAlarm::Events::Notify::DecodableType value; + DishwasherAlarm::Events::Notify::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Notify", 1, value); } @@ -15567,12 +15971,12 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mEventId) { case OperationalState::Events::OperationalError::Id: { - chip::app::Clusters::OperationalState::Events::OperationalError::DecodableType value; + OperationalState::Events::OperationalError::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("OperationalError", 1, value); } case OperationalState::Events::OperationCompletion::Id: { - chip::app::Clusters::OperationalState::Events::OperationCompletion::DecodableType value; + OperationalState::Events::OperationCompletion::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("OperationCompletion", 1, value); } @@ -15583,12 +15987,12 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mEventId) { case RvcOperationalState::Events::OperationalError::Id: { - chip::app::Clusters::RvcOperationalState::Events::OperationalError::DecodableType value; + RvcOperationalState::Events::OperationalError::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("OperationalError", 1, value); } case RvcOperationalState::Events::OperationCompletion::Id: { - chip::app::Clusters::RvcOperationalState::Events::OperationCompletion::DecodableType value; + RvcOperationalState::Events::OperationCompletion::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("OperationCompletion", 1, value); } @@ -15599,12 +16003,12 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mEventId) { case BooleanSensorConfiguration::Events::AlarmsStateChanged::Id: { - chip::app::Clusters::BooleanSensorConfiguration::Events::AlarmsStateChanged::DecodableType value; + BooleanSensorConfiguration::Events::AlarmsStateChanged::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AlarmsStateChanged", 1, value); } case BooleanSensorConfiguration::Events::SensorFault::Id: { - chip::app::Clusters::BooleanSensorConfiguration::Events::SensorFault::DecodableType value; + BooleanSensorConfiguration::Events::SensorFault::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SensorFault", 1, value); } @@ -15615,12 +16019,12 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mEventId) { case ValveConfigurationAndControl::Events::ValveStateChanged::Id: { - chip::app::Clusters::ValveConfigurationAndControl::Events::ValveStateChanged::DecodableType value; + ValveConfigurationAndControl::Events::ValveStateChanged::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ValveStateChanged", 1, value); } case ValveConfigurationAndControl::Events::ValveFault::Id: { - chip::app::Clusters::ValveConfigurationAndControl::Events::ValveFault::DecodableType value; + ValveConfigurationAndControl::Events::ValveFault::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ValveFault", 1, value); } @@ -15631,38 +16035,74 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mEventId) { case DemandResponseLoadControl::Events::LoadControlEventStatusChange::Id: { - chip::app::Clusters::DemandResponseLoadControl::Events::LoadControlEventStatusChange::DecodableType value; + DemandResponseLoadControl::Events::LoadControlEventStatusChange::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("LoadControlEventStatusChange", 1, value); } } break; } + case EnergyEvse::Id: { + switch (header.mPath.mEventId) + { + case EnergyEvse::Events::EVConnected::Id: { + EnergyEvse::Events::EVConnected::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EVConnected", 1, value); + } + case EnergyEvse::Events::EVNotDetected::Id: { + EnergyEvse::Events::EVNotDetected::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EVNotDetected", 1, value); + } + case EnergyEvse::Events::EnergyTransferStarted::Id: { + EnergyEvse::Events::EnergyTransferStarted::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EnergyTransferStarted", 1, value); + } + case EnergyEvse::Events::EnergyTransferStopped::Id: { + EnergyEvse::Events::EnergyTransferStopped::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EnergyTransferStopped", 1, value); + } + case EnergyEvse::Events::Fault::Id: { + EnergyEvse::Events::Fault::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("Fault", 1, value); + } + case EnergyEvse::Events::Rfid::Id: { + EnergyEvse::Events::Rfid::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("RFID", 1, value); + } + } + break; + } case DoorLock::Id: { switch (header.mPath.mEventId) { case DoorLock::Events::DoorLockAlarm::Id: { - chip::app::Clusters::DoorLock::Events::DoorLockAlarm::DecodableType value; + DoorLock::Events::DoorLockAlarm::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("DoorLockAlarm", 1, value); } case DoorLock::Events::DoorStateChange::Id: { - chip::app::Clusters::DoorLock::Events::DoorStateChange::DecodableType value; + DoorLock::Events::DoorStateChange::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("DoorStateChange", 1, value); } case DoorLock::Events::LockOperation::Id: { - chip::app::Clusters::DoorLock::Events::LockOperation::DecodableType value; + DoorLock::Events::LockOperation::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("LockOperation", 1, value); } case DoorLock::Events::LockOperationError::Id: { - chip::app::Clusters::DoorLock::Events::LockOperationError::DecodableType value; + DoorLock::Events::LockOperationError::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("LockOperationError", 1, value); } case DoorLock::Events::LockUserChange::Id: { - chip::app::Clusters::DoorLock::Events::LockUserChange::DecodableType value; + DoorLock::Events::LockUserChange::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("LockUserChange", 1, value); } @@ -15673,87 +16113,87 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mEventId) { case PumpConfigurationAndControl::Events::SupplyVoltageLow::Id: { - chip::app::Clusters::PumpConfigurationAndControl::Events::SupplyVoltageLow::DecodableType value; + PumpConfigurationAndControl::Events::SupplyVoltageLow::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SupplyVoltageLow", 1, value); } case PumpConfigurationAndControl::Events::SupplyVoltageHigh::Id: { - chip::app::Clusters::PumpConfigurationAndControl::Events::SupplyVoltageHigh::DecodableType value; + PumpConfigurationAndControl::Events::SupplyVoltageHigh::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SupplyVoltageHigh", 1, value); } case PumpConfigurationAndControl::Events::PowerMissingPhase::Id: { - chip::app::Clusters::PumpConfigurationAndControl::Events::PowerMissingPhase::DecodableType value; + PumpConfigurationAndControl::Events::PowerMissingPhase::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("PowerMissingPhase", 1, value); } case PumpConfigurationAndControl::Events::SystemPressureLow::Id: { - chip::app::Clusters::PumpConfigurationAndControl::Events::SystemPressureLow::DecodableType value; + PumpConfigurationAndControl::Events::SystemPressureLow::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SystemPressureLow", 1, value); } case PumpConfigurationAndControl::Events::SystemPressureHigh::Id: { - chip::app::Clusters::PumpConfigurationAndControl::Events::SystemPressureHigh::DecodableType value; + PumpConfigurationAndControl::Events::SystemPressureHigh::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SystemPressureHigh", 1, value); } case PumpConfigurationAndControl::Events::DryRunning::Id: { - chip::app::Clusters::PumpConfigurationAndControl::Events::DryRunning::DecodableType value; + PumpConfigurationAndControl::Events::DryRunning::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("DryRunning", 1, value); } case PumpConfigurationAndControl::Events::MotorTemperatureHigh::Id: { - chip::app::Clusters::PumpConfigurationAndControl::Events::MotorTemperatureHigh::DecodableType value; + PumpConfigurationAndControl::Events::MotorTemperatureHigh::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MotorTemperatureHigh", 1, value); } case PumpConfigurationAndControl::Events::PumpMotorFatalFailure::Id: { - chip::app::Clusters::PumpConfigurationAndControl::Events::PumpMotorFatalFailure::DecodableType value; + PumpConfigurationAndControl::Events::PumpMotorFatalFailure::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("PumpMotorFatalFailure", 1, value); } case PumpConfigurationAndControl::Events::ElectronicTemperatureHigh::Id: { - chip::app::Clusters::PumpConfigurationAndControl::Events::ElectronicTemperatureHigh::DecodableType value; + PumpConfigurationAndControl::Events::ElectronicTemperatureHigh::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ElectronicTemperatureHigh", 1, value); } case PumpConfigurationAndControl::Events::PumpBlocked::Id: { - chip::app::Clusters::PumpConfigurationAndControl::Events::PumpBlocked::DecodableType value; + PumpConfigurationAndControl::Events::PumpBlocked::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("PumpBlocked", 1, value); } case PumpConfigurationAndControl::Events::SensorFailure::Id: { - chip::app::Clusters::PumpConfigurationAndControl::Events::SensorFailure::DecodableType value; + PumpConfigurationAndControl::Events::SensorFailure::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SensorFailure", 1, value); } case PumpConfigurationAndControl::Events::ElectronicNonFatalFailure::Id: { - chip::app::Clusters::PumpConfigurationAndControl::Events::ElectronicNonFatalFailure::DecodableType value; + PumpConfigurationAndControl::Events::ElectronicNonFatalFailure::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ElectronicNonFatalFailure", 1, value); } case PumpConfigurationAndControl::Events::ElectronicFatalFailure::Id: { - chip::app::Clusters::PumpConfigurationAndControl::Events::ElectronicFatalFailure::DecodableType value; + PumpConfigurationAndControl::Events::ElectronicFatalFailure::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ElectronicFatalFailure", 1, value); } case PumpConfigurationAndControl::Events::GeneralFault::Id: { - chip::app::Clusters::PumpConfigurationAndControl::Events::GeneralFault::DecodableType value; + PumpConfigurationAndControl::Events::GeneralFault::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("GeneralFault", 1, value); } case PumpConfigurationAndControl::Events::Leakage::Id: { - chip::app::Clusters::PumpConfigurationAndControl::Events::Leakage::DecodableType value; + PumpConfigurationAndControl::Events::Leakage::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Leakage", 1, value); } case PumpConfigurationAndControl::Events::AirDetection::Id: { - chip::app::Clusters::PumpConfigurationAndControl::Events::AirDetection::DecodableType value; + PumpConfigurationAndControl::Events::AirDetection::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AirDetection", 1, value); } case PumpConfigurationAndControl::Events::TurbineOperation::Id: { - chip::app::Clusters::PumpConfigurationAndControl::Events::TurbineOperation::DecodableType value; + PumpConfigurationAndControl::Events::TurbineOperation::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("TurbineOperation", 1, value); } @@ -15764,12 +16204,12 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mEventId) { case UnitTesting::Events::TestEvent::Id: { - chip::app::Clusters::UnitTesting::Events::TestEvent::DecodableType value; + UnitTesting::Events::TestEvent::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("TestEvent", 1, value); } case UnitTesting::Events::TestFabricScopedEvent::Id: { - chip::app::Clusters::UnitTesting::Events::TestFabricScopedEvent::DecodableType value; + UnitTesting::Events::TestFabricScopedEvent::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("TestFabricScopedEvent", 1, 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 a120b9021f7b95..8348bb7f439032 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -205,6 +205,9 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DemandResponseLoadControl::Structs::LoadControlProgramStruct::DecodableType & value); +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::DoorLock::Structs::CredentialStruct::DecodableType & value); @@ -401,6 +404,18 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DemandResponseLoadControl::Events::LoadControlEventStatusChange::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::EnergyEvse::Events::EVConnected::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::EnergyEvse::Events::EVNotDetected::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::EnergyEvse::Events::EnergyTransferStarted::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::EnergyEvse::Events::EnergyTransferStopped::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::EnergyEvse::Events::Fault::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::EnergyEvse::Events::Rfid::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DoorLock::Events::DoorLockAlarm::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, @@ -552,6 +567,8 @@ LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::EnergyEvse::Commands::GetTargetsResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, 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 e7eeaf80841278..1abda0eca4c006 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -102,6 +102,7 @@ | BooleanSensorConfiguration | 0x0080 | | ValveConfigurationAndControl | 0x0081 | | DemandResponseLoadControl | 0x0096 | +| EnergyEvse | 0x0099 | | DoorLock | 0x0101 | | WindowCovering | 0x0102 | | BarrierControl | 0x0103 | @@ -76535,6 +76536,3233 @@ class SubscribeAttributeDemandResponseLoadControlClusterRevision : public Subscr } }; +#endif // MTR_ENABLE_PROVISIONAL +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/*----------------------------------------------------------------------------*\ +| Cluster EnergyEvse | 0x0099 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Disable | 0x01 | +| * EnableCharging | 0x02 | +| * EnableDischarging | 0x03 | +| * StartDiagnostics | 0x04 | +| * SetTargets | 0x05 | +| * GetTargets | 0x06 | +| * ClearTargets | 0x07 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * State | 0x0000 | +| * SupplyState | 0x0001 | +| * FaultState | 0x0002 | +| * ChargingEnabledUntil | 0x0003 | +| * DischargingEnabledUntil | 0x0004 | +| * CircuitCapacity | 0x0005 | +| * MinimumChargeCurrent | 0x0006 | +| * MaximumChargeCurrent | 0x0007 | +| * MaximumDischargeCurrent | 0x0008 | +| * UserMaximumChargeCurrent | 0x0009 | +| * RandomizationDelayWindow | 0x000A | +| * NumberOfWeeklyTargets | 0x0021 | +| * NumberOfDailyTargets | 0x0022 | +| * NextChargeStartTime | 0x0023 | +| * NextChargeTargetTime | 0x0024 | +| * NextChargeRequiredEnergy | 0x0025 | +| * NextChargeTargetSoC | 0x0026 | +| * ApproximateEVEfficiency | 0x0027 | +| * StateOfCharge | 0x0030 | +| * BatteryCapacity | 0x0031 | +| * VehicleID | 0x0032 | +| * SessionID | 0x0040 | +| * SessionDuration | 0x0041 | +| * SessionEnergyCharged | 0x0042 | +| * SessionEnergyDischarged | 0x0043 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * EVConnected | 0x0000 | +| * EVNotDetected | 0x0001 | +| * EnergyTransferStarted | 0x0002 | +| * EnergyTransferStopped | 0x0003 | +| * Fault | 0x0004 | +| * Rfid | 0x0005 | +\*----------------------------------------------------------------------------*/ + +#if MTR_ENABLE_PROVISIONAL +/* + * Command Disable + */ +class EnergyEvseDisable : public ClusterCommand { +public: + EnergyEvseDisable() + : ClusterCommand("disable") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::EnergyEvse::Commands::Disable::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, 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 = [[MTREnergyEVSEClusterDisableParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster disableWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command EnableCharging + */ +class EnergyEvseEnableCharging : public ClusterCommand { +public: + EnergyEvseEnableCharging() + : ClusterCommand("enable-charging") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("ChargingEnabledUntil", 0, UINT32_MAX, &mRequest.chargingEnabledUntil); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MinimumChargeCurrent", INT64_MIN, INT64_MAX, &mRequest.minimumChargeCurrent); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MaximumChargeCurrent", INT64_MIN, INT64_MAX, &mRequest.maximumChargeCurrent); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::EnergyEvse::Commands::EnableCharging::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, 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 = [[MTREnergyEVSEClusterEnableChargingParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + if (mRequest.chargingEnabledUntil.IsNull()) { + params.chargingEnabledUntil = nil; + } else { + params.chargingEnabledUntil = [NSNumber numberWithUnsignedInt:mRequest.chargingEnabledUntil.Value()]; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.minimumChargeCurrent = [NSNumber numberWithLongLong:mRequest.minimumChargeCurrent]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.maximumChargeCurrent = [NSNumber numberWithLongLong:mRequest.maximumChargeCurrent]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster enableChargingWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::EnergyEvse::Commands::EnableCharging::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command EnableDischarging + */ +class EnergyEvseEnableDischarging : public ClusterCommand { +public: + EnergyEvseEnableDischarging() + : ClusterCommand("enable-discharging") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("DischargingEnabledUntil", 0, UINT32_MAX, &mRequest.dischargingEnabledUntil); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MaximumDischargeCurrent", INT64_MIN, INT64_MAX, &mRequest.maximumDischargeCurrent); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::EnergyEvse::Commands::EnableDischarging::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, 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 = [[MTREnergyEVSEClusterEnableDischargingParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + if (mRequest.dischargingEnabledUntil.IsNull()) { + params.dischargingEnabledUntil = nil; + } else { + params.dischargingEnabledUntil = [NSNumber numberWithUnsignedInt:mRequest.dischargingEnabledUntil.Value()]; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.maximumDischargeCurrent = [NSNumber numberWithLongLong:mRequest.maximumDischargeCurrent]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster enableDischargingWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::EnergyEvse::Commands::EnableDischarging::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command StartDiagnostics + */ +class EnergyEvseStartDiagnostics : public ClusterCommand { +public: + EnergyEvseStartDiagnostics() + : ClusterCommand("start-diagnostics") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::EnergyEvse::Commands::StartDiagnostics::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, 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 = [[MTREnergyEVSEClusterStartDiagnosticsParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster startDiagnosticsWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command SetTargets + */ +class EnergyEvseSetTargets : public ClusterCommand { +public: + EnergyEvseSetTargets() + : ClusterCommand("set-targets") + , mComplex_ChargingTargets(&mRequest.chargingTargets) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("DayOfWeekforSequence", 0, UINT8_MAX, &mRequest.dayOfWeekforSequence); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("ChargingTargets", &mComplex_ChargingTargets); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::EnergyEvse::Commands::SetTargets::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, 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 = [[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.targetTime = [NSNumber numberWithUnsignedShort:entry_0.targetTime]; + if (entry_0.targetSoC.HasValue()) { + newElement_0.targetSoC = [NSNumber numberWithUnsignedChar:entry_0.targetSoC.Value()]; + } else { + newElement_0.targetSoC = nil; + } + if (entry_0.addedEnergy.HasValue()) { + newElement_0.addedEnergy = [NSNumber numberWithLongLong:entry_0.addedEnergy.Value()]; + } else { + newElement_0.addedEnergy = nil; + } + [array_0 addObject:newElement_0]; + } + params.chargingTargets = array_0; + } +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setTargetsWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::EnergyEvse::Commands::SetTargets::Type mRequest; + TypedComplexArgument<chip::app::DataModel::List<const chip::app::Clusters::EnergyEvse::Structs::ChargingTargetStruct::Type>> mComplex_ChargingTargets; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command GetTargets + */ +class EnergyEvseGetTargets : public ClusterCommand { +public: + EnergyEvseGetTargets() + : ClusterCommand("get-targets") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("DaysToReturn", 0, UINT8_MAX, &mRequest.daysToReturn); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::EnergyEvse::Commands::GetTargets::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, 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 = [[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--) { + [cluster getTargetsWithParams:params completion: + ^(MTREnergyEVSEClusterGetTargetsResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::EnergyEvse::Commands::GetTargetsResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::EnergyEvse::Commands::GetTargetsResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::EnergyEvse::Commands::GetTargets::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command ClearTargets + */ +class EnergyEvseClearTargets : public ClusterCommand { +public: + EnergyEvseClearTargets() + : ClusterCommand("clear-targets") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvse::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::EnergyEvse::Commands::ClearTargets::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, 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 = [[MTREnergyEVSEClusterClearTargetsParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster clearTargetsWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +#endif // MTR_ENABLE_PROVISIONAL + +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute State + */ +class ReadEnergyEvseState : public ReadAttribute { +public: + ReadEnergyEvseState() + : ReadAttribute("state") + { + } + + ~ReadEnergyEvseState() + { + } + + 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::State::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 readAttributeStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.State response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE State read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseState : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseState() + : SubscribeAttribute("state") + { + } + + ~SubscribeAttributeEnergyEvseState() + { + } + + 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::State::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 subscribeAttributeStateWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.State 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 SupplyState + */ +class ReadEnergyEvseSupplyState : public ReadAttribute { +public: + ReadEnergyEvseSupplyState() + : ReadAttribute("supply-state") + { + } + + ~ReadEnergyEvseSupplyState() + { + } + + 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::SupplyState::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 readAttributeSupplyStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.SupplyState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE SupplyState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseSupplyState : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseSupplyState() + : SubscribeAttribute("supply-state") + { + } + + ~SubscribeAttributeEnergyEvseSupplyState() + { + } + + 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::SupplyState::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 subscribeAttributeSupplyStateWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.SupplyState 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 FaultState + */ +class ReadEnergyEvseFaultState : public ReadAttribute { +public: + ReadEnergyEvseFaultState() + : ReadAttribute("fault-state") + { + } + + ~ReadEnergyEvseFaultState() + { + } + + 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::FaultState::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 readAttributeFaultStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.FaultState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE FaultState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseFaultState : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseFaultState() + : SubscribeAttribute("fault-state") + { + } + + ~SubscribeAttributeEnergyEvseFaultState() + { + } + + 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::FaultState::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 subscribeAttributeFaultStateWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.FaultState 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 ChargingEnabledUntil + */ +class ReadEnergyEvseChargingEnabledUntil : public ReadAttribute { +public: + ReadEnergyEvseChargingEnabledUntil() + : ReadAttribute("charging-enabled-until") + { + } + + ~ReadEnergyEvseChargingEnabledUntil() + { + } + + 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::ChargingEnabledUntil::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 readAttributeChargingEnabledUntilWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.ChargingEnabledUntil response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE ChargingEnabledUntil read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseChargingEnabledUntil : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseChargingEnabledUntil() + : SubscribeAttribute("charging-enabled-until") + { + } + + ~SubscribeAttributeEnergyEvseChargingEnabledUntil() + { + } + + 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::ChargingEnabledUntil::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 subscribeAttributeChargingEnabledUntilWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.ChargingEnabledUntil 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 DischargingEnabledUntil + */ +class ReadEnergyEvseDischargingEnabledUntil : public ReadAttribute { +public: + ReadEnergyEvseDischargingEnabledUntil() + : ReadAttribute("discharging-enabled-until") + { + } + + ~ReadEnergyEvseDischargingEnabledUntil() + { + } + + 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::DischargingEnabledUntil::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 readAttributeDischargingEnabledUntilWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.DischargingEnabledUntil response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE DischargingEnabledUntil read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseDischargingEnabledUntil : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseDischargingEnabledUntil() + : SubscribeAttribute("discharging-enabled-until") + { + } + + ~SubscribeAttributeEnergyEvseDischargingEnabledUntil() + { + } + + 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::DischargingEnabledUntil::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 subscribeAttributeDischargingEnabledUntilWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.DischargingEnabledUntil 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 CircuitCapacity + */ +class ReadEnergyEvseCircuitCapacity : public ReadAttribute { +public: + ReadEnergyEvseCircuitCapacity() + : ReadAttribute("circuit-capacity") + { + } + + ~ReadEnergyEvseCircuitCapacity() + { + } + + 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::CircuitCapacity::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 readAttributeCircuitCapacityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.CircuitCapacity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE CircuitCapacity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseCircuitCapacity : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseCircuitCapacity() + : SubscribeAttribute("circuit-capacity") + { + } + + ~SubscribeAttributeEnergyEvseCircuitCapacity() + { + } + + 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::CircuitCapacity::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 subscribeAttributeCircuitCapacityWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.CircuitCapacity 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 MinimumChargeCurrent + */ +class ReadEnergyEvseMinimumChargeCurrent : public ReadAttribute { +public: + ReadEnergyEvseMinimumChargeCurrent() + : ReadAttribute("minimum-charge-current") + { + } + + ~ReadEnergyEvseMinimumChargeCurrent() + { + } + + 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::MinimumChargeCurrent::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 readAttributeMinimumChargeCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.MinimumChargeCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE MinimumChargeCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseMinimumChargeCurrent : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseMinimumChargeCurrent() + : SubscribeAttribute("minimum-charge-current") + { + } + + ~SubscribeAttributeEnergyEvseMinimumChargeCurrent() + { + } + + 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::MinimumChargeCurrent::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 subscribeAttributeMinimumChargeCurrentWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.MinimumChargeCurrent 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 MaximumChargeCurrent + */ +class ReadEnergyEvseMaximumChargeCurrent : public ReadAttribute { +public: + ReadEnergyEvseMaximumChargeCurrent() + : ReadAttribute("maximum-charge-current") + { + } + + ~ReadEnergyEvseMaximumChargeCurrent() + { + } + + 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::MaximumChargeCurrent::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 readAttributeMaximumChargeCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.MaximumChargeCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE MaximumChargeCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseMaximumChargeCurrent : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseMaximumChargeCurrent() + : SubscribeAttribute("maximum-charge-current") + { + } + + ~SubscribeAttributeEnergyEvseMaximumChargeCurrent() + { + } + + 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::MaximumChargeCurrent::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 subscribeAttributeMaximumChargeCurrentWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.MaximumChargeCurrent 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 MaximumDischargeCurrent + */ +class ReadEnergyEvseMaximumDischargeCurrent : public ReadAttribute { +public: + ReadEnergyEvseMaximumDischargeCurrent() + : ReadAttribute("maximum-discharge-current") + { + } + + ~ReadEnergyEvseMaximumDischargeCurrent() + { + } + + 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::MaximumDischargeCurrent::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 readAttributeMaximumDischargeCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.MaximumDischargeCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE MaximumDischargeCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseMaximumDischargeCurrent : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseMaximumDischargeCurrent() + : SubscribeAttribute("maximum-discharge-current") + { + } + + ~SubscribeAttributeEnergyEvseMaximumDischargeCurrent() + { + } + + 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::MaximumDischargeCurrent::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 subscribeAttributeMaximumDischargeCurrentWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.MaximumDischargeCurrent 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 UserMaximumChargeCurrent + */ +class ReadEnergyEvseUserMaximumChargeCurrent : public ReadAttribute { +public: + ReadEnergyEvseUserMaximumChargeCurrent() + : ReadAttribute("user-maximum-charge-current") + { + } + + ~ReadEnergyEvseUserMaximumChargeCurrent() + { + } + + 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::UserMaximumChargeCurrent::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 readAttributeUserMaximumChargeCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.UserMaximumChargeCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE UserMaximumChargeCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteEnergyEvseUserMaximumChargeCurrent : public WriteAttribute { +public: + WriteEnergyEvseUserMaximumChargeCurrent() + : WriteAttribute("user-maximum-charge-current") + { + AddArgument("attr-name", "user-maximum-charge-current"); + AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteEnergyEvseUserMaximumChargeCurrent() + { + } + + 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::UserMaximumChargeCurrent::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithLongLong:mValue]; + + [cluster writeAttributeUserMaximumChargeCurrentWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("EnergyEVSE UserMaximumChargeCurrent write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + int64_t mValue; +}; + +class SubscribeAttributeEnergyEvseUserMaximumChargeCurrent : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseUserMaximumChargeCurrent() + : SubscribeAttribute("user-maximum-charge-current") + { + } + + ~SubscribeAttributeEnergyEvseUserMaximumChargeCurrent() + { + } + + 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::UserMaximumChargeCurrent::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 subscribeAttributeUserMaximumChargeCurrentWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.UserMaximumChargeCurrent 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 RandomizationDelayWindow + */ +class ReadEnergyEvseRandomizationDelayWindow : public ReadAttribute { +public: + ReadEnergyEvseRandomizationDelayWindow() + : ReadAttribute("randomization-delay-window") + { + } + + ~ReadEnergyEvseRandomizationDelayWindow() + { + } + + 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::RandomizationDelayWindow::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 readAttributeRandomizationDelayWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.RandomizationDelayWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE RandomizationDelayWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteEnergyEvseRandomizationDelayWindow : public WriteAttribute { +public: + WriteEnergyEvseRandomizationDelayWindow() + : WriteAttribute("randomization-delay-window") + { + AddArgument("attr-name", "randomization-delay-window"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteEnergyEvseRandomizationDelayWindow() + { + } + + 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::RandomizationDelayWindow::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedInt:mValue]; + + [cluster writeAttributeRandomizationDelayWindowWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("EnergyEVSE RandomizationDelayWindow write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint32_t mValue; +}; + +class SubscribeAttributeEnergyEvseRandomizationDelayWindow : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseRandomizationDelayWindow() + : SubscribeAttribute("randomization-delay-window") + { + } + + ~SubscribeAttributeEnergyEvseRandomizationDelayWindow() + { + } + + 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::RandomizationDelayWindow::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 subscribeAttributeRandomizationDelayWindowWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.RandomizationDelayWindow 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 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 + */ +class ReadEnergyEvseNextChargeStartTime : public ReadAttribute { +public: + ReadEnergyEvseNextChargeStartTime() + : ReadAttribute("next-charge-start-time") + { + } + + ~ReadEnergyEvseNextChargeStartTime() + { + } + + 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::NextChargeStartTime::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 readAttributeNextChargeStartTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.NextChargeStartTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE NextChargeStartTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseNextChargeStartTime : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseNextChargeStartTime() + : SubscribeAttribute("next-charge-start-time") + { + } + + ~SubscribeAttributeEnergyEvseNextChargeStartTime() + { + } + + 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::NextChargeStartTime::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 subscribeAttributeNextChargeStartTimeWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.NextChargeStartTime 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 NextChargeTargetTime + */ +class ReadEnergyEvseNextChargeTargetTime : public ReadAttribute { +public: + ReadEnergyEvseNextChargeTargetTime() + : ReadAttribute("next-charge-target-time") + { + } + + ~ReadEnergyEvseNextChargeTargetTime() + { + } + + 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::NextChargeTargetTime::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 readAttributeNextChargeTargetTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.NextChargeTargetTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE NextChargeTargetTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseNextChargeTargetTime : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseNextChargeTargetTime() + : SubscribeAttribute("next-charge-target-time") + { + } + + ~SubscribeAttributeEnergyEvseNextChargeTargetTime() + { + } + + 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::NextChargeTargetTime::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 subscribeAttributeNextChargeTargetTimeWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.NextChargeTargetTime 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 NextChargeRequiredEnergy + */ +class ReadEnergyEvseNextChargeRequiredEnergy : public ReadAttribute { +public: + ReadEnergyEvseNextChargeRequiredEnergy() + : ReadAttribute("next-charge-required-energy") + { + } + + ~ReadEnergyEvseNextChargeRequiredEnergy() + { + } + + 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::NextChargeRequiredEnergy::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 readAttributeNextChargeRequiredEnergyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.NextChargeRequiredEnergy response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE NextChargeRequiredEnergy read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseNextChargeRequiredEnergy : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseNextChargeRequiredEnergy() + : SubscribeAttribute("next-charge-required-energy") + { + } + + ~SubscribeAttributeEnergyEvseNextChargeRequiredEnergy() + { + } + + 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::NextChargeRequiredEnergy::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 subscribeAttributeNextChargeRequiredEnergyWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.NextChargeRequiredEnergy 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 NextChargeTargetSoC + */ +class ReadEnergyEvseNextChargeTargetSoC : public ReadAttribute { +public: + ReadEnergyEvseNextChargeTargetSoC() + : ReadAttribute("next-charge-target-so-c") + { + } + + ~ReadEnergyEvseNextChargeTargetSoC() + { + } + + 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::NextChargeTargetSoC::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 readAttributeNextChargeTargetSoCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.NextChargeTargetSoC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE NextChargeTargetSoC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseNextChargeTargetSoC : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseNextChargeTargetSoC() + : SubscribeAttribute("next-charge-target-so-c") + { + } + + ~SubscribeAttributeEnergyEvseNextChargeTargetSoC() + { + } + + 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::NextChargeTargetSoC::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 subscribeAttributeNextChargeTargetSoCWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.NextChargeTargetSoC 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 ApproximateEVEfficiency + */ +class ReadEnergyEvseApproximateEVEfficiency : public ReadAttribute { +public: + ReadEnergyEvseApproximateEVEfficiency() + : ReadAttribute("approximate-evefficiency") + { + } + + ~ReadEnergyEvseApproximateEVEfficiency() + { + } + + 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::ApproximateEVEfficiency::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 readAttributeApproximateEVEfficiencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.ApproximateEVEfficiency response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE ApproximateEVEfficiency read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteEnergyEvseApproximateEVEfficiency : public WriteAttribute { +public: + WriteEnergyEvseApproximateEVEfficiency() + : WriteAttribute("approximate-evefficiency") + { + AddArgument("attr-name", "approximate-evefficiency"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteEnergyEvseApproximateEVEfficiency() + { + } + + 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::ApproximateEVEfficiency::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (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 = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedShort:mValue.Value()]; + } + + [cluster writeAttributeApproximateEVEfficiencyWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("EnergyEVSE ApproximateEVEfficiency write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + chip::app::DataModel::Nullable<uint16_t> mValue; +}; + +class SubscribeAttributeEnergyEvseApproximateEVEfficiency : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseApproximateEVEfficiency() + : SubscribeAttribute("approximate-evefficiency") + { + } + + ~SubscribeAttributeEnergyEvseApproximateEVEfficiency() + { + } + + 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::ApproximateEVEfficiency::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 subscribeAttributeApproximateEVEfficiencyWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.ApproximateEVEfficiency 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 StateOfCharge + */ +class ReadEnergyEvseStateOfCharge : public ReadAttribute { +public: + ReadEnergyEvseStateOfCharge() + : ReadAttribute("state-of-charge") + { + } + + ~ReadEnergyEvseStateOfCharge() + { + } + + 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::StateOfCharge::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 readAttributeStateOfChargeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.StateOfCharge response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE StateOfCharge read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseStateOfCharge : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseStateOfCharge() + : SubscribeAttribute("state-of-charge") + { + } + + ~SubscribeAttributeEnergyEvseStateOfCharge() + { + } + + 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::StateOfCharge::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 subscribeAttributeStateOfChargeWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.StateOfCharge 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 BatteryCapacity + */ +class ReadEnergyEvseBatteryCapacity : public ReadAttribute { +public: + ReadEnergyEvseBatteryCapacity() + : ReadAttribute("battery-capacity") + { + } + + ~ReadEnergyEvseBatteryCapacity() + { + } + + 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::BatteryCapacity::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 readAttributeBatteryCapacityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.BatteryCapacity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE BatteryCapacity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseBatteryCapacity : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseBatteryCapacity() + : SubscribeAttribute("battery-capacity") + { + } + + ~SubscribeAttributeEnergyEvseBatteryCapacity() + { + } + + 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::BatteryCapacity::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 subscribeAttributeBatteryCapacityWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.BatteryCapacity 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 VehicleID + */ +class ReadEnergyEvseVehicleID : public ReadAttribute { +public: + ReadEnergyEvseVehicleID() + : ReadAttribute("vehicle-id") + { + } + + ~ReadEnergyEvseVehicleID() + { + } + + 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::VehicleID::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 readAttributeVehicleIDWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.VehicleID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE VehicleID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseVehicleID : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseVehicleID() + : SubscribeAttribute("vehicle-id") + { + } + + ~SubscribeAttributeEnergyEvseVehicleID() + { + } + + 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::VehicleID::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 subscribeAttributeVehicleIDWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.VehicleID 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 SessionID + */ +class ReadEnergyEvseSessionID : public ReadAttribute { +public: + ReadEnergyEvseSessionID() + : ReadAttribute("session-id") + { + } + + ~ReadEnergyEvseSessionID() + { + } + + 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::SessionID::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 readAttributeSessionIDWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.SessionID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE SessionID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseSessionID : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseSessionID() + : SubscribeAttribute("session-id") + { + } + + ~SubscribeAttributeEnergyEvseSessionID() + { + } + + 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::SessionID::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 subscribeAttributeSessionIDWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.SessionID 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 SessionDuration + */ +class ReadEnergyEvseSessionDuration : public ReadAttribute { +public: + ReadEnergyEvseSessionDuration() + : ReadAttribute("session-duration") + { + } + + ~ReadEnergyEvseSessionDuration() + { + } + + 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::SessionDuration::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 readAttributeSessionDurationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.SessionDuration response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE SessionDuration read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseSessionDuration : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseSessionDuration() + : SubscribeAttribute("session-duration") + { + } + + ~SubscribeAttributeEnergyEvseSessionDuration() + { + } + + 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::SessionDuration::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 subscribeAttributeSessionDurationWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.SessionDuration 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 SessionEnergyCharged + */ +class ReadEnergyEvseSessionEnergyCharged : public ReadAttribute { +public: + ReadEnergyEvseSessionEnergyCharged() + : ReadAttribute("session-energy-charged") + { + } + + ~ReadEnergyEvseSessionEnergyCharged() + { + } + + 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::SessionEnergyCharged::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 readAttributeSessionEnergyChargedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.SessionEnergyCharged response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE SessionEnergyCharged read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseSessionEnergyCharged : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseSessionEnergyCharged() + : SubscribeAttribute("session-energy-charged") + { + } + + ~SubscribeAttributeEnergyEvseSessionEnergyCharged() + { + } + + 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::SessionEnergyCharged::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 subscribeAttributeSessionEnergyChargedWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.SessionEnergyCharged 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 SessionEnergyDischarged + */ +class ReadEnergyEvseSessionEnergyDischarged : public ReadAttribute { +public: + ReadEnergyEvseSessionEnergyDischarged() + : ReadAttribute("session-energy-discharged") + { + } + + ~ReadEnergyEvseSessionEnergyDischarged() + { + } + + 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::SessionEnergyDischarged::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 readAttributeSessionEnergyDischargedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.SessionEnergyDischarged response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE SessionEnergyDischarged read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseSessionEnergyDischarged : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseSessionEnergyDischarged() + : SubscribeAttribute("session-energy-discharged") + { + } + + ~SubscribeAttributeEnergyEvseSessionEnergyDischarged() + { + } + + 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::SessionEnergyDischarged::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 subscribeAttributeSessionEnergyDischargedWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.SessionEnergyDischarged response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute GeneratedCommandList + */ +class ReadEnergyEvseGeneratedCommandList : public ReadAttribute { +public: + ReadEnergyEvseGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadEnergyEvseGeneratedCommandList() + { + } + + 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::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyEVSE alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeEnergyEvseGeneratedCommandList() + { + } + + 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::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[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 subscribeAttributeGeneratedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AcceptedCommandList + */ +class ReadEnergyEvseAcceptedCommandList : public ReadAttribute { +public: + ReadEnergyEvseAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadEnergyEvseAcceptedCommandList() + { + } + + 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::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyEVSE alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeEnergyEvseAcceptedCommandList() + { + } + + 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::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[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 subscribeAttributeAcceptedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute EventList + */ +class ReadEnergyEvseEventList : public ReadAttribute { +public: + ReadEnergyEvseEventList() + : ReadAttribute("event-list") + { + } + + ~ReadEnergyEvseEventList() + { + } + + 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::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyEVSE alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseEventList : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeEnergyEvseEventList() + { + } + + 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::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[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 subscribeAttributeEventListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AttributeList + */ +class ReadEnergyEvseAttributeList : public ReadAttribute { +public: + ReadEnergyEvseAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadEnergyEvseAttributeList() + { + } + + 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::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyEVSE alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeEnergyEvseAttributeList() + { + } + + 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::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[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 subscribeAttributeAttributeListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute FeatureMap + */ +class ReadEnergyEvseFeatureMap : public ReadAttribute { +public: + ReadEnergyEvseFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadEnergyEvseFeatureMap() + { + } + + 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::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyEVSE alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeEnergyEvseFeatureMap() + { + } + + 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::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[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 subscribeAttributeFeatureMapWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ClusterRevision + */ +class ReadEnergyEvseClusterRevision : public ReadAttribute { +public: + ReadEnergyEvseClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadEnergyEvseClusterRevision() + { + } + + 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::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterEnergyEVSE alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("EnergyEVSE ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeEnergyEvseClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeEnergyEvseClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeEnergyEvseClusterRevision() + { + } + + 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::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[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 subscribeAttributeClusterRevisionWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EnergyEVSE.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + #endif // MTR_ENABLE_PROVISIONAL #endif // MTR_ENABLE_PROVISIONAL /*----------------------------------------------------------------------------*\ @@ -166290,6 +169518,173 @@ void registerClusterDemandResponseLoadControl(Commands & commands) commands.RegisterCluster(clusterName, clusterCommands); #endif // MTR_ENABLE_PROVISIONAL } +void registerClusterEnergyEvse(Commands & commands) +{ +#if MTR_ENABLE_PROVISIONAL + using namespace chip::app::Clusters::EnergyEvse; + + const char * clusterName = "EnergyEvse"; + + commands_list clusterCommands = { + make_unique<ClusterCommand>(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique<EnergyEvseDisable>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<EnergyEvseEnableCharging>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<EnergyEvseEnableDischarging>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<EnergyEvseStartDiagnostics>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<EnergyEvseSetTargets>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<EnergyEvseGetTargets>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<EnergyEvseClearTargets>(), // +#endif // MTR_ENABLE_PROVISIONAL + make_unique<ReadAttribute>(Id), // + make_unique<WriteAttribute>(Id), // + make_unique<SubscribeAttribute>(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseState>(), // + make_unique<SubscribeAttributeEnergyEvseState>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseSupplyState>(), // + make_unique<SubscribeAttributeEnergyEvseSupplyState>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseFaultState>(), // + make_unique<SubscribeAttributeEnergyEvseFaultState>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseChargingEnabledUntil>(), // + make_unique<SubscribeAttributeEnergyEvseChargingEnabledUntil>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseDischargingEnabledUntil>(), // + make_unique<SubscribeAttributeEnergyEvseDischargingEnabledUntil>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseCircuitCapacity>(), // + make_unique<SubscribeAttributeEnergyEvseCircuitCapacity>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseMinimumChargeCurrent>(), // + make_unique<SubscribeAttributeEnergyEvseMinimumChargeCurrent>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseMaximumChargeCurrent>(), // + make_unique<SubscribeAttributeEnergyEvseMaximumChargeCurrent>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseMaximumDischargeCurrent>(), // + make_unique<SubscribeAttributeEnergyEvseMaximumDischargeCurrent>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseUserMaximumChargeCurrent>(), // + make_unique<WriteEnergyEvseUserMaximumChargeCurrent>(), // + make_unique<SubscribeAttributeEnergyEvseUserMaximumChargeCurrent>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseRandomizationDelayWindow>(), // + make_unique<WriteEnergyEvseRandomizationDelayWindow>(), // + make_unique<SubscribeAttributeEnergyEvseRandomizationDelayWindow>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseNumberOfWeeklyTargets>(), // + make_unique<SubscribeAttributeEnergyEvseNumberOfWeeklyTargets>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseNumberOfDailyTargets>(), // + make_unique<SubscribeAttributeEnergyEvseNumberOfDailyTargets>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseNextChargeStartTime>(), // + make_unique<SubscribeAttributeEnergyEvseNextChargeStartTime>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseNextChargeTargetTime>(), // + make_unique<SubscribeAttributeEnergyEvseNextChargeTargetTime>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseNextChargeRequiredEnergy>(), // + make_unique<SubscribeAttributeEnergyEvseNextChargeRequiredEnergy>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseNextChargeTargetSoC>(), // + make_unique<SubscribeAttributeEnergyEvseNextChargeTargetSoC>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseApproximateEVEfficiency>(), // + make_unique<WriteEnergyEvseApproximateEVEfficiency>(), // + make_unique<SubscribeAttributeEnergyEvseApproximateEVEfficiency>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseStateOfCharge>(), // + make_unique<SubscribeAttributeEnergyEvseStateOfCharge>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseBatteryCapacity>(), // + make_unique<SubscribeAttributeEnergyEvseBatteryCapacity>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseVehicleID>(), // + make_unique<SubscribeAttributeEnergyEvseVehicleID>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseSessionID>(), // + make_unique<SubscribeAttributeEnergyEvseSessionID>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseSessionDuration>(), // + make_unique<SubscribeAttributeEnergyEvseSessionDuration>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseSessionEnergyCharged>(), // + make_unique<SubscribeAttributeEnergyEvseSessionEnergyCharged>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseSessionEnergyDischarged>(), // + make_unique<SubscribeAttributeEnergyEvseSessionEnergyDischarged>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseGeneratedCommandList>(), // + make_unique<SubscribeAttributeEnergyEvseGeneratedCommandList>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseAcceptedCommandList>(), // + make_unique<SubscribeAttributeEnergyEvseAcceptedCommandList>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseEventList>(), // + make_unique<SubscribeAttributeEnergyEvseEventList>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseAttributeList>(), // + make_unique<SubscribeAttributeEnergyEvseAttributeList>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseFeatureMap>(), // + make_unique<SubscribeAttributeEnergyEvseFeatureMap>(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadEnergyEvseClusterRevision>(), // + make_unique<SubscribeAttributeEnergyEvseClusterRevision>(), // +#endif // MTR_ENABLE_PROVISIONAL + make_unique<ReadEvent>(Id), // + make_unique<SubscribeEvent>(Id), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +#endif // MTR_ENABLE_PROVISIONAL +} void registerClusterDoorLock(Commands & commands) { using namespace chip::app::Clusters::DoorLock; @@ -169422,6 +172817,7 @@ void registerClusters(Commands & commands) registerClusterBooleanSensorConfiguration(commands); registerClusterValveConfigurationAndControl(commands); registerClusterDemandResponseLoadControl(commands); + registerClusterEnergyEvse(commands); registerClusterDoorLock(commands); registerClusterWindowCovering(commands); registerClusterBarrierControl(commands);